summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPicca Frédéric-Emmanuel <picca@debian.org>2017-09-02 16:12:29 +0200
committerPicca Frédéric-Emmanuel <picca@debian.org>2017-09-02 16:12:29 +0200
commit55ac9919edc5cdeae0c7f48a6a1b9b3b8806e8e2 (patch)
treefff14992717037df23f4280933d2e77969780282
Import python-fabio_0.5.0+dfsg.orig.tar.gz
[dgit import orig python-fabio_0.5.0+dfsg.orig.tar.gz]
-rw-r--r--MANIFEST.in22
-rw-r--r--PKG-INFO211
-rw-r--r--README.rst183
-rw-r--r--copyright173
-rw-r--r--doc/Makefile130
-rw-r--r--doc/make.bat170
-rw-r--r--doc/source/Changelog.rst137
-rw-r--r--doc/source/_static/placeholder1
-rw-r--r--doc/source/api/modules.rst297
-rw-r--r--doc/source/conf.py240
-rw-r--r--doc/source/coverage.rst56
-rw-r--r--doc/source/getting_started.rst289
-rw-r--r--doc/source/img/viewer.pngbin0 -> 183305 bytes
-rw-r--r--doc/source/index.rst29
-rw-r--r--doc/source/install.rst337
-rw-r--r--doc/source/man/fabio_viewer.rst11
-rw-r--r--doc/source/mathjax.py69
-rw-r--r--doc/source/performances.rst44
-rw-r--r--doc/source/tutorials/Nexus2cbf.ipynb1062
-rw-r--r--doc/source/tutorials/Nexus2cbf.rst180
-rw-r--r--doc/source/tutorials/convert_CBF.rst62
-rw-r--r--doc/source/tutorials/index.rst14
-rw-r--r--fabio.egg-info/SOURCES.txt217
-rw-r--r--fabio/GEimage.py367
-rw-r--r--fabio/HiPiCimage.py140
-rw-r--r--fabio/OXDimage.py570
-rw-r--r--fabio/TiffIO.py1247
-rw-r--r--fabio/__init__.py87
-rw-r--r--fabio/adscimage.py143
-rw-r--r--fabio/app/__init__.py0
-rw-r--r--fabio/app/convert.py400
-rw-r--r--fabio/app/setup.py39
-rwxr-xr-xfabio/app/viewer.py1523
-rw-r--r--fabio/benchmark/__init__.py95
-rw-r--r--fabio/benchmark/setup.py39
-rw-r--r--fabio/binaryimage.py133
-rw-r--r--fabio/bruker100image.py404
-rw-r--r--fabio/brukerimage.py432
-rw-r--r--fabio/cbfimage.py846
-rw-r--r--fabio/compression.py456
-rw-r--r--fabio/converters.py95
-rw-r--r--fabio/datIO.py90
-rw-r--r--fabio/directories.py60
-rw-r--r--fabio/dm3image.py253
-rw-r--r--fabio/edfimage.py982
-rw-r--r--fabio/eigerimage.py206
-rw-r--r--fabio/ext/__init__.py0
-rw-r--r--fabio/ext/_cif.c20245
-rw-r--r--fabio/ext/_cif.pyx149
-rw-r--r--fabio/ext/byte_offset.c22778
-rw-r--r--fabio/ext/byte_offset.pyx358
-rw-r--r--fabio/ext/cf_io.c6727
-rw-r--r--fabio/ext/cf_io.pyx119
-rw-r--r--fabio/ext/include/ccp4_pack.h94
-rw-r--r--fabio/ext/include/columnfile.h55
-rw-r--r--fabio/ext/include/msvc/stdint.h247
-rw-r--r--fabio/ext/mar345_IO.c31475
-rw-r--r--fabio/ext/mar345_IO.pyx715
-rw-r--r--fabio/ext/setup.py66
-rw-r--r--fabio/ext/src/ccp4_pack.c888
-rw-r--r--fabio/ext/src/cf_iomodule.c79
-rw-r--r--fabio/ext/src/columnfile.c225
-rw-r--r--fabio/fabioformats.py173
-rw-r--r--fabio/fabioimage.py604
-rw-r--r--fabio/fabioutils.py693
-rw-r--r--fabio/file_series.py436
-rw-r--r--fabio/fit2dimage.py169
-rw-r--r--fabio/fit2dmaskimage.py153
-rw-r--r--fabio/fit2dspreadsheetimage.py102
-rw-r--r--fabio/hdf5image.py174
-rw-r--r--fabio/jpeg2kimage.py159
-rw-r--r--fabio/jpegimage.py120
-rw-r--r--fabio/kcdimage.py192
-rw-r--r--fabio/mar345image.py394
-rw-r--r--fabio/marccdimage.py344
-rw-r--r--fabio/mpaimage.py131
-rw-r--r--fabio/mrcimage.py188
-rw-r--r--fabio/nexus.py387
-rw-r--r--fabio/numpyimage.py199
-rw-r--r--fabio/openimage.py217
-rw-r--r--fabio/pilatusimage.py113
-rw-r--r--fabio/pixiimage.py171
-rw-r--r--fabio/pnmimage.py230
-rw-r--r--fabio/raxisimage.py339
-rw-r--r--fabio/readbytestream.py114
-rw-r--r--fabio/setup.py48
-rw-r--r--fabio/speimage.py313
-rw-r--r--fabio/templateimage.py131
-rwxr-xr-xfabio/test/__init__.py56
-rwxr-xr-xfabio/test/profile_all.py85
-rw-r--r--fabio/test/setup.py39
-rw-r--r--fabio/test/testGEimage.py84
-rw-r--r--fabio/test/testOXDimage.py190
-rwxr-xr-xfabio/test/testXSDimage.py102
-rwxr-xr-xfabio/test/test_all.py118
-rw-r--r--fabio/test/test_all_images.py104
-rw-r--r--fabio/test/test_file_series.py126
-rw-r--r--fabio/test/test_filename_steps.py83
-rw-r--r--fabio/test/test_flat_binary.py91
-rw-r--r--fabio/test/test_nexus.py80
-rw-r--r--fabio/test/testadscimage.py114
-rw-r--r--fabio/test/testbruker100image.py105
-rw-r--r--fabio/test/testbrukerimage.py227
-rwxr-xr-xfabio/test/testcbfimage.py176
-rwxr-xr-xfabio/test/testcompression.py135
-rwxr-xr-xfabio/test/testedfimage.py390
-rw-r--r--fabio/test/testeigerimage.py87
-rw-r--r--fabio/test/testfabioconvert.py196
-rw-r--r--fabio/test/testfabioimage.py233
-rw-r--r--fabio/test/testfilenames.py127
-rw-r--r--fabio/test/testfit2dimage.py103
-rw-r--r--fabio/test/testfit2dmaskimage.py159
-rw-r--r--fabio/test/testhdf5image.py106
-rw-r--r--fabio/test/testheadernotsingleton.py80
-rw-r--r--fabio/test/testjpeg2kimage.py173
-rw-r--r--fabio/test/testjpegimage.py170
-rwxr-xr-xfabio/test/testkcdimage.py97
-rw-r--r--fabio/test/testmar345image.py208
-rw-r--r--fabio/test/testmccdimage.py124
-rw-r--r--fabio/test/testmpaimage.py76
-rwxr-xr-xfabio/test/testnumpyimage.py108
-rw-r--r--fabio/test/testopenheader.py69
-rw-r--r--fabio/test/testopenimage.py242
-rw-r--r--fabio/test/testpilatusimage.py78
-rwxr-xr-xfabio/test/testpnmimage.py95
-rw-r--r--fabio/test/testraxisimage.py121
-rw-r--r--fabio/test/testspeimage.py163
-rwxr-xr-xfabio/test/testtifimage.py185
-rw-r--r--fabio/test/utilstest.py288
-rw-r--r--fabio/third_party/__init__.py1
-rw-r--r--fabio/third_party/argparse.py50
-rw-r--r--fabio/third_party/gzip.py60
-rw-r--r--fabio/third_party/ordereddict.py50
-rw-r--r--fabio/third_party/setup.py48
-rw-r--r--fabio/third_party/six.py52
-rw-r--r--fabio/tifimage.py341
-rw-r--r--fabio/utils/__init__.py0
-rw-r--r--fabio/utils/mathutils.py58
-rw-r--r--fabio/utils/pilutils.py129
-rw-r--r--fabio/utils/setup.py39
-rw-r--r--fabio/xsdimage.py168
-rwxr-xr-xrun_tests.py337
-rw-r--r--setup.cfg5
-rw-r--r--setup.py705
-rw-r--r--stdeb.cfg8
-rw-r--r--version.py103
146 files changed, 110802 insertions, 0 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..a2003af
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,22 @@
+include README.rst
+include MANIFEST.in
+include version.py
+include run_tests.py
+include copyright
+exclude MANIFEST
+include stdeb.cfg
+recursive-include fabio/ext *.c *.h *.pyx
+recursive-include pylint *
+recursive-include scripts *
+recursive-exclude build *
+recursive-exclude dist *
+recursive-exclude test/tiftest *
+recursive-exclude test/testimages *
+recursive-exclude testimages *
+recursive-exclude fabio.egg-info *
+
+
+#Include doc without checkpoints
+recursive-include doc *
+recursive-exclude doc .ipynb_checkpoints/*.ipynb
+
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..4738ffa
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,211 @@
+Metadata-Version: 1.1
+Name: fabio
+Version: 0.5.0
+Summary: Image IO for fable
+Home-page: http://github.com/silx-kit/fabio
+Author: Henning Sorensen, Erik Knudsen, Jon Wright, Regis Perdreau, Jérôme Kieffer, Gael Goret, Brian Pauw
+Author-email: fable-talk@lists.sourceforge.net
+License: MIT
+Download-URL: https://github.com/silx-kit/fabio/releases
+Description: FabIO: Fable Input/Output library
+ =================================
+
+ Main websites:
+
+ * http://fable.sf.net
+ * https://github.com/silx-kit/fabio
+
+
+ |Build Status| |Appveyor Status|
+
+ ----
+
+ FabIO is an I/O library for images produced by 2D X-ray detectors and written in Python.
+ FabIO support images detectors from a dozen of companies (including Mar, Dectris, ADSC, Hamamatsu, Oxford, ...),
+ for a total of 20 different file formats (like CBF, EDF, TIFF, ...) and offers an unified interface to their
+ headers (as a python dictionary) and datasets (as a numpy ndarray of integers or floats)
+
+ Getting FabIO
+ -------------
+
+ FabIO is available from `PyPI <https://pypi.python.org/pypi/fabio>`_.
+
+ `Debian/Ubuntu packages <http://www.silx.org/pub/debian/binary/>`_, and
+ `wheels <http://www.silx.org/pub/wheelhouse/>`_ are available
+ for windows, linux and MacOSX from the silx repository:
+
+ Documentation is available at `PythonHosted <http://pythonhosted.org/fabio/>`_,
+ Continuous documentation at `ReadTheDocs <http://fabio.readthedocs.io>`_ and
+ Nightly build documentation at `silx <http://www.silx.org/doc/fabio/>`_.
+
+ Citation:
+ ---------
+ The general philosophy of the library is described in:
+ `FabIO: easy access to two-dimensional X-ray detector images in Python; E. B. Knudsen, H. O. Sørensen, J. P. Wright, G. Goret and J. Kieffer Journal of Applied Crystallography, Volume 46, Part 2, pages 537-539. <http://dx.doi.org/10.1107/S0021889813000150>`_
+
+ Transparent handling of compressed files
+ ----------------------------------------
+ Fabio is expected to handle gzip and bzip2 compressed files transparently.
+ Following a query about the performance of reading compressed data, some
+ benchmarking details have been collected at fabio_compressed_speed.
+ This means that when your python was configured and built you needed the
+ bzip and gzip modules to be present (eg libbz2-dev package for ubuntu)
+ Using fabio in your own python programs
+ Example::
+
+ >>> import fabio
+ >>> obj = fabio.edfimage("mydata0000.edf")
+ >>> obj.data.shape
+ (2048, 2048)
+ >>> obj.header["Omega"]
+ 23.5
+
+
+ Design Specifications
+ ---------------------
+ Name: Fabio = Fable Input/Output
+
+ Idea:
+ .....
+ Have a base class for all our 2D diffraction greyscale images.
+ This consists of a 2D array (numpy ndarray)
+ and a python dictionary (actually an ordered dict) of header information in (string key, string value) pairs.
+
+ Class FabioImage
+ ................
+ Needs a name which will not to be confused with an RGB color image.
+
+ Class attributes:
+
+ * data -> 2D array
+ * header -> ordered dictionary
+ * rows, columns, dim1, dim2 -> data.shape (properties determined on the fly)
+ * header_keys -> property for list(header.keys()), formerly used to retain the order of the header
+ * bytecode -> data.typecode() (property)
+ * m, minval, maxval, stddev -> image statistics, could add others, eg roi[slice]
+
+ Class methods (functions):
+ ..........................
+
+ * integrate_area() -> return sum(self.data) within slice
+ * rebin(fact) -> rebins data, adjusts dims
+ * toPIL16() -> returns a PILimage
+ * getheader() -> returns self.header
+ * resetvals() -> resets the statistics
+ * getmean() -> (computes) returns self.m
+ * getmin() -> (computes) returns self.minval
+ * getmax() -> (computes) returns self.maxval
+ * getstddev() -> (computes) returns self.stddev
+ * read() -> read image from file [or stream, or shared memory]
+ * write() -> write image to file [or stream, or shared memory]
+ * readheader() -> read only the header [much faster for scanning files]
+
+ Each individual file format would then inherit all the functionality of this class and just make new read and write methods.
+
+ There are also fileseries related methods (next(), previous(), ...) which returns a FabioImage instance of the next/previous frame in a fileserie
+
+ Other feature:
+
+ * possibility for using on-the-fly external compression - i.e. if files are stored as something as .gz, .bz2 etc could decompress them, using an external compression mechanism (if available). This is present in fabian but requires that images are edfs.
+
+
+ Known file formats
+ ------------------
+
+ * Bruker:
+
+ + BrukerImage
+ + Bruker100Image
+ + KcdImage: Nonius KappaCCD diffractometer
+
+ * Mar Research:
+
+ + MarccdImage (fileformat derived from Tiff)
+ + Mar345Image imaging plate with PCK compression
+
+ * Dectris:
+
+ + CbfImage (implements a fast byte offset de/compression scheme in python/cython)
+ + PilatusImage (fileformat derived from Tiff)
+ * EigerImage (derived from HDF5/NeXus format)
+
+ * ESRF:
+
+ + EdfImage: The ESRF data Format
+ + XsdImage: XML serialized image from EDNA
+ + Fit2dImage: Fit2d binary format
+ + Fit2dmaskImage: Fit2d Mask format
+ + Fit2dSpreadsheetImage: Fit2d ascii tables (spread-sheet)
+
+ * ADSC:
+
+ + AdscImage
+
+ * GE detector at APS
+
+ + GEimage
+
+ * PNM
+
+ + PnmImage
+
+ * Tiff
+
+ + TifImage
+ + TiffIO from PyMca
+
+ * D3M
+
+ + D3mImage
+
+ * Hamamatsu
+
+ + HiPiCImage
+
+ * Oxford Diffraction Sapphire 3
+
+ + OXDimage uncompressed
+ + OXDimage with TY1 byte offset compression
+ + OXDimage with TY5 byte offset compression (experimental)
+
+ * Nonius -> now owned by Bruker
+
+ * HDF5: generic format for stack of images
+ + Hdf5Image
+ + EigerImage
+
+ * Raw Binary without compression
+
+ Installation
+ ------------
+
+ Please see doc/source/INSTALL.rst
+
+ Changelog
+ ---------
+
+ Please see doc/source/Changelog.rst
+
+ .. |Build Status| image:: https://travis-ci.org/silx-kit/fabio.svg?branch=master
+ :target: https://travis-ci.org/silx-kit/fabio
+ .. |Appveyor Status| image:: https://ci.appveyor.com/api/projects/status/4k6lol1vq30qhf66/branch/master?svg=true
+ :target: https://ci.appveyor.com/project/ESRF/fabio/branch/master
+
+Platform: UNKNOWN
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Environment :: Console
+Classifier: Intended Audience :: End Users/Desktop
+Classifier: Intended Audience :: Developers
+Classifier: Intended Audience :: Science/Research
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Operating System :: MacOS :: MacOS X
+Classifier: Operating System :: Microsoft :: Windows
+Classifier: Operating System :: POSIX
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Cython
+Classifier: Programming Language :: C
+Classifier: Topic :: Scientific/Engineering :: Chemistry
+Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
+Classifier: Topic :: Scientific/Engineering :: Physics
+Classifier: Topic :: Scientific/Engineering :: Visualization
+Classifier: Topic :: Software Development :: Libraries :: Python Modules
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..64cf2cd
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,183 @@
+FabIO: Fable Input/Output library
+=================================
+
+Main websites:
+
+ * http://fable.sf.net
+ * https://github.com/silx-kit/fabio
+
+
+|Build Status| |Appveyor Status|
+
+----
+
+FabIO is an I/O library for images produced by 2D X-ray detectors and written in Python.
+FabIO support images detectors from a dozen of companies (including Mar, Dectris, ADSC, Hamamatsu, Oxford, ...),
+for a total of 20 different file formats (like CBF, EDF, TIFF, ...) and offers an unified interface to their
+headers (as a python dictionary) and datasets (as a numpy ndarray of integers or floats)
+
+Getting FabIO
+-------------
+
+FabIO is available from `PyPI <https://pypi.python.org/pypi/fabio>`_.
+
+`Debian/Ubuntu packages <http://www.silx.org/pub/debian/binary/>`_, and
+`wheels <http://www.silx.org/pub/wheelhouse/>`_ are available
+for windows, linux and MacOSX from the silx repository:
+
+Documentation is available at `PythonHosted <http://pythonhosted.org/fabio/>`_,
+Continuous documentation at `ReadTheDocs <http://fabio.readthedocs.io>`_ and
+Nightly build documentation at `silx <http://www.silx.org/doc/fabio/>`_.
+
+Citation:
+---------
+The general philosophy of the library is described in:
+`FabIO: easy access to two-dimensional X-ray detector images in Python; E. B. Knudsen, H. O. Sørensen, J. P. Wright, G. Goret and J. Kieffer Journal of Applied Crystallography, Volume 46, Part 2, pages 537-539. <http://dx.doi.org/10.1107/S0021889813000150>`_
+
+Transparent handling of compressed files
+----------------------------------------
+Fabio is expected to handle gzip and bzip2 compressed files transparently.
+Following a query about the performance of reading compressed data, some
+benchmarking details have been collected at fabio_compressed_speed.
+This means that when your python was configured and built you needed the
+bzip and gzip modules to be present (eg libbz2-dev package for ubuntu)
+Using fabio in your own python programs
+Example::
+
+ >>> import fabio
+ >>> obj = fabio.edfimage("mydata0000.edf")
+ >>> obj.data.shape
+ (2048, 2048)
+ >>> obj.header["Omega"]
+ 23.5
+
+
+Design Specifications
+---------------------
+Name: Fabio = Fable Input/Output
+
+Idea:
+.....
+Have a base class for all our 2D diffraction greyscale images.
+This consists of a 2D array (numpy ndarray)
+and a python dictionary (actually an ordered dict) of header information in (string key, string value) pairs.
+
+Class FabioImage
+................
+Needs a name which will not to be confused with an RGB color image.
+
+Class attributes:
+
+* data -> 2D array
+* header -> ordered dictionary
+* rows, columns, dim1, dim2 -> data.shape (properties determined on the fly)
+* header_keys -> property for list(header.keys()), formerly used to retain the order of the header
+* bytecode -> data.typecode() (property)
+* m, minval, maxval, stddev -> image statistics, could add others, eg roi[slice]
+
+Class methods (functions):
+..........................
+
+* integrate_area() -> return sum(self.data) within slice
+* rebin(fact) -> rebins data, adjusts dims
+* toPIL16() -> returns a PILimage
+* getheader() -> returns self.header
+* resetvals() -> resets the statistics
+* getmean() -> (computes) returns self.m
+* getmin() -> (computes) returns self.minval
+* getmax() -> (computes) returns self.maxval
+* getstddev() -> (computes) returns self.stddev
+* read() -> read image from file [or stream, or shared memory]
+* write() -> write image to file [or stream, or shared memory]
+* readheader() -> read only the header [much faster for scanning files]
+
+Each individual file format would then inherit all the functionality of this class and just make new read and write methods.
+
+There are also fileseries related methods (next(), previous(), ...) which returns a FabioImage instance of the next/previous frame in a fileserie
+
+Other feature:
+
+* possibility for using on-the-fly external compression - i.e. if files are stored as something as .gz, .bz2 etc could decompress them, using an external compression mechanism (if available). This is present in fabian but requires that images are edfs.
+
+
+Known file formats
+------------------
+
+* Bruker:
+
+ + BrukerImage
+ + Bruker100Image
+ + KcdImage: Nonius KappaCCD diffractometer
+
+* Mar Research:
+
+ + MarccdImage (fileformat derived from Tiff)
+ + Mar345Image imaging plate with PCK compression
+
+* Dectris:
+
+ + CbfImage (implements a fast byte offset de/compression scheme in python/cython)
+ + PilatusImage (fileformat derived from Tiff)
+ * EigerImage (derived from HDF5/NeXus format)
+
+* ESRF:
+
+ + EdfImage: The ESRF data Format
+ + XsdImage: XML serialized image from EDNA
+ + Fit2dImage: Fit2d binary format
+ + Fit2dmaskImage: Fit2d Mask format
+ + Fit2dSpreadsheetImage: Fit2d ascii tables (spread-sheet)
+
+* ADSC:
+
+ + AdscImage
+
+* GE detector at APS
+
+ + GEimage
+
+* PNM
+
+ + PnmImage
+
+* Tiff
+
+ + TifImage
+ + TiffIO from PyMca
+
+* D3M
+
+ + D3mImage
+
+* Hamamatsu
+
+ + HiPiCImage
+
+* Oxford Diffraction Sapphire 3
+
+ + OXDimage uncompressed
+ + OXDimage with TY1 byte offset compression
+ + OXDimage with TY5 byte offset compression (experimental)
+
+* Nonius -> now owned by Bruker
+
+* HDF5: generic format for stack of images
+ + Hdf5Image
+ + EigerImage
+
+* Raw Binary without compression
+
+Installation
+------------
+
+Please see doc/source/INSTALL.rst
+
+Changelog
+---------
+
+Please see doc/source/Changelog.rst
+
+.. |Build Status| image:: https://travis-ci.org/silx-kit/fabio.svg?branch=master
+ :target: https://travis-ci.org/silx-kit/fabio
+.. |Appveyor Status| image:: https://ci.appveyor.com/api/projects/status/4k6lol1vq30qhf66/branch/master?svg=true
+ :target: https://ci.appveyor.com/project/ESRF/fabio/branch/master
diff --git a/copyright b/copyright
new file mode 100644
index 0000000..74a36c9
--- /dev/null
+++ b/copyright
@@ -0,0 +1,173 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: fabio
+Upstream-Contact: Jérôme Kieffer <kieffer@esrf.eu>
+Source: https://github.com/silx-kit/fabio/releases/tag/v0.4.0
+Files-Excluded: third_party
+
+Files: *
+Copyright: 2007-2009 Henning O. Sorensen & Erik Knudsen
+ Center for Fundamental Research: Metal Structures in Four Dimensions
+ Risoe National Laboratory
+ Frederiksborgvej 399
+ DK-4000 Roskilde
+ email:erik.knudsen@risoe.dk
+ 2009-2016 Jonathan P. Wright, Jerome Kieffer and Gael Goret
+ European Synchrotron Radiation Facility
+ 6 rue Jules Horowitz
+ 38000 Grenoble, France
+License: MIT
+
+Files: debian/*
+Copyright: 2011 Jerome Kieffer <jerome.kieffer@esrf.fr>
+ 2013-2014 Picca Frederic-Emmanuel <picca@debian.org>
+License: GPL-2.0+
+
+Files: fabio/raxisimage.py
+Copyright: 2013-2014 Brian R. Pauw <brian@stack.nl>
+License: MIT
+
+Files: fabio/mpaimage.py
+Copyright: 2017 Jesse Hopkins (CHESS, USA)
+License: MIT
+
+Files: fabio/ext/src/ccp4_pack.c
+ fabio/ext/inlcude/ccp4_pack.h
+Copyright: 1995 Jan Pieter Abrahams
+ MRC Cambridge (UK)
+ 2007-2009 Henning O. Sorensen & Erik Knudsen
+ Risoe National Laboratory (DK)
+ 2012-2016 European Synchrotron Radiation Facility (FR)
+License: LGPL-3.0+
+
+Files: fabio/speimage
+ fabio/test/testspeimage
+Copyright: 2016 University Köln, Germany
+License: MIT
+
+Files: src/stdint.h
+Copyright: 2006-2008 Alexander Chemeris
+License: BSD-3
+
+Files: third_party/ordereddict.py
+Copyright: 2009 Raymond Hettinger
+License: MIT
+
+Files: third_party/argparse.py
+Copyright: 2006-2009 Steven J. Bethard <steven.bethard@gmail.com>.
+License: Apache 2.0
+
+Files: third_party/six.py
+Copyright: 2010-2014 Benjamin Peterson
+License: MIT
+
+License: GPL-2.0+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
+
+License: GPL-3.0+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
+
+License: LGPL-3.0+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU Lesser General
+ Public License version 3 can be found in "/usr/share/common-licenses/LGPL-3".
+
+License: BSD-3
+ 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.
+ .
+ 3. The name of the author may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+ .
+ 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.
+
+License: MIT
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+License: Apache2
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ use this file except in compliance with the License. You may obtain a copy
+ of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ License for the specific language governing permissions and limitations
+ under the License.
+
+
diff --git a/doc/Makefile b/doc/Makefile
new file mode 100644
index 0000000..dbb4797
--- /dev/null
+++ b/doc/Makefile
@@ -0,0 +1,130 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = build
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
+
+help:
+ @echo "Please use \`make <target>' where <target> is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+ -rm -rf $(BUILDDIR)/*
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/FabIO.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/FabIO.qhc"
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/FabIO"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/FabIO"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/doc/make.bat b/doc/make.bat
new file mode 100644
index 0000000..4b7fdee
--- /dev/null
+++ b/doc/make.bat
@@ -0,0 +1,170 @@
+@ECHO OFF
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXBUILD%" == "" (
+ set SPHINXBUILD=sphinx-build
+)
+set BUILDDIR=build
+set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source
+if NOT "%PAPER%" == "" (
+ set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
+)
+
+if "%1" == "" goto help
+
+if "%1" == "help" (
+ :help
+ echo.Please use `make ^<target^>` where ^<target^> is one of
+ echo. html to make standalone HTML files
+ echo. dirhtml to make HTML files named index.html in directories
+ echo. singlehtml to make a single large HTML file
+ echo. pickle to make pickle files
+ echo. json to make JSON files
+ echo. htmlhelp to make HTML files and a HTML help project
+ echo. qthelp to make HTML files and a qthelp project
+ echo. devhelp to make HTML files and a Devhelp project
+ echo. epub to make an epub
+ echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
+ echo. text to make text files
+ echo. man to make manual pages
+ echo. changes to make an overview over all changed/added/deprecated items
+ echo. linkcheck to check all external links for integrity
+ echo. doctest to run all doctests embedded in the documentation if enabled
+ goto end
+)
+
+if "%1" == "clean" (
+ for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
+ del /q /s %BUILDDIR%\*
+ goto end
+)
+
+if "%1" == "html" (
+ %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/html.
+ goto end
+)
+
+if "%1" == "dirhtml" (
+ %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
+ goto end
+)
+
+if "%1" == "singlehtml" (
+ %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
+ goto end
+)
+
+if "%1" == "pickle" (
+ %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; now you can process the pickle files.
+ goto end
+)
+
+if "%1" == "json" (
+ %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; now you can process the JSON files.
+ goto end
+)
+
+if "%1" == "htmlhelp" (
+ %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; now you can run HTML Help Workshop with the ^
+.hhp project file in %BUILDDIR%/htmlhelp.
+ goto end
+)
+
+if "%1" == "qthelp" (
+ %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; now you can run "qcollectiongenerator" with the ^
+.qhcp project file in %BUILDDIR%/qthelp, like this:
+ echo.^> qcollectiongenerator %BUILDDIR%\qthelp\FabIO.qhcp
+ echo.To view the help file:
+ echo.^> assistant -collectionFile %BUILDDIR%\qthelp\FabIO.ghc
+ goto end
+)
+
+if "%1" == "devhelp" (
+ %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished.
+ goto end
+)
+
+if "%1" == "epub" (
+ %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The epub file is in %BUILDDIR%/epub.
+ goto end
+)
+
+if "%1" == "latex" (
+ %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
+ goto end
+)
+
+if "%1" == "text" (
+ %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The text files are in %BUILDDIR%/text.
+ goto end
+)
+
+if "%1" == "man" (
+ %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The manual pages are in %BUILDDIR%/man.
+ goto end
+)
+
+if "%1" == "changes" (
+ %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.The overview file is in %BUILDDIR%/changes.
+ goto end
+)
+
+if "%1" == "linkcheck" (
+ %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Link check complete; look for any errors in the above output ^
+or in %BUILDDIR%/linkcheck/output.txt.
+ goto end
+)
+
+if "%1" == "doctest" (
+ %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Testing of doctests in the sources finished, look at the ^
+results in %BUILDDIR%/doctest/output.txt.
+ goto end
+)
+
+:end
diff --git a/doc/source/Changelog.rst b/doc/source/Changelog.rst
new file mode 100644
index 0000000..a7ab501
--- /dev/null
+++ b/doc/source/Changelog.rst
@@ -0,0 +1,137 @@
+Changelog
+=========
+
+FabIO-0.5.0 (08/2017):
+......................
+
+- All source files are now under MIT license (re-implement PCK/packbits in Cython)
+- Context manager for fabio.open + automatic closing of file.
+- Iterator over all frames in a file.
+- Debian packaging for debian 8 and 9.
+- Use (patched-) ordered dictionaries for storing headers.
+- Many clean up and bug-fixes
+- New formats: mpa, jpeg and jpeg2000
+- Provide "convert" and "viewer" scripts in the fabio-bin debian package.
+
+
+FabIO-0.4.0 (07/2016):
+......................
+
+- Write support for Bruker100 (contribution from Sigmund Neher)
+- Read support for Princeton instrumentation cameras (contribution from Clemens Percher)
+- Read support for FIT2D binary format
+- Read support for Eiger detector (Dectris) and generic HDF5 (partial)
+- Switch ESRF-contributed file formats to MIT license (more liberal)
+- Drop support for python 2.6, 3.2 and 3.3. Supports only 2.7 and 3.4+
+- Include TiffIO into core of FabIO (no more third-party)
+- Refactor mar345 (contributed by Henri Payno)
+- Enhanced byte-offset compression using Cython
+- Move master repository to silx-kit (https://github.com/silx-kit)
+
+FabIO-0.3.0 (12/2015):
+......................
+
+- Migrate to PEP8 for class names.
+- Use a factory & registry instead of fiddling in sys.modules for instance creation
+- dim1, dim2, bpp and bytecode are properties. Use their private version while reading.
+- FabioImage.header["filename"] has disappeared. Use FabioImage.filename instead.
+- Automatic backported package down to debian-8
+- Compatibility checked with 2.6, 2.7, 3.2, 3.3, 3.4 and 3.5
+- Continuous integration based on appveyor (windows) and travis (linux)
+- Support for numpy 2d-array and PNM saving
+- Move away from Sourceforge -> Github.
+
+FabIO-0.2.2 (07/2015):
+......................
+
+- work on the auto-documentation on ReadTheDocs (see http://fabio.readthedocs.org)
+- fix regression when reading BytesIO
+- Python3 compatibility
+- prepare multiple package for debian
+
+FabIO-0.2.1 (02/2015):
+......................
+
+- Fix issues with variable endianness (tested PPC, PPC64le, i386, x86-64, ARM processors)
+- Optimization of byte-offset reader (about 20% faster on some processors)
+
+FabIO-0.2.0 (01/2015):
+......................
+
+- Compatibility with Python3 (tested on Python 2.6, 2.7, 3.2 and 3.4)
+- Support for Mar555 flat panel
+- Optimization of CBF reader (about 2x faster)
+- include tests into installed module (and download in /tmp)
+
+FabIO-0.1.4:
+............
+- Work on compatibility with Python3
+- Specific debian support with test images included but no auto-generated files
+- Image viewer (fabio_viewer) based on Qt4 (Thanks for Gaël Goret)
+- Reading images from HDF5 datasets
+- Read support for "MRC" images
+- Read support for "Pixi detector (Thanks for Jon Wright)
+- Read support for "Raxis" images from Rigaku (Thanks to Brian Pauw)
+- Write support for fit2d mask images
+- Drop support for python 2.5 + Cythonization of other algorithms
+
+FabIO-0.1.3:
+............
+- Fixed a memory-leak in mar345 module
+- Improved support for bruker format (writer & reader)
+- Fixed a bug in EDF headers (very long headers)
+- Provide template for new file-formats
+- Fix a bug related to PIL in new MacOSX
+- Allow binary-images to be read from end
+
+FabIO-0.1.2 (04/2013):
+......................
+
+- Fixed a bug in fabioimage.write (impacted all writers)
+- added Sphinx documentation "python setup.py build_doc"
+- PyLint compliance of some classes (rename, ...)
+- tests from installer with "python setup.py build test"
+
+FabIO-0.1.1:
+............
+
+- Merged Mar345 image reader and writer with cython bindings (towards python3 compliance)
+- Improve CBF image writing under windows
+- Bz2, Gzip and Flat files are managed through a common way ... classes are more (python v2.5) or less (python v2.7) overloaded
+- Fast EDF reading if one assumes offsets are the same between files, same for ROIs
+
+FabIO-0.1.0:
+............
+
+- OXD reader improved and writer implemented
+- Mar345 reader improved and writer implemented
+- CBF writer implemented
+- Clean-up of the code & bug fixes
+- Move towards python3
+- Make PIL optional dependency
+- Preliminary Python3 support (partial).
+
+FabIO-0.0.8:
+............
+
+- Support for Tiff using TiffIO module from V.A.Solé
+- Clean-up of the code & bug fixes
+
+FabIO-0.0.7 (03/2011):
+......................
+
+- Support for multi-frames EDF files
+- Support for XML images/2D arrays used in EDNA
+- new method: fabio.open(filename) that is an alias for fabio.openimage.openimage(filename)
+
+FabIO-0.0.6 (01/2011):
+......................
+
+- Support for CBF files from Pilatus detectors
+- Support for KCD files from Nonius Kappa CCD images
+- write EDF with their native data type (instead of uint16 by default)
+
+FabIO-0.0.4 (2009):
+...................
+
+- Support for EDF and many other formats \ No newline at end of file
diff --git a/doc/source/_static/placeholder b/doc/source/_static/placeholder
new file mode 100644
index 0000000..7784424
--- /dev/null
+++ b/doc/source/_static/placeholder
@@ -0,0 +1 @@
+#This empty file is there to keep the directory in Git \ No newline at end of file
diff --git a/doc/source/api/modules.rst b/doc/source/api/modules.rst
new file mode 100644
index 0000000..da9bd35
--- /dev/null
+++ b/doc/source/api/modules.rst
@@ -0,0 +1,297 @@
+FabIO Package
+=============
+
+.. toctree::
+ :maxdepth: 4
+
+
+:mod:`fabio` Package
+--------------------
+
+.. automodule:: fabio
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.fabioimage` Module
+------------------------------
+
+.. automodule:: fabio.fabioimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.fabioutils` Module
+------------------------------
+
+.. automodule:: fabio.fabioutils
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.file_series` Module
+-------------------------------
+
+.. automodule:: fabio.file_series
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.openimage` Module
+-----------------------------
+
+.. automodule:: fabio.openimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.adscimage` Module
+-----------------------------
+
+.. automodule:: fabio.adscimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.binaryimage` Module
+-------------------------------
+
+.. automodule:: fabio.binaryimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.bruker100image` Module
+----------------------------------
+
+.. automodule:: fabio.bruker100image
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.brukerimage` Module
+-------------------------------
+
+.. automodule:: fabio.brukerimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.cbfimage` Module
+----------------------------
+
+.. automodule:: fabio.cbfimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.dm3image` Module
+----------------------------
+
+.. automodule:: fabio.dm3image
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+
+:mod:`fabio.edfimage` Module
+----------------------------
+
+.. automodule:: fabio.edfimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.eigerimage` Module
+------------------------------
+
+.. automodule:: fabio.eigerimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.fit2dimage` Module
+------------------------------
+
+.. automodule:: fabio.fit2dimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.fit2dmaskimage` Module
+----------------------------------
+
+.. automodule:: fabio.fit2dmaskimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.fit2dspreadsheetimage` Module
+-----------------------------------------
+
+.. automodule:: fabio.fit2dspreadsheetimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.GEimage` Module
+---------------------------
+
+.. automodule:: fabio.GEimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+
+:mod:`fabio.hdf5image` Module
+-----------------------------
+
+.. automodule:: fabio.hdf5image
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.HiPiCimage` Module
+------------------------------
+
+.. automodule:: fabio.HiPiCimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.kcdimage` Module
+----------------------------
+
+.. automodule:: fabio.kcdimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.mar345image` Module
+-------------------------------
+
+.. automodule:: fabio.mar345image
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.mrcimage` Module
+----------------------------
+
+.. automodule:: fabio.mrcimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.marccdimage` Module
+-------------------------------
+
+.. automodule:: fabio.marccdimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.numpyimage` Module
+------------------------------
+
+.. automodule:: fabio.numpyimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.OXDimage` Module
+----------------------------
+
+.. automodule:: fabio.OXDimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.pilatusimage` Module
+--------------------------------
+
+.. automodule:: fabio.pilatusimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.pixiimage` Module
+-----------------------------
+
+.. automodule:: fabio.pixiimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.pnmimage` Module
+----------------------------
+
+.. automodule:: fabio.pnmimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.raxisimage` Module
+------------------------------
+
+.. automodule:: fabio.raxisimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.tifimage` Module
+----------------------------
+
+.. automodule:: fabio.tifimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.xsdimage` Module
+----------------------------
+
+.. automodule:: fabio.xsdimage
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.compression` Module
+-------------------------------
+
+.. automodule:: fabio.compression
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.converters` Module
+------------------------------
+
+.. automodule:: fabio.converters
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.datIO` Module
+-------------------------
+
+.. automodule:: fabio.datIO
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.TiffIO` Module
+--------------------------
+
+.. automodule:: fabio.TiffIO
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+:mod:`fabio.readbytestream` Module
+----------------------------------
+
+.. automodule:: fabio.readbytestream
+ :members:
+ :undoc-members:
+ :show-inheritance:
+ \ No newline at end of file
diff --git a/doc/source/conf.py b/doc/source/conf.py
new file mode 100644
index 0000000..de980fa
--- /dev/null
+++ b/doc/source/conf.py
@@ -0,0 +1,240 @@
+# -*- coding: utf-8 -*-
+#
+# FabIO documentation build configuration file, created by
+# sphinx-quickstart on Fri Mar 15 09:03:50 2013.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys
+import os
+import glob
+import subprocess
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+# sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+# needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+try:
+ import sphinx.ext.mathjax
+except:
+ print("Not using math extension for sphinx")
+ sys.path.append(os.path.dirname(os.path.abspath(__file__)))
+ import mathjax
+ import sphinx.ext
+ sphinx.ext.mathjax = mathjax
+ sys.modules["sphinx.ext.mathjax"] = mathjax
+
+extensions = ['sphinx.ext.autodoc',
+ 'sphinx.ext.mathjax',
+ 'sphinxcontrib.programoutput',
+]
+
+
+# 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'
+
+# General information about the project.
+project = u'FabIO'
+from fabio._version import strictversion, version, __date__ as fabio_date
+year = fabio_date.split("/")[-1]
+copyright = u'2006-%s, Henning Sorensen, Erik Knudsen, Jon Wright, Gael Goret, Brian Pauw and Jerome Kieffer' % (year)
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+
+# The full version, including alpha/beta/rc tags.
+release = strictversion
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+# language = None
+
+# 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'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = []
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+# default_role = None
+
+# 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 = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# 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 = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+# html_theme_path = []
+
+# 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
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+# html_logo = None
+
+# 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.
+# html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+# html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+# html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+# html_sidebars = {}
+
+# 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
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'FabIOdoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {'papersize': 'a4paper',
+ 'pointsize': '10pt'}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'FabIO.tex', u'FabIO Documentation',
+ u'H. Sorensen, E. Knudsen, J. Wright, \\\\ G. Goret, B. Pauw and J. Kieffer', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+latex_logo = "img/viewer.png"
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+# latex_use_parts = False
+
+# 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 = ''
+
+# Documents to append as an appendix to all manuals.
+# latex_appendices = []
+
+# If false, no module index is generated.
+# latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'fabio', u'FabIO Documentation',
+ [u'Henning Sorensen, Erik Knudsen, Jon Wright, \\\\ Gael Goret, B. Pauw and Jerome Kieffer'], 1)
+]
+# Documents to append as an appendix to all manuals.
+# texinfo_appendices = []
+
+# If false, no module index is generated.
+# texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+# texinfo_show_urls = 'footnote'
diff --git a/doc/source/coverage.rst b/doc/source/coverage.rst
new file mode 100644
index 0000000..28ae5a8
--- /dev/null
+++ b/doc/source/coverage.rst
@@ -0,0 +1,56 @@
+Test coverage report for fabio
+==============================
+
+Measured on *fabio* version 0.5.0, 29/08/2017
+
+.. csv-table:: Test suite coverage
+ :header: "Name", "Stmts", "Exec", "Cover"
+ :widths: 35, 8, 8, 8
+
+ "GEimage.py", "103", "58", "56.3 %"
+ "HiPiCimage.py", "62", "12", "19.4 %"
+ "OXDimage.py", "355", "328", "92.4 %"
+ "TiffIO.py", "816", "574", "70.3 %"
+ "__init__.py", "33", "25", "75.8 %"
+ "_version.py", "34", "32", "94.1 %"
+ "adscimage.py", "78", "49", "62.8 %"
+ "binaryimage.py", "56", "20", "35.7 %"
+ "bruker100image.py", "243", "164", "67.5 %"
+ "brukerimage.py", "204", "171", "83.8 %"
+ "cbfimage.py", "522", "223", "42.7 %"
+ "compression.py", "250", "189", "75.6 %"
+ "converters.py", "18", "15", "83.3 %"
+ "directories.py", "23", "18", "78.3 %"
+ "dm3image.py", "138", "20", "14.5 %"
+ "edfimage.py", "591", "391", "66.2 %"
+ "eigerimage.py", "103", "56", "54.4 %"
+ "fabioformats.py", "79", "61", "77.2 %"
+ "fabioimage.py", "314", "241", "76.8 %"
+ "fabioutils.py", "362", "286", "79.0 %"
+ "file_series.py", "143", "63", "44.1 %"
+ "fit2dimage.py", "92", "77", "83.7 %"
+ "fit2dmaskimage.py", "77", "74", "96.1 %"
+ "fit2dspreadsheetimage.py", "42", "10", "23.8 %"
+ "hdf5image.py", "88", "49", "55.7 %"
+ "jpeg2kimage.py", "81", "28", "34.6 %"
+ "jpegimage.py", "47", "45", "95.7 %"
+ "kcdimage.py", "110", "83", "75.5 %"
+ "mar345image.py", "270", "248", "91.9 %"
+ "marccdimage.py", "67", "60", "89.6 %"
+ "mpaimage.py", "55", "50", "90.9 %"
+ "nexus.py", "190", "96", "50.5 %"
+ "numpyimage.py", "65", "52", "80.0 %"
+ "openimage.py", "89", "57", "64.0 %"
+ "pilatusimage.py", "38", "33", "86.8 %"
+ "pixiimage.py", "98", "27", "27.6 %"
+ "pnmimage.py", "135", "86", "63.7 %"
+ "raxisimage.py", "103", "93", "90.3 %"
+ "speimage.py", "163", "158", "96.9 %"
+ "tifimage.py", "166", "64", "38.6 %"
+ "xsdimage.py", "98", "72", "73.5 %"
+ "convert.py", "213", "30", "14.1 %"
+ "mathutils.py", "11", "6", "54.5 %"
+ "pilutils.py", "46", "30", "65.2 %"
+
+ "fabio total", "6871", "4524", "65.8 %"
+
diff --git a/doc/source/getting_started.rst b/doc/source/getting_started.rst
new file mode 100644
index 0000000..c58b4af
--- /dev/null
+++ b/doc/source/getting_started.rst
@@ -0,0 +1,289 @@
+Getting Started
+===============
+
+FabIO is a Python module for reading and handling data from two-dimensional X-ray
+detectors.
+
+
+FabIO is a Python module written for easy and transparent reading
+of raw two-dimensional data from various X-ray detectors. The
+module provides a function for reading any image and returning a
+FabioImage object which contains both metadata (header information)
+and the raw data. All FabioImage object offer additional methods to
+extract information about the image and to open other detector
+images from the same data series.
+
+
+Introduction
+------------
+
+One obstacle when writing software to analyse data collected from a
+two-dimensional detector is to read the raw data into the program,
+not least because the data can be stored in many different formats
+depending on the instrument used. To overcome this problem we
+decided to develop a general module, FabIO (FABle I/O), to handle
+reading and writing of two-dimensional data. The code-base was
+initiated by merging parts of our fabian imageviewer and
+ImageD11 peak-search programs and has been developed
+since 2007 as part of the TotalCryst program suite for
+analysis of 3DXRD microscopy data. During integration into
+a range of scientific programs like the FABLE graphical interface,
+EDNA and the fast azimuthal integration library,
+pyFAI; FabIO has gained several features like handling
+multi-frame image formats as well as writing many of the file
+formats.
+
+
+FabIO Python module
+-------------------
+
+Python is a scripting language that is very popular among
+scientists and which also allows well structured applications and
+libraries to be developed.
+
+Philosophy
+..........
+
+The intention behind this development was to create a Python module
+which would enable easy reading of 2D data images, from any
+detector without having to worry about the file format. Therefore
+FabIO just needs a file name to open a file and it determines the
+file format automatically and deals with gzip and bzip2
+compression transparently. Opening a file returns an object
+which stores the image in memory as a 2D NumPy array
+and the metadata, called header, in a Python dictionary.
+Beside the data and header attributes, some methods are
+provided for reading the previous or next image in a series of
+images as well as jumping to a specific file number. For the user,
+these auxiliary methods are intended to be independent of the image
+format (as far as is reasonably possible).
+
+FabIO is written in an object-oriented style (with classes) but
+aims at being used in a scripting environment: special care has
+been taken to ensure the library remains easy to use. Therefore no
+knowledge of object-oriented programming is required to get full
+benefits of the library. As the development is done in a
+collaborative and decentralized way; a comprehensive test suite has
+been added to reduce the number of regressions when new features
+are added or old problems are repaired. The software is very
+modular and allows new classes to be added for handling other data
+formats easily. FabIO and its source-code are freely available to
+everyone on-line, licensed under the GNU General Public
+License version 3 (GPLv3). FabIO is also available directly from
+popular Linux distributions like Debian and Ubuntu.
+
+Implementation
+..............
+
+The main language used in the development of FabIO is Python;
+however, some image formats are compressed and require
+compression algorithms for reading and writing data. When such
+algorithms could not be implemented efficiently using Python or
+NumPy native modules were developed, in i.e. standard C code
+callable from Python (sometimes generated using Cython).
+This code has to be compiled for each computer architecture and
+offers excellent performance. FabIO is only dependent on the NumPy
+module and has extra features if two other optional Python modules
+are available. For reading XML files (that are used in EDNA) the
+Lxml module is required and the Python Image Library, PIL
+is needed for producing a PIL image for displaying the image
+in graphical user interfaces and several image-processing
+operations that are not re-implemented in FabIO. A variety of
+useful image processing is also available in the scipy.ndimage
+module and in scikits-image.
+
+Images can also be displayed in a convenient interactive manner
+using matplotlib and an IPython shell , which
+is mainly used for developing data analysis algorithms. Reading and
+writing procedure of the various TIFF formats is based on the
+TiffIO code from PyMCA.
+
+In the Python shell, the `fabio` module must be imported prior to
+reading an image in one of the supported file formats (see Table
+`Supported formats`, hereafter).
+The `fabio.open` function creates an instance of the
+Python class `fabioimage`, from the name of a file. This instance,
+named `img` hereafter, stores the image data in `img.data` as a 2D
+NumPy array. Often the image file contains more information than
+just the intensities of the pixels, e.g. information about how the
+image is stored and the instrument parameters at the time of the
+image acquisition, these metadata are usually stored in the file
+header. Header information, are available in `img.header` as a
+Python dictionary where keys are strings and values are usually
+strings or numeric values.
+
+Information in the header about the binary part of the image
+(compression, endianness, shape) are interpreted however, other
+metadata are exposed as they are recorded in the file. FabIO allows
+the user to modify and, where possible, to save this information
+(the table `Supported formats` summarizes writable formats).
+Automatic translation
+between file-formats, even if desirable, is sometimes impossible
+because not all format have the capability to be extended with
+additional metadata. Nevertheless FabIO is capable of converting
+one image data-format into another by taking care of the numerical
+specifics: for example float arrays are converted to integer arrays
+if the output format only accepts integers.
+
+FabIO methods
+.............
+
+One strength of the implementation in an object oriented language
+is the possibility to combine functions (or methods) together with
+data appropriate for specific formats. In addition to the header
+information and image data, every `fabioimage` instance (returned
+by `fabio.open`) has methods inherited from `fabioimage` which
+provide information about the image minimum, maximum and mean
+values. In addition there are methods which return the file number,
+name etc. Some of the most important methods are specific for
+certain formats because the methods are related to how frames in a
+sequence are handled; these methods are `img.next()`,
+`img.previous()`, and `img.getframe(n)`. The behaviour of such
+methods varies depending on the image format: for single-frame
+format (like mar345), `img.next()` will return the image in next
+file; for multi-frame format (like GE), `img.next()` will return
+the next frame within the same file. For formats which are possibly
+multi-framed like EDF, the behaviour depends on the actual number
+of frames per file (accessible via the `img.nframes` attribute).
+
+Usage
+-----
+
+Examples
+........
+
+In this section we have collected some basic examples of how FabIO
+can be employed.
+
+Opening an image:
+
+.. code-block:: python
+
+ import fabio
+ im100 = fabio.open('Quartz_0100.tif') # Open image file
+ print(im0.data[1024,1024]) # Check a pixel value
+ im101 = im100.next() # Open next image
+ im270 = im1.getframe(270) # Jump to file number 270: Quartz_0270.tif
+
+Normalising the intensity to a value in the header:
+
+.. code-block:: python
+
+ img = fabio.open('exampleimage0001.edf')
+ print(img.header)
+ {'ByteOrder': 'LowByteFirst',
+ 'DATE (scan begin)': 'Mon Jun 28 21:22:16 2010',
+ 'ESRFCurrent': '198.099',
+ ...
+ }
+ # Normalise to beam current and save data
+ srcur = float(img.header['ESRFCurrent'])
+ img.data *= 200.0/srcur
+ img.write('normed_0001.edf')
+
+Interactive viewing with matplotlib:
+
+.. code-block:: python
+
+ from matplotlib import pyplot # Load matplotlib
+ pyplot.imshow(img.data) # Display as an image
+ pyplot.show() # Show GUI window
+
+Future and perspectives
+-----------------------
+
+The Hierarchical Data Format version 5 (`hdf5`) is a data format which
+is increasingly popular for storage of X-ray and neutron data. To
+name a few facilities the synchrotron Soleil and the neutron
+sources ISIS, SNS and SINQ already use HDF extensively through the
+NeXus format. For now, mainly processed or curated data are
+stored in this format but new detectors (Eiger from Dectris) are natively
+saving data in HDF5. FabIO will rely on H5Py, which
+already provides a good HDF5 binding for Python, as an external
+dependency, to be able to read and write such HDF5 files.
+This starts to be available in version 0.4.0.
+
+Conclusion
+----------
+
+FabIO gives an easy way to read and write 2D images when using the
+Python computer language. It was originally developed for X-ray
+diffraction data but now gives an easy way for scientists to access
+and manipulate their data from a wide range of 2D X-ray detectors.
+We welcome contributions to further improve the code and hope to
+add more file formats in the future.
+
+Acknoledgements
+...............
+
+We acknowledge Andy Götz and Kenneth Evans for extensive
+testing when including the FabIO reader in the Fable image viewer
+(Götz et al., 2007).We also thank V. Armando Solé for assistance with
+his TiffIO reader and Carsten Gundlach for deployment of FabIO at
+the beamlines i711 and i811, MAX IV, and providing bug reports. We
+finally acknowledge our colleagues who have reported bugs and
+helped to improve FabIO. Financial support was granted by the EU
+6th Framework NEST/ADVENTURE project TotalCryst (Poulsen et
+al., 2006).
+
+
+Citation
+........
+
+
+Knudsen, E. B., Sørensen, H. O., Wright, J. P., Goret, G. & Kieffer, J. (2013). J. Appl. Cryst. 46, 537-539.
+
+http://dx.doi.org/10.1107/S0021889813000150
+
+
+List of file formats that FabIO can read and write
+..................................................
+
+In alphabetical order. The listed filename extensions are typical examples.
+FabIO tries to deduce the actual format from the file itself and only
+uses extensions as a fallback if that fails.
+
+.. csv-table:: Supported formats
+ :header: "Python Module", "Detector / Format", "Extension", "Read", "Multi-image", "Write"
+ :widths: 30, 30, 20, 10, 15, 10
+
+ "ADSC", "ADSC Quantum", ".img ", "Yes", "No", "Yes"
+ "Bruker86", "Bruker formats", ".sfrm ", "Yes", "No", "Yes"
+ "Bruker100", "Bruker formats", ".sfrm ", "Yes", "No", "Yes"
+ "CBF", "CIF binary files", ".cbf ", "Yes", "No", "Yes"
+ "DM3", "Gatan Digital Micrograph ", ".dm3 ", "Yes", "No", "No"
+ "EDF", "ESRF data format ", ".edf ", "Yes", "Yes ", "Yes"
+ "EDNA-XML", "Used by EDNA", ".xml ", "Yes", "No", "No"
+ "Eiger", "Dectris format", ".h5", "Yes", "Yes", "Yes"
+ "Fit2D", "Fit2D binary format", ".f2d", "Yes", "No", "No"
+ "Fit2D mask", "Fit2D mask", ".msk ", "Yes", "No", "Yes"
+ "Fit2D spreadsheet", "Fit2D Ascii format", ".spr ", "Yes", "No", "Yes"
+ "GE", "General Electric", "No", "Yes", "Yes ", "No"
+ "JPEG", "Joint Photographic Experts Group", ".jpg", "Yes", "No", "No"
+ "JPEG2k", "JPEG 2000", ".jpx", "Yes", "No", "No"
+ "Hdf5", "Needs the dataset path", ".h5", "Yes", "Yes", "No"
+ "HiPiC", "Hamamatsu CCD", ".tif ", "Yes", "No", "No"
+ "kcd", "Nonius KappaCCD", ".kccd ", "Yes", "No", "No"
+ "marccd", "MarCCD/Mar165", ".mccd ", "Yes", "No", "No"
+ "mar345", "Mar345 image plate", ".mar3450 ", "Yes", "No", "Yes"
+ "mpa", "Multi-wire detector", ".mpa", "yes", "No", "No"
+ "numpy", "numpy 2D array", "npy ", "Yes", "No", "Yes"
+ "OXD", "Oxford Diffraction", ".img ", "Yes", "No", "Yes"
+ "Pixi", "pixi", ". ", "Yes", "No", "No"
+ "pilatus", "Dectris Pilatus Tiff", ".tif ", "Yes", "No", "Yes"
+ "PNM", "Portable aNy Map", ".pnm ", "Yes", "No", "Yes"
+ "Raxis", "Rigaku Saxs format", ".img", "Yes", "No", "No"
+ "spe", "Princeton instrumentation", ".spe", "Yes, "Yes", "No"
+ "TIFF", "Tagged Image File Format", ".tif ", "Yes", "No", "Yes"
+
+Adding new file formats
+.......................
+
+We hope it will be relatively easy to add new file formats to FabIO in the future.
+Please refere at the *fabio/templateimage.py* file in the source which describes
+how to add a new format.
+
+
+
+
+
diff --git a/doc/source/img/viewer.png b/doc/source/img/viewer.png
new file mode 100644
index 0000000..a6cf3e0
--- /dev/null
+++ b/doc/source/img/viewer.png
Binary files differ
diff --git a/doc/source/index.rst b/doc/source/index.rst
new file mode 100644
index 0000000..ad7daec
--- /dev/null
+++ b/doc/source/index.rst
@@ -0,0 +1,29 @@
+.. FabIO documentation master file, created by
+ sphinx-quickstart on Fri Mar 15 09:03:50 2013.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+Welcome to FabIO's documentation!
+=================================
+
+Contents:
+
+.. toctree::
+ :maxdepth: 2
+
+ getting_started
+ install
+ tutorials/index
+ performances
+ Changelog
+ man/fabio_viewer
+ api/modules
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
diff --git a/doc/source/install.rst b/doc/source/install.rst
new file mode 100644
index 0000000..7df5a42
--- /dev/null
+++ b/doc/source/install.rst
@@ -0,0 +1,337 @@
+:Author: Jérôme Kieffer
+:Date: 29/08/2017
+:Keywords: Installation procedure
+:Target: System administrators
+
+Installation
+============
+
+FabIO can, as any Python module, be installed from its sources,
+available on the `Python cheese shop <https://pypi.python.org/pypi/fabio>`_
+but we advice to use binary wheels packages provided for the most common platforms:
+Windows, MacOSX. For Debian Linux and its derivatives (Ubuntu, Mint, ...), FabIO
+is part of the distributions and itss package is named *python-fabio* and can be installed via:
+
+.. code::
+
+ sudo apt-get install python-fabio
+
+If you are using MS Windows or MacOSX; binary version (as wheel packages) are
+PIP-installable.
+PIP is the Python Installer Program, similar to ``apt-get`` for Python.
+It runs under any architecture.
+Since Python 2.7.10 and 3.4, PIP is installed together with Python itself.
+If your Python is elder, PIP can be simply `downloaded <https://bootstrap.pypa.io/get-pip.py>`_
+and executed using your standard Python:
+
+.. code::
+
+ python get-pip.py
+ pip install fabio
+
+Installation under windows
+--------------------------
+
+Install `Python <http://python.org>`_ from the official web page.
+I would recommend Python 2.7 in 64 bits version if your operating system allows it.
+Python3 (>=3.4) is OK.
+
+If you are looking for an integrated scientific Python distribution on Windows,
+`WinPython <https://winpython.github.io/>`_ is a good one, the Python2.7, 64 bit
+version is advised.
+
+It comes with pip pre-installed and configured.
+
+Installation using PIP:
+.......................
+
+If you use a Python2 elder than 2.7.10 or a Python3 <3.4, you will need
+`Download PIP <https://bootstrap.pypa.io/get-pip.py>`_.
+Then install the wheel package manager and all dependencies for :
+
+::
+
+ python get-pip.py
+ pip install setuptools
+ pip install wheel
+ pip install fabio
+
+Note: for now, PyQt4 is not yet pip-installable. you will need to get it from riverbankcomputing:
+http://www.riverbankcomputing.co.uk/software/pyqt/download
+
+Manual installation under windows
+.................................
+
+You will find all the `scientific Python stack packaged for Windows <http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_ on Christoph
+Gohlke' page (including FabIO):
+
+Pay attention to the Python version (both number and architecture).
+**DO NOT MIX 32 and 64 bits version**.
+To determine the version and architecture width of the Python interpreter:
+
+.. code-block:: python
+
+ >>> import sys
+ >>> print(sys.version)
+ 2.7.9 (default, Mar 1 2015, 12:57:24)
+ >>> print("%s bits"%(8 * tuple.__itemsize__))
+ 64 bits
+
+Installation from sources
+.........................
+
+* Retrieve the sources from github:
+
+ + `The master development branch <https://github.com/silx-kit/fabio/archive/master.zip>`_
+ + `The latest release <https://github.com/silx-kit/fabio/releases/latest>`_
+
+* unzip the file in a directory
+* open a console (cmd.exe) in this directory.
+* install the required dependencies using PIP::
+
+ pip install -r ci/requirements_appveyor.txt --trusted-host www.silx.org
+
+Get the compiler and install it
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The version of the compiler and the version of the Microsoft SDK
+have to match the Python version you are using. Here are a couple of examples:
+
+* Python2.7: `Microsoft compiler 2008 <http://aka.ms/vcpython27>`_
+* Python 3.5: `Microsoft Visual studio community edition 2015 <https://go.microsoft.com/fwlink/?LinkId=691978&clcid=0x40c>`_
+
+Compile the sources
+^^^^^^^^^^^^^^^^^^^
+
+::
+
+ python setup.py build
+ python setup.py test
+ pip install .
+
+Testing version of FabIO
+........................
+
+Continuous integration runs the complete test suite on multiple operating
+systems and python version.
+Under Windows, this is done using the
+`AppVeyor cloud service <https://ci.appveyor.com/project/ESRF/fabio>`_
+Select the environment which matches your setup like
+**Environment: PYTHON=C:\Python34-x64, PYTHON_VERSION=3.4.3, PYTHON_ARCH=64**
+and go to **artifacts** where wheels and MSI-installers are available.
+
+
+Installation on MacOSX
+----------------------
+
+Python 2.7, 64 bits and numpy are natively available on MacOSX.
+
+Install via PIP
+...............
+
+Since MacOSX 10.11 (El-Captain), PIP is available as part of the standard python installation.
+For elder MacOSX, `download PIP and run <https://bootstrap.pypa.io/get-pip.py>`_.
+Then install FabIO directly:
+
+.. code::
+
+ sudo pip install fabio
+
+
+**Note:** for now, PyQt4, used by the *fabio-viewer* is not yet pip-installable.
+You will need to get it from
+`riverbankcomputing <http://www.riverbankcomputing.co.uk/software/pyqt/download>`_.
+
+Compile from sources
+....................
+
+Get the compiler
+^^^^^^^^^^^^^^^^
+Apple provides for free Xcode which contains the compiler needed to build binary extensions.
+Xcode can be installed from the App-store.
+
+Compile the sources
+^^^^^^^^^^^^^^^^^^^
+
+Once done, follow the classical procedure (similar to Windows or Linux):
+
+* Retrieve the sources from github:
+
+ + `The master development branch <https://github.com/silx-kit/fabio/archive/master.zip>`_
+ + `The latest release <https://github.com/silx-kit/fabio/releases/latest>`_
+
+* unzip the file in a directory
+* open a terminal in the unzipped archive directory
+* run::
+
+ sudo pip install -r ci/requirements_travis.txt --trusted-host www.silx.org
+ python setup.py build
+ python setup.py test
+ sudo pip install .
+
+
+Manual Installation for any operating system
+--------------------------------------------
+
+Install the dependencies
+........................
+
+Most Linux distribution come with a Python environment configured. Complete
+it with the needed dependencies.
+
+* Python 2.7 or 3.4+
+* numpy - http://www.numpy.org
+
+For full functionality of FabIO the following modules need to be installed:
+
+* Pillow (python imaging library) - http://www.pythonware.com
+* lxml (library for reading XSDimages)
+* PyQt4 for the fabio_viewer program
+
+Once done, follow the classical procedure (similar to Windows or MacOSX):
+
+* Retrieve the sources from github:
+
+ + `The master development branch <https://github.com/silx-kit/fabio/archive/master.zip>`_
+ + `The latest release <https://github.com/silx-kit/fabio/releases/latest>`_
+
+* unzip the file in a directory
+* open a terminal in the unzipped archive directory
+* run::
+
+ sudo pip install -r ci/requirements_travis.txt --trusted-host www.silx.org
+ python setup.py build
+ python setup.py test
+ sudo pip install .
+
+
+Most likely you will need to gain root privileges (with sudo in front of the
+command) to install packages.
+
+Development versions
+--------------------
+The newest development version can be obtained by checking it out from the git repository:
+
+::
+
+ git clone https://github.com/silx-kit/fabio
+ cd fabio
+ python setup.py build test
+ sudo pip install .
+
+For Ubuntu/Debian users, you will need:
+
+* python-imaging
+* python-imaging-tk
+* python-numpy
+* python-dev
+
+::
+
+ sudo apt-get install python-imaging python-imaging-tk python-numpy
+
+Automatic debian packaging
+..........................
+
+Debian 6 and 7:
+^^^^^^^^^^^^^^^
+We provide a debian-package builder based on stdeb, building a package for Python2:
+
+::
+
+ sudo apt-get install python-stdeb
+ ./build-deb.sh
+
+which builds a debian package and installs them in a single command.
+Handy for testing, but very clean, see hereafter
+
+Debian 8 and newer
+^^^^^^^^^^^^^^^^^^
+
+The same script, *build-deb.sh*, will create *real* debian packages:
+It will build a bunch of 6 debian packages::
+
+* *fabio-bin*: the GUI for visualizing diffraction images
+* *fabio-doc*: the documumentation package
+* *python3-fabio*: library built for Python3
+* *python3-fabio-dbg*: debug symbols for Python3
+* *python-fabio*: library built for Python2
+* *python-fabio-dbg*: debug symbols for Python2
+
+For this, you need a complete debian build environment:
+
+::
+
+ sudo apt-get install cython cython-dbg cython3 cython3-dbg debhelper dh-python \
+ python-all-dev python-all-dbg python-h5py \
+ python-lxml python-lxml-dbg python-matplotlib python-matplotlib-dbg python-numpy\
+ python-numpy-dbg python-qt4 python-qt4-dbg python-sphinx \
+ python-sphinxcontrib.programoutput python-tk python-tk-dbg python3-all-dev python3-all-dbg \
+ python3-lxml python3-lxml-dbg python3-matplotlib \
+ python3-matplotlib-dbg python3-numpy python3-numpy-dbg python3-pyqt4 python3-pyqt4-dbg \
+ python3-sphinx python3-sphinxcontrib.programoutput \
+ python3-tk python3-tk-dbg python3-pil-dbg python3-setuptools devscripts
+
+ ./build-deb.sh
+
+This script works the same way with Debian-9 stretch and newer.
+
+Test suite
+----------
+
+FabIO has a comprehensive test-suite to ensure non regression.
+When you run the test for the first time, many test images will be download and converted into various compressed format like gzip and bzip2 (this takes a lot of time).
+
+Be sure you have an internet connection and your proxy setting are correctly defined in the environment variable *http_proxy*.
+For example if you are behind a firewall/proxy:
+
+Under Linux and MacOSX::
+
+ export http_proxy=http://proxy.site.org:3128
+
+Under Windows::
+
+ set http_proxy=http://proxy.site.org:3128
+
+Where *proxy.site.org* and *3128* correspond to the proxy server and port on your network.
+At ESRF, you can get this piece of information by phoning to the hotline: 24-24.
+
+Many tests are there to deal with malformed files, don't worry if the programs complains in warnings about "bad files",
+it is done on purpose to ensure robustness in FabIO.
+
+
+Run test suite from installation directory
+..........................................
+
+To run the test:
+
+::
+
+ python setup.py build test
+
+
+Run test suite from installed version
+.....................................
+
+Within Python (or ipython):
+
+.. code-block:: python
+
+ >>> import fabio
+ >>> fabio.tests()
+
+
+Test coverage
+.............
+
+FabIO comes with 37 test-suites (179 tests in total) representing a coverage of 66%.
+This ensures both non regression over time and ease the distribution under different platforms:
+FabIO runs under Linux, MacOSX and Windows (in each case in 32 and 64 bits) with Python versions 2.7, 3.4, 3.6 and 3.6.
+Under linux it has been tested on i386, x86_64, arm, ppc, ppc64le.
+FabIO may run on other untested systems but without warranty.
+
+.. toctree::
+ :maxdepth: 2
+
+ coverage
+
diff --git a/doc/source/man/fabio_viewer.rst b/doc/source/man/fabio_viewer.rst
new file mode 100644
index 0000000..e2a5411
--- /dev/null
+++ b/doc/source/man/fabio_viewer.rst
@@ -0,0 +1,11 @@
+FabIO Viewer
+============
+
+fabio_viewer is a simple diffraction image viewer based on matplotlib and PyQt4.
+
+.. image:: ../img/viewer.png
+
+.. command-output:: fabio_viewer --help
+ :nostderr:
+
+
diff --git a/doc/source/mathjax.py b/doc/source/mathjax.py
new file mode 100644
index 0000000..fb3ff4a
--- /dev/null
+++ b/doc/source/mathjax.py
@@ -0,0 +1,69 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.ext.mathjax
+ ~~~~~~~~~~~~~~~~~~
+
+ Allow `MathJax <http://mathjax.org/>`_ to be used to display math in
+ Sphinx's HTML writer -- requires the MathJax JavaScript library on your
+ webserver/computer.
+
+ :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+from docutils import nodes
+
+from sphinx.application import ExtensionError
+from sphinx.ext.mathbase import setup_math as mathbase_setup
+
+
+def html_visit_math(self, node):
+ self.body.append(self.starttag(node, 'span', '', CLASS='math'))
+ self.body.append(self.builder.config.mathjax_inline[0] +
+ self.encode(node['latex']) +
+ self.builder.config.mathjax_inline[1] + '</span>')
+ raise nodes.SkipNode
+
+def html_visit_displaymath(self, node):
+ self.body.append(self.starttag(node, 'div', CLASS='math'))
+ if node['nowrap']:
+ self.body.append(self.builder.config.mathjax_display[0] +
+ node['latex'] +
+ self.builder.config.mathjax_display[1])
+ self.body.append('</div>')
+ raise nodes.SkipNode
+
+ parts = [prt for prt in node['latex'].split('\n\n') if prt.strip()]
+ for i, part in enumerate(parts):
+ part = self.encode(part)
+ if i == 0:
+ # necessary to e.g. set the id property correctly
+ if node['number']:
+ self.body.append('<span class="eqno">(%s)</span>' %
+ node['number'])
+ if '&' in part or '\\\\' in part:
+ self.body.append(self.builder.config.mathjax_display[0] +
+ '\\begin{split}' + part + '\\end{split}' +
+ self.builder.config.mathjax_display[1])
+ else:
+ self.body.append(self.builder.config.mathjax_display[0] + part +
+ self.builder.config.mathjax_display[1])
+ self.body.append('</div>\n')
+ raise nodes.SkipNode
+
+def builder_inited(app):
+ if not app.config.mathjax_path:
+ raise ExtensionError('mathjax_path config value must be set for the '
+ 'mathjax extension to work')
+ app.add_javascript(app.config.mathjax_path)
+
+
+def setup(app):
+ mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
+ app.add_config_value('mathjax_path',
+ 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?'
+ 'config=TeX-AMS-MML_HTMLorMML', False)
+ app.add_config_value('mathjax_inline', [r'\(', r'\)'], 'html')
+ app.add_config_value('mathjax_display', [r'\[', r'\]'], 'html')
+ app.connect('builder-inited', builder_inited)
+
diff --git a/doc/source/performances.rst b/doc/source/performances.rst
new file mode 100644
index 0000000..de93956
--- /dev/null
+++ b/doc/source/performances.rst
@@ -0,0 +1,44 @@
+Benchmarks
+==========
+
+Those benchmarks have been done with all data already in cache using a Intel Xeon E5520 @ 2.27GHz
+running Debian 7 and FabIO 0.2.2... Those data are now out-dated.
+
+.. table:: Execution time for reading a file, benchmarked using the *timeit* module.
+ :class: w
+
+ +---------------+---------------------------+--------+--------------+--------------+--------------+
+ | FabIO module | Filename | Size | Py2.7 v0.1.4 | Py2.7 v0.2.0 | Py3.2 v0.2.0 |
+ +---------------+---------------------------+--------+--------------+--------------+--------------+
+ | adscimage | mb_LP_1_001.img | 9 Mpix | 1.16 s | 1.12 s | 2.67 s |
+ +---------------+---------------------------+--------+--------------+--------------+--------------+
+ | brukerimage | Cr8F8140k103.0026 | 256kpix| 796 µs | 795 µs | 1.43 ms |
+ +---------------+---------------------------+--------+--------------+--------------+--------------+
+ | cbfimage | run2_1_00148.cbf | 6 Mpix | 173 ms | 70.8 ms | 70.8 ms |
+ +---------------+---------------------------+--------+--------------+--------------+--------------+
+ | edfimage | F2K_Seb_Lyso0675.edf | 4 Mpix | 512 µs | 597 µs | 595 µs |
+ +---------------+---------------------------+--------+--------------+--------------+--------------+
+ | fit2dmaskimage| fit2d_click.msk | 1 Mpix | 30.4 ms | 30.5 ms | 28.4 ms |
+ +---------------+---------------------------+--------+--------------+--------------+--------------+
+ | GEimage |GE_aSI_detector_image_1529 | 4 Mpix | 5.37 ms | 5.44 ms | 4.3 ms |
+ +---------------+---------------------------+--------+--------------+--------------+--------------+
+ | kcdimage | i01f0001.kcd | 360kpix| 130 ms | 121 ms | 292 ms |
+ +---------------+---------------------------+--------+--------------+--------------+--------------+
+ | mar345image | example.mar2300 | 5 Mpix | 78 ms | 77 ms | 77 ms |
+ +---------------+---------------------------+--------+--------------+--------------+--------------+
+ | marccdimage | corkcont2_H_0089.mccd | 4 Mpix | 9.28 ms | 9.01 ms | 17.2 ms |
+ +---------------+---------------------------+--------+--------------+--------------+--------------+
+ | OXDimage | b191_1_9_1.img | 256kpix| 5.75 ms | 5.67 ms | 8.35 ms |
+ +---------------+---------------------------+--------+--------------+--------------+--------------+
+ | pnmimage | image0001.pgm | 1 Mpix | 3.29 ms | 3.25 ms | 5.71 ms |
+ +---------------+---------------------------+--------+--------------+--------------+--------------+
+ | raxisimage | mgzn-20hpt.img | 3 Mpix | 53.5 ms | 57.1 ms | 69.2 ms |
+ +---------------+---------------------------+--------+--------------+--------------+--------------+
+ | tifimage | oPPA_5grains_0001.tif | 4 Mpix | 59.9 ms | 58.4 ms | 105 ms |
+ +---------------+---------------------------+--------+--------------+--------------+--------------+
+ | xsdimage | XSDataImage.xml | 256kpix| 13.3 ms | 12.9 ms | 18.4 ms |
+ +---------------+---------------------------+--------+--------------+--------------+--------------+
+
+The Python3 version is sometimes twice slower then the Python2 version.
+As the codebase is the same this regression is not due to FabIO but to the programming language itself.
+The Performances obtained using Python3.4+ is now again close to the one of Python2.7.
diff --git a/doc/source/tutorials/Nexus2cbf.ipynb b/doc/source/tutorials/Nexus2cbf.ipynb
new file mode 100644
index 0000000..b14afaf
--- /dev/null
+++ b/doc/source/tutorials/Nexus2cbf.ipynb
@@ -0,0 +1,1062 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Nexus -> CBF #\n",
+ "In this tutorial we will see how to export a Nexus archive produced by the Eiger detector from Dectris into a bunch of CBF files, similar to the one generated by Pilatus detectors, using the FabIO library to write images (and h5py which actually reads them).\n",
+ "\n",
+ "**Nota:** HDF5 files produced by Nexus detector use a specific LZ4/bitshuffle plugin for reading/writing. They require recent version of hdf5 (>= 1.8.10 ), h5py (>= 2.5.0) and those plugins installed:\n",
+ "\n",
+ "* https://github.com/nexusformat/HDF5-External-Filter-Plugins/tree/master/LZ4 \n",
+ "* https://github.com/kiyo-masui/bitshuffle\n",
+ "\n",
+ "Under Windows, those plugins can easily be installed via this repository which provides binary DLLs: \n",
+ "https://github.com/silx-kit/hdf5plugin\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "#Run as first to set the plugin path, very important to handle Eiger data:\n",
+ "import os\n",
+ "os.environ[\"HDF5_PLUGIN_PATH\"]=\"/usr/lib/x86_64-linux-gnu/hdf5/plugins\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "import fabio"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "In this example we will use the Eiger 4M dataset which can be obtained from Dectris: \n",
+ "https://www.dectris.com/datasets.html. You may register to get download access."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Eiger dataset with 1800 frames from collect_01_00001_master.h5\n"
+ ]
+ }
+ ],
+ "source": [
+ "images = fabio.open(\"collect_01_00001_master.h5\")\n",
+ "print(images)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": false
+ },
+ "source": [
+ "Each \"EigerImage\" object contains a list to the corresponding HDF5 opened with h5py.\n",
+ "So one can retrieve all metadata associated:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "beam_center_x: 1051.0\n",
+ "beam_center_y: 1001.0\n",
+ "bit_depth_readout: 32\n",
+ "count_time: 0.099996\n",
+ "countrate_correction_applied: 0\n",
+ "description: b'Dectris Eiger 4M'\n",
+ "detectorSpecific: unprintable\n",
+ "detector_distance: 0.00733\n",
+ "detector_number: b'E-08-0102'\n",
+ "detector_readout_time: 3.78e-06\n",
+ "efficiency_correction_applied: 0\n",
+ "flatfield_correction_applied: 1\n",
+ "frame_time: 0.1\n",
+ "geometry: unprintable\n",
+ "pixel_mask_applied: 0\n",
+ "sensor_material: b'Si'\n",
+ "sensor_thickness: 0.00032\n",
+ "threshold_energy: 5635.65\n",
+ "virtual_pixel_correction_applied: 1\n",
+ "x_pixel_size: 7.5e-05\n",
+ "y_pixel_size: 7.5e-05\n"
+ ]
+ }
+ ],
+ "source": [
+ "header = {}\n",
+ "for key, value in images.h5[\"entry/instrument/detector\"].items():\n",
+ " try:\n",
+ " val = value[()]\n",
+ " except:\n",
+ " print(\"%s: unprintable\"%key)\n",
+ " else:\n",
+ " print(\"%s: %s\"%(key, val))\n",
+ " header[key] = val\n",
+ " "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": false
+ },
+ "source": [
+ "Now we can translate every single image into a CBF file, here we do only a dozen of then:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "collect_01_00001_0000.cbf\n",
+ "collect_01_00001_0001.cbf\n",
+ "collect_01_00001_0002.cbf\n",
+ "collect_01_00001_0003.cbf\n",
+ "collect_01_00001_0004.cbf\n",
+ "collect_01_00001_0005.cbf\n",
+ "collect_01_00001_0006.cbf\n",
+ "collect_01_00001_0007.cbf\n",
+ "collect_01_00001_0008.cbf\n",
+ "collect_01_00001_0009.cbf\n",
+ "collect_01_00001_0010.cbf\n",
+ "collect_01_00001_0011.cbf\n"
+ ]
+ }
+ ],
+ "source": [
+ "for idx, frame in enumerate(images):\n",
+ " cbf = fabio.cbfimage.cbfimage(header=header,data=frame.data)\n",
+ " fname = \"collect_01_00001_%04i.cbf\"%idx\n",
+ " cbf.write(fname)\n",
+ " print(fname)\n",
+ " if idx>10: \n",
+ " break"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "This is how to display an image using the notebook backend: "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Populating the interactive namespace from numpy and matplotlib\n"
+ ]
+ }
+ ],
+ "source": [
+ "%pylab nbagg"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "/scisoft/users/jupyter/jupy34/lib/python3.4/site-packages/ipykernel/__main__.py:1: RuntimeWarning: divide by zero encountered in log\n",
+ " if __name__ == '__main__':\n"
+ ]
+ },
+ {
+ "data": {
+ "application/javascript": [
+ "/* Put everything inside the global mpl namespace */\n",
+ "window.mpl = {};\n",
+ "\n",
+ "mpl.get_websocket_type = function() {\n",
+ " if (typeof(WebSocket) !== 'undefined') {\n",
+ " return WebSocket;\n",
+ " } else if (typeof(MozWebSocket) !== 'undefined') {\n",
+ " return MozWebSocket;\n",
+ " } else {\n",
+ " alert('Your browser does not have WebSocket support.' +\n",
+ " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n",
+ " 'Firefox 4 and 5 are also supported but you ' +\n",
+ " 'have to enable WebSockets in about:config.');\n",
+ " };\n",
+ "}\n",
+ "\n",
+ "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n",
+ " this.id = figure_id;\n",
+ "\n",
+ " this.ws = websocket;\n",
+ "\n",
+ " this.supports_binary = (this.ws.binaryType != undefined);\n",
+ "\n",
+ " if (!this.supports_binary) {\n",
+ " var warnings = document.getElementById(\"mpl-warnings\");\n",
+ " if (warnings) {\n",
+ " warnings.style.display = 'block';\n",
+ " warnings.textContent = (\n",
+ " \"This browser does not support binary websocket messages. \" +\n",
+ " \"Performance may be slow.\");\n",
+ " }\n",
+ " }\n",
+ "\n",
+ " this.imageObj = new Image();\n",
+ "\n",
+ " this.context = undefined;\n",
+ " this.message = undefined;\n",
+ " this.canvas = undefined;\n",
+ " this.rubberband_canvas = undefined;\n",
+ " this.rubberband_context = undefined;\n",
+ " this.format_dropdown = undefined;\n",
+ "\n",
+ " this.image_mode = 'full';\n",
+ "\n",
+ " this.root = $('<div/>');\n",
+ " this._root_extra_style(this.root)\n",
+ " this.root.attr('style', 'display: inline-block');\n",
+ "\n",
+ " $(parent_element).append(this.root);\n",
+ "\n",
+ " this._init_header(this);\n",
+ " this._init_canvas(this);\n",
+ " this._init_toolbar(this);\n",
+ "\n",
+ " var fig = this;\n",
+ "\n",
+ " this.waiting = false;\n",
+ "\n",
+ " this.ws.onopen = function () {\n",
+ " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n",
+ " fig.send_message(\"send_image_mode\", {});\n",
+ " fig.send_message(\"refresh\", {});\n",
+ " }\n",
+ "\n",
+ " this.imageObj.onload = function() {\n",
+ " if (fig.image_mode == 'full') {\n",
+ " // Full images could contain transparency (where diff images\n",
+ " // almost always do), so we need to clear the canvas so that\n",
+ " // there is no ghosting.\n",
+ " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n",
+ " }\n",
+ " fig.context.drawImage(fig.imageObj, 0, 0);\n",
+ " };\n",
+ "\n",
+ " this.imageObj.onunload = function() {\n",
+ " this.ws.close();\n",
+ " }\n",
+ "\n",
+ " this.ws.onmessage = this._make_on_message_function(this);\n",
+ "\n",
+ " this.ondownload = ondownload;\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype._init_header = function() {\n",
+ " var titlebar = $(\n",
+ " '<div class=\"ui-dialog-titlebar ui-widget-header ui-corner-all ' +\n",
+ " 'ui-helper-clearfix\"/>');\n",
+ " var titletext = $(\n",
+ " '<div class=\"ui-dialog-title\" style=\"width: 100%; ' +\n",
+ " 'text-align: center; padding: 3px;\"/>');\n",
+ " titlebar.append(titletext)\n",
+ " this.root.append(titlebar);\n",
+ " this.header = titletext[0];\n",
+ "}\n",
+ "\n",
+ "\n",
+ "\n",
+ "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n",
+ "\n",
+ "}\n",
+ "\n",
+ "\n",
+ "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n",
+ "\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype._init_canvas = function() {\n",
+ " var fig = this;\n",
+ "\n",
+ " var canvas_div = $('<div/>');\n",
+ "\n",
+ " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n",
+ "\n",
+ " function canvas_keyboard_event(event) {\n",
+ " return fig.key_event(event, event['data']);\n",
+ " }\n",
+ "\n",
+ " canvas_div.keydown('key_press', canvas_keyboard_event);\n",
+ " canvas_div.keyup('key_release', canvas_keyboard_event);\n",
+ " this.canvas_div = canvas_div\n",
+ " this._canvas_extra_style(canvas_div)\n",
+ " this.root.append(canvas_div);\n",
+ "\n",
+ " var canvas = $('<canvas/>');\n",
+ " canvas.addClass('mpl-canvas');\n",
+ " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n",
+ "\n",
+ " this.canvas = canvas[0];\n",
+ " this.context = canvas[0].getContext(\"2d\");\n",
+ "\n",
+ " var rubberband = $('<canvas/>');\n",
+ " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n",
+ "\n",
+ " var pass_mouse_events = true;\n",
+ "\n",
+ " canvas_div.resizable({\n",
+ " start: function(event, ui) {\n",
+ " pass_mouse_events = false;\n",
+ " },\n",
+ " resize: function(event, ui) {\n",
+ " fig.request_resize(ui.size.width, ui.size.height);\n",
+ " },\n",
+ " stop: function(event, ui) {\n",
+ " pass_mouse_events = true;\n",
+ " fig.request_resize(ui.size.width, ui.size.height);\n",
+ " },\n",
+ " });\n",
+ "\n",
+ " function mouse_event_fn(event) {\n",
+ " if (pass_mouse_events)\n",
+ " return fig.mouse_event(event, event['data']);\n",
+ " }\n",
+ "\n",
+ " rubberband.mousedown('button_press', mouse_event_fn);\n",
+ " rubberband.mouseup('button_release', mouse_event_fn);\n",
+ " // Throttle sequential mouse events to 1 every 20ms.\n",
+ " rubberband.mousemove('motion_notify', mouse_event_fn);\n",
+ "\n",
+ " rubberband.mouseenter('figure_enter', mouse_event_fn);\n",
+ " rubberband.mouseleave('figure_leave', mouse_event_fn);\n",
+ "\n",
+ " canvas_div.on(\"wheel\", function (event) {\n",
+ " event = event.originalEvent;\n",
+ " event['data'] = 'scroll'\n",
+ " if (event.deltaY < 0) {\n",
+ " event.step = 1;\n",
+ " } else {\n",
+ " event.step = -1;\n",
+ " }\n",
+ " mouse_event_fn(event);\n",
+ " });\n",
+ "\n",
+ " canvas_div.append(canvas);\n",
+ " canvas_div.append(rubberband);\n",
+ "\n",
+ " this.rubberband = rubberband;\n",
+ " this.rubberband_canvas = rubberband[0];\n",
+ " this.rubberband_context = rubberband[0].getContext(\"2d\");\n",
+ " this.rubberband_context.strokeStyle = \"#000000\";\n",
+ "\n",
+ " this._resize_canvas = function(width, height) {\n",
+ " // Keep the size of the canvas, canvas container, and rubber band\n",
+ " // canvas in synch.\n",
+ " canvas_div.css('width', width)\n",
+ " canvas_div.css('height', height)\n",
+ "\n",
+ " canvas.attr('width', width);\n",
+ " canvas.attr('height', height);\n",
+ "\n",
+ " rubberband.attr('width', width);\n",
+ " rubberband.attr('height', height);\n",
+ " }\n",
+ "\n",
+ " // Set the figure to an initial 600x600px, this will subsequently be updated\n",
+ " // upon first draw.\n",
+ " this._resize_canvas(600, 600);\n",
+ "\n",
+ " // Disable right mouse context menu.\n",
+ " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n",
+ " return false;\n",
+ " });\n",
+ "\n",
+ " function set_focus () {\n",
+ " canvas.focus();\n",
+ " canvas_div.focus();\n",
+ " }\n",
+ "\n",
+ " window.setTimeout(set_focus, 100);\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype._init_toolbar = function() {\n",
+ " var fig = this;\n",
+ "\n",
+ " var nav_element = $('<div/>')\n",
+ " nav_element.attr('style', 'width: 100%');\n",
+ " this.root.append(nav_element);\n",
+ "\n",
+ " // Define a callback function for later on.\n",
+ " function toolbar_event(event) {\n",
+ " return fig.toolbar_button_onclick(event['data']);\n",
+ " }\n",
+ " function toolbar_mouse_event(event) {\n",
+ " return fig.toolbar_button_onmouseover(event['data']);\n",
+ " }\n",
+ "\n",
+ " for(var toolbar_ind in mpl.toolbar_items) {\n",
+ " var name = mpl.toolbar_items[toolbar_ind][0];\n",
+ " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
+ " var image = mpl.toolbar_items[toolbar_ind][2];\n",
+ " var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
+ "\n",
+ " if (!name) {\n",
+ " // put a spacer in here.\n",
+ " continue;\n",
+ " }\n",
+ " var button = $('<button/>');\n",
+ " button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n",
+ " 'ui-button-icon-only');\n",
+ " button.attr('role', 'button');\n",
+ " button.attr('aria-disabled', 'false');\n",
+ " button.click(method_name, toolbar_event);\n",
+ " button.mouseover(tooltip, toolbar_mouse_event);\n",
+ "\n",
+ " var icon_img = $('<span/>');\n",
+ " icon_img.addClass('ui-button-icon-primary ui-icon');\n",
+ " icon_img.addClass(image);\n",
+ " icon_img.addClass('ui-corner-all');\n",
+ "\n",
+ " var tooltip_span = $('<span/>');\n",
+ " tooltip_span.addClass('ui-button-text');\n",
+ " tooltip_span.html(tooltip);\n",
+ "\n",
+ " button.append(icon_img);\n",
+ " button.append(tooltip_span);\n",
+ "\n",
+ " nav_element.append(button);\n",
+ " }\n",
+ "\n",
+ " var fmt_picker_span = $('<span/>');\n",
+ "\n",
+ " var fmt_picker = $('<select/>');\n",
+ " fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n",
+ " fmt_picker_span.append(fmt_picker);\n",
+ " nav_element.append(fmt_picker_span);\n",
+ " this.format_dropdown = fmt_picker[0];\n",
+ "\n",
+ " for (var ind in mpl.extensions) {\n",
+ " var fmt = mpl.extensions[ind];\n",
+ " var option = $(\n",
+ " '<option/>', {selected: fmt === mpl.default_extension}).html(fmt);\n",
+ " fmt_picker.append(option)\n",
+ " }\n",
+ "\n",
+ " // Add hover states to the ui-buttons\n",
+ " $( \".ui-button\" ).hover(\n",
+ " function() { $(this).addClass(\"ui-state-hover\");},\n",
+ " function() { $(this).removeClass(\"ui-state-hover\");}\n",
+ " );\n",
+ "\n",
+ " var status_bar = $('<span class=\"mpl-message\"/>');\n",
+ " nav_element.append(status_bar);\n",
+ " this.message = status_bar[0];\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n",
+ " // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n",
+ " // which will in turn request a refresh of the image.\n",
+ " this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype.send_message = function(type, properties) {\n",
+ " properties['type'] = type;\n",
+ " properties['figure_id'] = this.id;\n",
+ " this.ws.send(JSON.stringify(properties));\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype.send_draw_message = function() {\n",
+ " if (!this.waiting) {\n",
+ " this.waiting = true;\n",
+ " this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n",
+ " }\n",
+ "}\n",
+ "\n",
+ "\n",
+ "mpl.figure.prototype.handle_save = function(fig, msg) {\n",
+ " var format_dropdown = fig.format_dropdown;\n",
+ " var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n",
+ " fig.ondownload(fig, format);\n",
+ "}\n",
+ "\n",
+ "\n",
+ "mpl.figure.prototype.handle_resize = function(fig, msg) {\n",
+ " var size = msg['size'];\n",
+ " if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n",
+ " fig._resize_canvas(size[0], size[1]);\n",
+ " fig.send_message(\"refresh\", {});\n",
+ " };\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n",
+ " var x0 = msg['x0'];\n",
+ " var y0 = fig.canvas.height - msg['y0'];\n",
+ " var x1 = msg['x1'];\n",
+ " var y1 = fig.canvas.height - msg['y1'];\n",
+ " x0 = Math.floor(x0) + 0.5;\n",
+ " y0 = Math.floor(y0) + 0.5;\n",
+ " x1 = Math.floor(x1) + 0.5;\n",
+ " y1 = Math.floor(y1) + 0.5;\n",
+ " var min_x = Math.min(x0, x1);\n",
+ " var min_y = Math.min(y0, y1);\n",
+ " var width = Math.abs(x1 - x0);\n",
+ " var height = Math.abs(y1 - y0);\n",
+ "\n",
+ " fig.rubberband_context.clearRect(\n",
+ " 0, 0, fig.canvas.width, fig.canvas.height);\n",
+ "\n",
+ " fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n",
+ " // Updates the figure title.\n",
+ " fig.header.textContent = msg['label'];\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype.handle_cursor = function(fig, msg) {\n",
+ " var cursor = msg['cursor'];\n",
+ " switch(cursor)\n",
+ " {\n",
+ " case 0:\n",
+ " cursor = 'pointer';\n",
+ " break;\n",
+ " case 1:\n",
+ " cursor = 'default';\n",
+ " break;\n",
+ " case 2:\n",
+ " cursor = 'crosshair';\n",
+ " break;\n",
+ " case 3:\n",
+ " cursor = 'move';\n",
+ " break;\n",
+ " }\n",
+ " fig.rubberband_canvas.style.cursor = cursor;\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype.handle_message = function(fig, msg) {\n",
+ " fig.message.textContent = msg['message'];\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype.handle_draw = function(fig, msg) {\n",
+ " // Request the server to send over a new figure.\n",
+ " fig.send_draw_message();\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n",
+ " fig.image_mode = msg['mode'];\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype.updated_canvas_event = function() {\n",
+ " // Called whenever the canvas gets updated.\n",
+ " this.send_message(\"ack\", {});\n",
+ "}\n",
+ "\n",
+ "// A function to construct a web socket function for onmessage handling.\n",
+ "// Called in the figure constructor.\n",
+ "mpl.figure.prototype._make_on_message_function = function(fig) {\n",
+ " return function socket_on_message(evt) {\n",
+ " if (evt.data instanceof Blob) {\n",
+ " /* FIXME: We get \"Resource interpreted as Image but\n",
+ " * transferred with MIME type text/plain:\" errors on\n",
+ " * Chrome. But how to set the MIME type? It doesn't seem\n",
+ " * to be part of the websocket stream */\n",
+ " evt.data.type = \"image/png\";\n",
+ "\n",
+ " /* Free the memory for the previous frames */\n",
+ " if (fig.imageObj.src) {\n",
+ " (window.URL || window.webkitURL).revokeObjectURL(\n",
+ " fig.imageObj.src);\n",
+ " }\n",
+ "\n",
+ " fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n",
+ " evt.data);\n",
+ " fig.updated_canvas_event();\n",
+ " fig.waiting = false;\n",
+ " return;\n",
+ " }\n",
+ " else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n",
+ " fig.imageObj.src = evt.data;\n",
+ " fig.updated_canvas_event();\n",
+ " fig.waiting = false;\n",
+ " return;\n",
+ " }\n",
+ "\n",
+ " var msg = JSON.parse(evt.data);\n",
+ " var msg_type = msg['type'];\n",
+ "\n",
+ " // Call the \"handle_{type}\" callback, which takes\n",
+ " // the figure and JSON message as its only arguments.\n",
+ " try {\n",
+ " var callback = fig[\"handle_\" + msg_type];\n",
+ " } catch (e) {\n",
+ " console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n",
+ " return;\n",
+ " }\n",
+ "\n",
+ " if (callback) {\n",
+ " try {\n",
+ " // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n",
+ " callback(fig, msg);\n",
+ " } catch (e) {\n",
+ " console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n",
+ " }\n",
+ " }\n",
+ " };\n",
+ "}\n",
+ "\n",
+ "// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n",
+ "mpl.findpos = function(e) {\n",
+ " //this section is from http://www.quirksmode.org/js/events_properties.html\n",
+ " var targ;\n",
+ " if (!e)\n",
+ " e = window.event;\n",
+ " if (e.target)\n",
+ " targ = e.target;\n",
+ " else if (e.srcElement)\n",
+ " targ = e.srcElement;\n",
+ " if (targ.nodeType == 3) // defeat Safari bug\n",
+ " targ = targ.parentNode;\n",
+ "\n",
+ " // jQuery normalizes the pageX and pageY\n",
+ " // pageX,Y are the mouse positions relative to the document\n",
+ " // offset() returns the position of the element relative to the document\n",
+ " var x = e.pageX - $(targ).offset().left;\n",
+ " var y = e.pageY - $(targ).offset().top;\n",
+ "\n",
+ " return {\"x\": x, \"y\": y};\n",
+ "};\n",
+ "\n",
+ "/*\n",
+ " * return a copy of an object with only non-object keys\n",
+ " * we need this to avoid circular references\n",
+ " * http://stackoverflow.com/a/24161582/3208463\n",
+ " */\n",
+ "function simpleKeys (original) {\n",
+ " return Object.keys(original).reduce(function (obj, key) {\n",
+ " if (typeof original[key] !== 'object')\n",
+ " obj[key] = original[key]\n",
+ " return obj;\n",
+ " }, {});\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype.mouse_event = function(event, name) {\n",
+ " var canvas_pos = mpl.findpos(event)\n",
+ "\n",
+ " if (name === 'button_press')\n",
+ " {\n",
+ " this.canvas.focus();\n",
+ " this.canvas_div.focus();\n",
+ " }\n",
+ "\n",
+ " var x = canvas_pos.x;\n",
+ " var y = canvas_pos.y;\n",
+ "\n",
+ " this.send_message(name, {x: x, y: y, button: event.button,\n",
+ " step: event.step,\n",
+ " guiEvent: simpleKeys(event)});\n",
+ "\n",
+ " /* This prevents the web browser from automatically changing to\n",
+ " * the text insertion cursor when the button is pressed. We want\n",
+ " * to control all of the cursor setting manually through the\n",
+ " * 'cursor' event from matplotlib */\n",
+ " event.preventDefault();\n",
+ " return false;\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype._key_event_extra = function(event, name) {\n",
+ " // Handle any extra behaviour associated with a key event\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype.key_event = function(event, name) {\n",
+ "\n",
+ " // Prevent repeat events\n",
+ " if (name == 'key_press')\n",
+ " {\n",
+ " if (event.which === this._key)\n",
+ " return;\n",
+ " else\n",
+ " this._key = event.which;\n",
+ " }\n",
+ " if (name == 'key_release')\n",
+ " this._key = null;\n",
+ "\n",
+ " var value = '';\n",
+ " if (event.ctrlKey && event.which != 17)\n",
+ " value += \"ctrl+\";\n",
+ " if (event.altKey && event.which != 18)\n",
+ " value += \"alt+\";\n",
+ " if (event.shiftKey && event.which != 16)\n",
+ " value += \"shift+\";\n",
+ "\n",
+ " value += 'k';\n",
+ " value += event.which.toString();\n",
+ "\n",
+ " this._key_event_extra(event, name);\n",
+ "\n",
+ " this.send_message(name, {key: value,\n",
+ " guiEvent: simpleKeys(event)});\n",
+ " return false;\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype.toolbar_button_onclick = function(name) {\n",
+ " if (name == 'download') {\n",
+ " this.handle_save(this, null);\n",
+ " } else {\n",
+ " this.send_message(\"toolbar_button\", {name: name});\n",
+ " }\n",
+ "};\n",
+ "\n",
+ "mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n",
+ " this.message.textContent = tooltip;\n",
+ "};\n",
+ "mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n",
+ "\n",
+ "mpl.extensions = [\"eps\", \"jpeg\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\", \"tif\"];\n",
+ "\n",
+ "mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n",
+ " // Create a \"websocket\"-like object which calls the given IPython comm\n",
+ " // object with the appropriate methods. Currently this is a non binary\n",
+ " // socket, so there is still some room for performance tuning.\n",
+ " var ws = {};\n",
+ "\n",
+ " ws.close = function() {\n",
+ " comm.close()\n",
+ " };\n",
+ " ws.send = function(m) {\n",
+ " //console.log('sending', m);\n",
+ " comm.send(m);\n",
+ " };\n",
+ " // Register the callback with on_msg.\n",
+ " comm.on_msg(function(msg) {\n",
+ " //console.log('receiving', msg['content']['data'], msg);\n",
+ " // Pass the mpl event to the overriden (by mpl) onmessage function.\n",
+ " ws.onmessage(msg['content']['data'])\n",
+ " });\n",
+ " return ws;\n",
+ "}\n",
+ "\n",
+ "mpl.mpl_figure_comm = function(comm, msg) {\n",
+ " // This is the function which gets called when the mpl process\n",
+ " // starts-up an IPython Comm through the \"matplotlib\" channel.\n",
+ "\n",
+ " var id = msg.content.data.id;\n",
+ " // Get hold of the div created by the display call when the Comm\n",
+ " // socket was opened in Python.\n",
+ " var element = $(\"#\" + id);\n",
+ " var ws_proxy = comm_websocket_adapter(comm)\n",
+ "\n",
+ " function ondownload(figure, format) {\n",
+ " window.open(figure.imageObj.src);\n",
+ " }\n",
+ "\n",
+ " var fig = new mpl.figure(id, ws_proxy,\n",
+ " ondownload,\n",
+ " element.get(0));\n",
+ "\n",
+ " // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n",
+ " // web socket which is closed, not our websocket->open comm proxy.\n",
+ " ws_proxy.onopen();\n",
+ "\n",
+ " fig.parent_element = element.get(0);\n",
+ " fig.cell_info = mpl.find_output_cell(\"<div id='\" + id + \"'></div>\");\n",
+ " if (!fig.cell_info) {\n",
+ " console.error(\"Failed to find cell for figure\", id, fig);\n",
+ " return;\n",
+ " }\n",
+ "\n",
+ " var output_index = fig.cell_info[2]\n",
+ " var cell = fig.cell_info[0];\n",
+ "\n",
+ "};\n",
+ "\n",
+ "mpl.figure.prototype.handle_close = function(fig, msg) {\n",
+ " fig.root.unbind('remove')\n",
+ "\n",
+ " // Update the output cell to use the data from the current canvas.\n",
+ " fig.push_to_output();\n",
+ " var dataURL = fig.canvas.toDataURL();\n",
+ " // Re-enable the keyboard manager in IPython - without this line, in FF,\n",
+ " // the notebook keyboard shortcuts fail.\n",
+ " IPython.keyboard_manager.enable()\n",
+ " $(fig.parent_element).html('<img src=\"' + dataURL + '\">');\n",
+ " fig.close_ws(fig, msg);\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype.close_ws = function(fig, msg){\n",
+ " fig.send_message('closing', msg);\n",
+ " // fig.ws.close()\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype.push_to_output = function(remove_interactive) {\n",
+ " // Turn the data on the canvas into data in the output cell.\n",
+ " var dataURL = this.canvas.toDataURL();\n",
+ " this.cell_info[1]['text/html'] = '<img src=\"' + dataURL + '\">';\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype.updated_canvas_event = function() {\n",
+ " // Tell IPython that the notebook contents must change.\n",
+ " IPython.notebook.set_dirty(true);\n",
+ " this.send_message(\"ack\", {});\n",
+ " var fig = this;\n",
+ " // Wait a second, then push the new image to the DOM so\n",
+ " // that it is saved nicely (might be nice to debounce this).\n",
+ " setTimeout(function () { fig.push_to_output() }, 1000);\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype._init_toolbar = function() {\n",
+ " var fig = this;\n",
+ "\n",
+ " var nav_element = $('<div/>')\n",
+ " nav_element.attr('style', 'width: 100%');\n",
+ " this.root.append(nav_element);\n",
+ "\n",
+ " // Define a callback function for later on.\n",
+ " function toolbar_event(event) {\n",
+ " return fig.toolbar_button_onclick(event['data']);\n",
+ " }\n",
+ " function toolbar_mouse_event(event) {\n",
+ " return fig.toolbar_button_onmouseover(event['data']);\n",
+ " }\n",
+ "\n",
+ " for(var toolbar_ind in mpl.toolbar_items){\n",
+ " var name = mpl.toolbar_items[toolbar_ind][0];\n",
+ " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
+ " var image = mpl.toolbar_items[toolbar_ind][2];\n",
+ " var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
+ "\n",
+ " if (!name) { continue; };\n",
+ "\n",
+ " var button = $('<button class=\"btn btn-default\" href=\"#\" title=\"' + name + '\"><i class=\"fa ' + image + ' fa-lg\"></i></button>');\n",
+ " button.click(method_name, toolbar_event);\n",
+ " button.mouseover(tooltip, toolbar_mouse_event);\n",
+ " nav_element.append(button);\n",
+ " }\n",
+ "\n",
+ " // Add the status bar.\n",
+ " var status_bar = $('<span class=\"mpl-message\" style=\"text-align:right; float: right;\"/>');\n",
+ " nav_element.append(status_bar);\n",
+ " this.message = status_bar[0];\n",
+ "\n",
+ " // Add the close button to the window.\n",
+ " var buttongrp = $('<div class=\"btn-group inline pull-right\"></div>');\n",
+ " var button = $('<button class=\"btn btn-mini btn-primary\" href=\"#\" title=\"Stop Interaction\"><i class=\"fa fa-power-off icon-remove icon-large\"></i></button>');\n",
+ " button.click(function (evt) { fig.handle_close(fig, {}); } );\n",
+ " button.mouseover('Stop Interaction', toolbar_mouse_event);\n",
+ " buttongrp.append(button);\n",
+ " var titlebar = this.root.find($('.ui-dialog-titlebar'));\n",
+ " titlebar.prepend(buttongrp);\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype._root_extra_style = function(el){\n",
+ " var fig = this\n",
+ " el.on(\"remove\", function(){\n",
+ "\tfig.close_ws(fig, {});\n",
+ " });\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype._canvas_extra_style = function(el){\n",
+ " // this is important to make the div 'focusable\n",
+ " el.attr('tabindex', 0)\n",
+ " // reach out to IPython and tell the keyboard manager to turn it's self\n",
+ " // off when our div gets focus\n",
+ "\n",
+ " // location in version 3\n",
+ " if (IPython.notebook.keyboard_manager) {\n",
+ " IPython.notebook.keyboard_manager.register_events(el);\n",
+ " }\n",
+ " else {\n",
+ " // location in version 2\n",
+ " IPython.keyboard_manager.register_events(el);\n",
+ " }\n",
+ "\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype._key_event_extra = function(event, name) {\n",
+ " var manager = IPython.notebook.keyboard_manager;\n",
+ " if (!manager)\n",
+ " manager = IPython.keyboard_manager;\n",
+ "\n",
+ " // Check for shift+enter\n",
+ " if (event.shiftKey && event.which == 13) {\n",
+ " this.canvas_div.blur();\n",
+ " event.shiftKey = false;\n",
+ " // Send a \"J\" for go to next cell\n",
+ " event.which = 74;\n",
+ " event.keyCode = 74;\n",
+ " manager.command_mode();\n",
+ " manager.handle_keydown(event);\n",
+ " }\n",
+ "}\n",
+ "\n",
+ "mpl.figure.prototype.handle_save = function(fig, msg) {\n",
+ " fig.ondownload(fig, null);\n",
+ "}\n",
+ "\n",
+ "\n",
+ "mpl.find_output_cell = function(html_output) {\n",
+ " // Return the cell and output element which can be found *uniquely* in the notebook.\n",
+ " // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n",
+ " // IPython event is triggered only after the cells have been serialised, which for\n",
+ " // our purposes (turning an active figure into a static one), is too late.\n",
+ " var cells = IPython.notebook.get_cells();\n",
+ " var ncells = cells.length;\n",
+ " for (var i=0; i<ncells; i++) {\n",
+ " var cell = cells[i];\n",
+ " if (cell.cell_type === 'code'){\n",
+ " for (var j=0; j<cell.output_area.outputs.length; j++) {\n",
+ " var data = cell.output_area.outputs[j];\n",
+ " if (data.data) {\n",
+ " // IPython >= 3 moved mimebundle to data attribute of output\n",
+ " data = data.data;\n",
+ " }\n",
+ " if (data['text/html'] == html_output) {\n",
+ " return [cell, data, j];\n",
+ " }\n",
+ " }\n",
+ " }\n",
+ " }\n",
+ "}\n",
+ "\n",
+ "// Register the function which deals with the matplotlib target/channel.\n",
+ "// The kernel may be null if the page has been refreshed.\n",
+ "if (IPython.notebook.kernel != null) {\n",
+ " IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n",
+ "}\n"
+ ],
+ "text/plain": [
+ "<IPython.core.display.Javascript object>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ "<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAH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Fbs/2cDQAUAND89L+eMwxUA3gUAeyB6gm0NAJvY/3X9Za6EeHCSj/X02ca/CtIaAwQB4M8dj9M1TsclEKzzJ0/9X49jRVFOO+dA8GV/qfH3aQDw/Pv/cs5ICiBI0VQAwDYIrvbPO3VbTwCYatz/MghOBp8AXX8XUnCSj/VM2sa/Eq4AcBcAVALAMgC4j92ma5yedhAEdIQex4qinHbOheCL5hvG30cAQN/3/+WckVwIAF869fv/AMA/ILgK/xgA9AeA4cb9vwnBl/QXQNffhRSc5GM9k7bxr4QtALwKgrTjvwPAdQCwHwBanLpN1zgd10BwgdiU/U2PY0VRTjuqQOWfDwPAYQi++FUBzB1VABsfWwBo8jcAmHfqd11jf34NAAcA4DfG3/U4VhTlnwKp1mQvaA1arlAA2BQA7oR4nc7DkFzro+svBycNWc87UmzjX4U0AeB89n9d42SaQxD8XSPcpsexoij/FDwGANshsBj4KAQWBmXwr9uFmpbfA8B/n/r9cwDwBgRf3h+H4Eq8HAA6A8B/AMDFALADop16uv5R/g2C9OMvIAhOPnbq/2dBftbTZxsfdFxr/B0A+C4AfAiCoOMXALAPAFqyx+sau2kFQdr8CsvtehwrivJPQ0cA2A2Bn9Rs+Nf2oUvLBAgaQGoh+IIeCgDns9ubQNAlXAdBYf1TwjY6gq4/cRcE6a8Tp37o95+euj0f6+mzjQ8yrjX+NQCsg8D7bz8E9iX3C9voCLrGNk4CwFEI1pB7KfKAUI9jRVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURfnA8P8Bn5xZxCK77JUAAAAASUVORK5CYII=\">"
+ ],
+ "text/plain": [
+ "<IPython.core.display.HTML object>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/plain": [
+ "<matplotlib.image.AxesImage at 0x7f47531e26a0>"
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "imshow(numpy.log(fabio.open(\"collect_01_00001_0010.cbf\").data))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Conclusion\n",
+ "\n",
+ "FabIO offers a versatile way for manipulating image files and convert them."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "0.4.0-dev6\n",
+ "2.6.0\n",
+ "1.8.13\n"
+ ]
+ }
+ ],
+ "source": [
+ "#For info:\n",
+ "print(fabio.version)\n",
+ "print(fabio.eigerimage.h5py.version.version)\n",
+ "print(fabio.eigerimage.h5py.version.hdf5_version)"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.4.2"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/doc/source/tutorials/Nexus2cbf.rst b/doc/source/tutorials/Nexus2cbf.rst
new file mode 100644
index 0000000..c68ea62
--- /dev/null
+++ b/doc/source/tutorials/Nexus2cbf.rst
@@ -0,0 +1,180 @@
+
+Nexus -> CBF
+============
+
+In this tutorial we will see how to export a Nexus archive produced by
+the Eiger detector from Dectris into a bunch of CBF files, similar to
+the one generated by Pilatus detectors, using the FabIO library to write
+images (and h5py which actually reads them).
+
+**Nota:** HDF5 files produced by Nexus detector use a specific
+LZ4/bitshuffle plugin for reading/writing. They require recent version
+of hdf5 (>= 1.8.10 ), h5py (>= 2.5.0) and those plugins installed:
+
+- https://github.com/nexusformat/HDF5-External-Filter-Plugins/tree/master/LZ4
+- https://github.com/kiyo-masui/bitshuffle
+
+| Under Windows, those plugins can easily be installed via this
+repository which provides binary DLLs:
+| https://github.com/silx-kit/hdf5plugin
+
+.. code:: python
+
+ #Run as first to set the plugin path, very important to handle Eiger data:
+ import os
+ os.environ["HDF5_PLUGIN_PATH"]="/usr/lib/x86_64-linux-gnu/hdf5/plugins"
+
+.. code:: python
+
+ import fabio
+
+In this example we will use the Eiger 4M dataset which can be obtained
+from Dectris: https://www.dectris.com/datasets.html. You may register to
+get download access.
+
+.. code:: python
+
+ images = fabio.open("collect_01_00001_master.h5")
+ print(images)
+
+
+.. parsed-literal::
+
+ Eiger dataset with 1800 frames from collect_01_00001_master.h5
+
+
+Each "EigerImage" object contains a list to the corresponding HDF5
+opened with h5py. So one can retrieve all metadata associated:
+
+.. code:: python
+
+ header = {}
+ for key, value in images.h5["entry/instrument/detector"].items():
+ try:
+ val = value[()]
+ except:
+ print("%s: unprintable"%key)
+ else:
+ print("%s: %s"%(key, val))
+ header[key] = val
+
+
+
+.. parsed-literal::
+
+ beam_center_x: 1051.0
+ beam_center_y: 1001.0
+ bit_depth_readout: 32
+ count_time: 0.099996
+ countrate_correction_applied: 0
+ description: b'Dectris Eiger 4M'
+ detectorSpecific: unprintable
+ detector_distance: 0.00733
+ detector_number: b'E-08-0102'
+ detector_readout_time: 3.78e-06
+ efficiency_correction_applied: 0
+ flatfield_correction_applied: 1
+ frame_time: 0.1
+ geometry: unprintable
+ pixel_mask_applied: 0
+ sensor_material: b'Si'
+ sensor_thickness: 0.00032
+ threshold_energy: 5635.65
+ virtual_pixel_correction_applied: 1
+ x_pixel_size: 7.5e-05
+ y_pixel_size: 7.5e-05
+
+
+Now we can translate every single image into a CBF file, here we do only
+a dozen of then:
+
+.. code:: python
+
+ for idx, frame in enumerate(images):
+ cbf = fabio.cbfimage.cbfimage(header=header,data=frame.data)
+ fname = "collect_01_00001_%04i.cbf"%idx
+ cbf.write(fname)
+ print(fname)
+ if idx>10:
+ break
+
+
+.. parsed-literal::
+
+ collect_01_00001_0000.cbf
+ collect_01_00001_0001.cbf
+ collect_01_00001_0002.cbf
+ collect_01_00001_0003.cbf
+ collect_01_00001_0004.cbf
+ collect_01_00001_0005.cbf
+ collect_01_00001_0006.cbf
+ collect_01_00001_0007.cbf
+ collect_01_00001_0008.cbf
+ collect_01_00001_0009.cbf
+ collect_01_00001_0010.cbf
+ collect_01_00001_0011.cbf
+
+
+This is how to display an image using the notebook backend:
+
+.. code:: python
+
+ %pylab nbagg
+
+
+.. parsed-literal::
+
+ Populating the interactive namespace from numpy and matplotlib
+
+
+.. code:: python
+
+ imshow(numpy.log(fabio.open("collect_01_00001_0010.cbf").data))
+
+
+.. parsed-literal::
+
+ /scisoft/users/jupyter/jupy34/lib/python3.4/site-packages/ipykernel/__main__.py:1: RuntimeWarning: divide by zero encountered in log
+ if __name__ == '__main__':
+
+
+
+.. parsed-literal::
+
+ <IPython.core.display.Javascript object>
+
+
+
+.. raw:: html
+
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAgAElEQVR4nOy9eXhc1ZH+38xMMpksDCSTYSZkICQEEiAJE0KSSdiCYdgxxgMGzE6IYwwBHDA2BtqSV7xvWr3IuyXZsi2vsmRLXmRJtiXZki3L2ndrs5bWvnSrfn/cqdPnnHvOvbelhsz3+dXnefQ8Uqu779p9675V9ZbLRRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAE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B1VABsfWwBo8jcAmHfqd11jf34NAAcA4DfG3/U4VhTlnwKp1mQvaA1arlAA2BQA7oR4nc7DkFzro+svBycNWc87UmzjX4U0AeB89n9d42SaQxD8XSPcpsexoij/FDwGANshsBj4KAQWBmXwr9uFmpbfA8B/n/r9cwDwBgRf3h+H4Eq8HAA6A8B/AMDFALADop16uv5R/g2C9OMvIAhOPnbq/2dBftbTZxsfdFxr/B0A+C4AfAiCoOMXALAPAFqyx+sau2kFQdr8CsvtehwrivJPQ0cA2A2Bn9Rs+Nf2oUvLBAgaQGoh+IIeCgDns9ubQNAlXAdBYf1TwjY6gq4/cRcE6a8Tp37o95+euj0f6+mzjQ8yrjX+NQCsg8D7bz8E9iX3C9voCLrGNk4CwFEI1pB7KfKAUI9jRVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURVEURfnA8P8Bn5xZxCK77JUAAAAASUVORK5CYII=">
+
+
+
+
+.. parsed-literal::
+
+ <matplotlib.image.AxesImage at 0x7f47531e26a0>
+
+
+
+Conclusion
+----------
+
+FabIO offers a versatile way for manipulating image files and convert
+them.
+
+.. code:: python
+
+ #For info:
+ print(fabio.version)
+ print(fabio.eigerimage.h5py.version.version)
+ print(fabio.eigerimage.h5py.version.hdf5_version)
+
+
+.. parsed-literal::
+
+ 0.4.0-dev6
+ 2.6.0
+ 1.8.13
+
diff --git a/doc/source/tutorials/convert_CBF.rst b/doc/source/tutorials/convert_CBF.rst
new file mode 100644
index 0000000..f29a8e3
--- /dev/null
+++ b/doc/source/tutorials/convert_CBF.rst
@@ -0,0 +1,62 @@
+
+Convert a bunch of CBF files into EDF format
+============================================
+
+This simple tutorial explains how to convert a bunch of CBF files to EDF
+files.
+
+.. code:: python
+
+ import glob
+ files = glob.glob("*.cbf")
+ files.sort()
+ print("Number of files: %s" % len(files))
+
+
+.. parsed-literal::
+
+ Number of files: 200
+
+
+.. code:: python
+
+ dest_format = "edf"
+ dest_dir = "edf_format"
+
+.. code:: python
+
+ import fabio, os
+ if not os.path.exists(dest_dir):
+ os.makedirs(dest_dir)
+
+.. code:: python
+
+ %%time
+ for onefile in files:
+ dst_name = os.path.join(dest_dir, os.path.splitext(onefile)[0] + "." + dest_format)
+ fabio.open(onefile).convert(dest_format).save(dst_name)
+
+
+.. parsed-literal::
+
+ CPU times: user 2.36 s, sys: 2.84 s, total: 5.21 s
+ Wall time: 5.64 s
+
+
+.. code:: python
+
+ print("The overall speed is %.1f frame/second"%(len(files)/5.64))
+
+
+.. parsed-literal::
+
+ The overall speed is 35.5 frame/second
+
+
+Conclusion
+----------
+
+This simple tutorial explains how to perform simple file conversion. It
+is likely to be limited by the bandwidth available for the hard-drive of
+your computer or by the compression/decompression algorithm as it the
+case here for CBF decompression.
diff --git a/doc/source/tutorials/index.rst b/doc/source/tutorials/index.rst
new file mode 100644
index 0000000..037e383
--- /dev/null
+++ b/doc/source/tutorials/index.rst
@@ -0,0 +1,14 @@
+:Author: Jérôme Kieffer
+:Date: 15/07/2016
+:Keywords: Tutorials
+:Target: Advanced users
+
+Tutorials on FabIO
+==================
+
+.. toctree::
+ :maxdepth: 2
+
+ convert_CBF
+ Nexus2cbf
+
diff --git a/fabio.egg-info/SOURCES.txt b/fabio.egg-info/SOURCES.txt
new file mode 100644
index 0000000..40ba04c
--- /dev/null
+++ b/fabio.egg-info/SOURCES.txt
@@ -0,0 +1,217 @@
+MANIFEST.in
+README.rst
+copyright
+run_tests.py
+setup.py
+stdeb.cfg
+version.py
+doc/Makefile
+doc/make.bat
+doc/source/Changelog.rst
+doc/source/conf.py
+doc/source/coverage.rst
+doc/source/getting_started.rst
+doc/source/index.rst
+doc/source/install.rst
+doc/source/mathjax.py
+doc/source/performances.rst
+doc/source/_static/placeholder
+doc/source/api/modules.rst
+doc/source/img/viewer.png
+doc/source/man/fabio_viewer.rst
+doc/source/tutorials/Nexus2cbf.ipynb
+doc/source/tutorials/Nexus2cbf.rst
+doc/source/tutorials/convert_CBF.rst
+doc/source/tutorials/index.rst
+fabio/GEimage.py
+fabio/HiPiCimage.py
+fabio/OXDimage.py
+fabio/TiffIO.py
+fabio/__init__.py
+fabio/adscimage.py
+fabio/binaryimage.py
+fabio/bruker100image.py
+fabio/brukerimage.py
+fabio/cbfimage.py
+fabio/compression.py
+fabio/converters.py
+fabio/datIO.py
+fabio/directories.py
+fabio/dm3image.py
+fabio/edfimage.py
+fabio/eigerimage.py
+fabio/fabioformats.py
+fabio/fabioimage.py
+fabio/fabioutils.py
+fabio/file_series.py
+fabio/fit2dimage.py
+fabio/fit2dmaskimage.py
+fabio/fit2dspreadsheetimage.py
+fabio/hdf5image.py
+fabio/jpeg2kimage.py
+fabio/jpegimage.py
+fabio/kcdimage.py
+fabio/mar345image.py
+fabio/marccdimage.py
+fabio/mpaimage.py
+fabio/mrcimage.py
+fabio/nexus.py
+fabio/numpyimage.py
+fabio/openimage.py
+fabio/pilatusimage.py
+fabio/pixiimage.py
+fabio/pnmimage.py
+fabio/raxisimage.py
+fabio/readbytestream.py
+fabio/setup.py
+fabio/speimage.py
+fabio/templateimage.py
+fabio/tifimage.py
+fabio/xsdimage.py
+fabio/app/__init__.py
+fabio/app/convert.py
+fabio/app/setup.py
+fabio/app/viewer.py
+fabio/benchmark/__init__.py
+fabio/benchmark/setup.py
+fabio/ext/__init__.py
+fabio/ext/_cif.c
+fabio/ext/_cif.pyx
+fabio/ext/byte_offset.c
+fabio/ext/byte_offset.pyx
+fabio/ext/cf_io.c
+fabio/ext/cf_io.pyx
+fabio/ext/mar345_IO.c
+fabio/ext/mar345_IO.pyx
+fabio/ext/setup.py
+fabio/ext/include/ccp4_pack.h
+fabio/ext/include/columnfile.h
+fabio/ext/include/msvc/stdint.h
+fabio/ext/src/ccp4_pack.c
+fabio/ext/src/cf_iomodule.c
+fabio/ext/src/columnfile.c
+fabio/test/__init__.py
+fabio/test/profile_all.py
+fabio/test/setup.py
+fabio/test/testGEimage.py
+fabio/test/testOXDimage.py
+fabio/test/testXSDimage.py
+fabio/test/test_all.py
+fabio/test/test_all_images.py
+fabio/test/test_file_series.py
+fabio/test/test_filename_steps.py
+fabio/test/test_flat_binary.py
+fabio/test/test_nexus.py
+fabio/test/testadscimage.py
+fabio/test/testbruker100image.py
+fabio/test/testbrukerimage.py
+fabio/test/testcbfimage.py
+fabio/test/testcompression.py
+fabio/test/testedfimage.py
+fabio/test/testeigerimage.py
+fabio/test/testfabioconvert.py
+fabio/test/testfabioimage.py
+fabio/test/testfilenames.py
+fabio/test/testfit2dimage.py
+fabio/test/testfit2dmaskimage.py
+fabio/test/testhdf5image.py
+fabio/test/testheadernotsingleton.py
+fabio/test/testjpeg2kimage.py
+fabio/test/testjpegimage.py
+fabio/test/testkcdimage.py
+fabio/test/testmar345image.py
+fabio/test/testmccdimage.py
+fabio/test/testmpaimage.py
+fabio/test/testnumpyimage.py
+fabio/test/testopenheader.py
+fabio/test/testopenimage.py
+fabio/test/testpilatusimage.py
+fabio/test/testpnmimage.py
+fabio/test/testraxisimage.py
+fabio/test/testspeimage.py
+fabio/test/testtifimage.py
+fabio/test/utilstest.py
+fabio/third_party/__init__.py
+fabio/third_party/argparse.py
+fabio/third_party/gzip.py
+fabio/third_party/ordereddict.py
+fabio/third_party/setup.py
+fabio/third_party/six.py
+fabio/third_party/_local/__init__.py
+fabio/third_party/_local/argparse.py
+fabio/third_party/_local/gzip.py
+fabio/third_party/_local/ordereddict.py
+fabio/third_party/_local/setup.py
+fabio/third_party/_local/six.py
+fabio/utils/__init__.py
+fabio/utils/mathutils.py
+fabio/utils/pilutils.py
+fabio/utils/setup.py
+pylint/.pylintrc
+pylint/GEimage.py.lint
+pylint/GEimage_old.py.lint
+pylint/HiPiCimage.py.lint
+pylint/OXDimage.py.lint
+pylint/TiffIO.py.lint
+pylint/__init__.py.lint
+pylint/adscimage.py.lint
+pylint/argparse.py.lint
+pylint/benchheader.py.lint
+pylint/binaryimage.py.lint
+pylint/bruker100image.py.lint
+pylint/brukerimage.py.lint
+pylint/cbfimage.py.lint
+pylint/compression.py.lint
+pylint/converters.py.lint
+pylint/datIO.py.lint
+pylint/dm3image.py.lint
+pylint/edfimage.py.lint
+pylint/fabian_mar_header.py.lint
+pylint/fabioimage.py.lint
+pylint/fabioutils.py.lint
+pylint/file_series.py.lint
+pylint/fit2dmaskimage.py.lint
+pylint/fit2dspreadsheetimage.py.lint
+pylint/hdf5image.py.lint
+pylint/kcdimage.py.lint
+pylint/lintem.py
+pylint/mar345image.py.lint
+pylint/marccdimage.py.lint
+pylint/mrcimage.py.lint
+pylint/oldtifimage.py.lint
+pylint/openimage.py.lint
+pylint/pilatusimage.py.lint
+pylint/pixiimage.py.lint
+pylint/pnmimage.py.lint
+pylint/profile_compressed.py.lint
+pylint/raxisimage.py.lint
+pylint/readbytestream.py.lint
+pylint/templateimage.py.lint
+pylint/testGEimage.py.lint
+pylint/testOXDimage.py.lint
+pylint/testXSDimage.py.lint
+pylint/test_all.py.lint
+pylint/test_all_images.py.lint
+pylint/test_file_series.py.lint
+pylint/test_filename_steps.py.lint
+pylint/test_flat_binary.py.lint
+pylint/testadscimage.py.lint
+pylint/testbrukerimage.py.lint
+pylint/testcbfimage.py.lint
+pylint/testcompression.py.lint
+pylint/testedfimage.py.lint
+pylint/testfabioimage.py.lint
+pylint/testfilenames.py.lint
+pylint/testfit2dmaskimage.py.lint
+pylint/testheadernotsingleton.py.lint
+pylint/testkcdimage.py.lint
+pylint/testmar345image.py.lint
+pylint/testmccdimage.py.lint
+pylint/testopenheader.py.lint
+pylint/testopenimage.py.lint
+pylint/testraxisimage.py.lint
+pylint/testtifgz.py.lint
+pylint/testtifimage.py.lint
+pylint/tifimage.py.lint
+pylint/utilstest.py.lint
+pylint/xsdimage.py.lint \ No newline at end of file
diff --git a/fabio/GEimage.py b/fabio/GEimage.py
new file mode 100644
index 0000000..4fd099f
--- /dev/null
+++ b/fabio/GEimage.py
@@ -0,0 +1,367 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+#
+#
+# Reads the header from a GE a-Si Angio Detector
+# Using version 8001 of the header from file:
+# c:\adept\core\DefaultImageInfoConfig.csv
+#
+# Antonino Miceli
+# Thu Jan 4 13:46:31 CST 2007
+#
+
+# modifications by Jon Wright for style, pychecker and fabio
+#
+# Get ready for python3:
+from __future__ import with_statement, print_function, division
+
+__authors__ = ["Antonino Miceli", "Jon Wright", "Jérôme Kieffer"]
+__date__ = "25/07/2017"
+__status__ = "production"
+__copyright__ = "2007 APS; 2010-2015 ESRF"
+__licence__ = "MIT"
+
+
+import numpy
+import struct
+import logging
+logger = logging.getLogger(__name__)
+from .fabioimage import FabioImage
+from .fabioutils import next_filename, previous_filename
+
+GE_HEADER_INFO = [
+ # Name, length in bytes, format for struct (None means string)
+ ('ImageFormat', 10, None),
+ ('VersionOfStandardHeader', 2, '<H'),
+ ('StandardHeaderSizeInBytes', 4, '<L'),
+ ('VersionOfUserHeader', 2, '<H'),
+ ('UserHeaderSizeInBytes', 4, '<L'),
+ ('NumberOfFrames', 2, '<H'),
+ ('NumberOfRowsInFrame', 2, '<H'),
+ ('NumberOfColsInFrame', 2, '<H'),
+ ('ImageDepthInBits', 2, '<H'),
+ ('AcquisitionDate', 20, None),
+ ('AcquisitionTime', 20, None),
+ ('DUTID', 20, None),
+ ('Operator', 50, None),
+ ('DetectorSignature', 20, None),
+ ('TestSystemName', 20, None),
+ ('TestStationRevision', 20, None),
+ ('CoreBundleRevision', 20, None),
+ ('AcquisitionName', 40, None),
+ ('AcquisitionParameterRevision', 20, None),
+ ('OriginalNumberOfRows', 2, '<H'),
+ ('OriginalNumberOfColumns', 2, '<H'),
+ ('RowNumberUpperLeftPointArchiveROI', 2, '<H'),
+ ('ColNumberUpperLeftPointArchiveROI', 2, '<H'),
+ ('Swapped', 2, '<H'),
+ ('Reordered', 2, '<H'),
+ ('HorizontalFlipped', 2, '<H'),
+ ('VerticalFlipped', 2, '<H'),
+ ('WindowValueDesired', 2, '<H'),
+ ('LevelValueDesired', 2, '<H'),
+ ('AcquisitionMode', 2, '<H'),
+ ('AcquisitionType', 2, '<H'),
+ ('UserAcquisitionCoffFileName1', 100, None),
+ ('UserAcquisitionCoffFileName2', 100, None),
+ ('FramesBeforeExpose', 2, '<H'),
+ ('FramesDuringExpose', 2, '<H'),
+ ('FramesAfterExpose', 2, '<H'),
+ ('IntervalBetweenFrames', 2, '<H'),
+ ('ExposeTimeDelayInMicrosecs', 8, '<d'),
+ ('TimeBetweenFramesInMicrosecs', 8, '<d'),
+ ('FramesToSkipExpose', 2, '<H'),
+ ('ExposureMode', 2, '<H'),
+ ('PrepPresetTimeInMicrosecs', 8, '<d'),
+ ('ExposePresetTimeInMicrosecs', 8, '<d'),
+ ('AcquisitionFrameRateInFps', 4, '<f'),
+ ('FOVSelect', 2, '<H'),
+ ('ExpertMode', 2, '<H'),
+ ('SetVCommon1', 8, '<d'),
+ ('SetVCommon2', 8, '<d'),
+ ('SetAREF', 8, '<d'),
+ ('SetAREFTrim', 4, '<L'),
+ ('SetSpareVoltageSource', 8, '<d'),
+ ('SetCompensationVoltageSource', 8, '<d'),
+ ('SetRowOffVoltage', 8, '<d'),
+ ('SetRowOnVoltage', 8, '<d'),
+ ('StoreCompensationVoltage', 4, '<L'),
+ ('RampSelection', 2, '<H'),
+ ('TimingMode', 2, '<H'),
+ ('Bandwidth', 2, '<H'),
+ ('ARCIntegrator', 2, '<H'),
+ ('ARCPostIntegrator', 2, '<H'),
+ ('NumberOfRows', 4, '<L'),
+ ('RowEnable', 2, '<H'),
+ ('EnableStretch', 2, '<H'),
+ ('CompEnable', 2, '<H'),
+ ('CompStretch', 2, '<H'),
+ ('LeftEvenTristate', 2, '<H'),
+ ('RightOddTristate', 2, '<H'),
+ ('TestModeSelect', 4, '<L'),
+ ('AnalogTestSource', 4, '<L'),
+ ('VCommonSelect', 4, '<L'),
+ ('DRCColumnSum', 4, '<L'),
+ ('TestPatternFrameDelta', 4, '<L'),
+ ('TestPatternRowDelta', 4, '<L'),
+ ('TestPatternColumnDelta', 4, '<L'),
+ ('DetectorHorizontalFlip', 2, '<H'),
+ ('DetectorVerticalFlip', 2, '<H'),
+ ('DFNAutoScrubOnOff', 2, '<H'),
+ ('FiberChannelTimeOutInMicrosecs', 4, '<L'),
+ ('DFNAutoScrubDelayInMicrosecs', 4, '<L'),
+ ('StoreAECROI', 2, '<H'),
+ ('TestPatternSaturationValue', 2, '<H'),
+ ('TestPatternSeed', 4, '<L'),
+ ('ExposureTimeInMillisecs', 4, '<f'),
+ ('FrameRateInFps', 4, '<f'),
+ ('kVp', 4, '<f'),
+ ('mA', 4, '<f'),
+ ('mAs', 4, '<f'),
+ ('FocalSpotInMM', 4, '<f'),
+ ('GeneratorType', 20, None),
+ ('StrobeIntensityInFtL', 4, '<f'),
+ ('NDFilterSelection', 2, '<H'),
+ ('RefRegTemp1', 8, '<d'),
+ ('RefRegTemp2', 8, '<d'),
+ ('RefRegTemp3', 8, '<d'),
+ ('Humidity1', 4, '<f'),
+ ('Humidity2', 4, '<f'),
+ ('DetectorControlTemp', 8, '<d'),
+ ('DoseValueInmR', 8, '<d'),
+ ('TargetLevelROIRow0', 2, '<H'),
+ ('TargetLevelROICol0', 2, '<H'),
+ ('TargetLevelROIRow1', 2, '<H'),
+ ('TargetLevelROICol1', 2, '<H'),
+ ('FrameNumberForTargetLevelROI', 2, '<H'),
+ ('PercentRangeForTargetLevel', 2, '<H'),
+ ('TargetValue', 2, '<H'),
+ ('ComputedMedianValue', 2, '<H'),
+ ('LoadZero', 2, '<H'),
+ ('MaxLUTOut', 2, '<H'),
+ ('MinLUTOut', 2, '<H'),
+ ('MaxLinear', 2, '<H'),
+ ('Reserved', 2, '<H'),
+ ('ElectronsPerCount', 2, '<H'),
+ ('ModeGain', 2, '<H'),
+ ('TemperatureInDegC', 8, '<d'),
+ ('LineRepaired', 2, '<H'),
+ ('LineRepairFileName', 100, None),
+ ('CurrentLongitudinalInMM', 4, '<f'),
+ ('CurrentTransverseInMM', 4, '<f'),
+ ('CurrentCircularInMM', 4, '<f'),
+ ('CurrentFilterSelection', 4, '<L'),
+ ('DisableScrubAck', 2, '<H'),
+ ('ScanModeSelect', 2, '<H'),
+ ('DetectorAppSwVersion', 20, None),
+ ('DetectorNIOSVersion', 20, None),
+ ('DetectorPeripheralSetVersion', 20, None),
+ ('DetectorPhysicalAddress', 20, None),
+ ('PowerDown', 2, '<H'),
+ ('InitialVoltageLevel_VCOMMON', 8, '<d'),
+ ('FinalVoltageLevel_VCOMMON', 8, '<d'),
+ ('DmrCollimatorSpotSize', 10, None),
+ ('DmrTrack', 5, None),
+ ('DmrFilter', 5, None),
+ ('FilterCarousel', 2, '<H'),
+ ('Phantom', 20, None),
+ ('SetEnableHighTime', 2, '<H'),
+ ('SetEnableLowTime', 2, '<H'),
+ ('SetCompHighTime', 2, '<H'),
+ ('SetCompLowTime', 2, '<H'),
+ ('SetSyncLowTime', 2, '<H'),
+ ('SetConvertLowTime', 2, '<H'),
+ ('SetSyncHighTime', 2, '<H'),
+ ('SetEOLTime', 2, '<H'),
+ ('SetRampOffsetTime', 2, '<H'),
+ ('FOVStartingValue', 2, '<H'),
+ ('ColumnBinning', 2, '<H'),
+ ('RowBinning', 2, '<H'),
+ ('BorderColumns64', 2, '<H'),
+ ('BorderRows64', 2, '<H'),
+ ('FETOffRows64', 2, '<H'),
+ ('FOVStartColumn128', 2, '<H'),
+ ('FOVStartRow128', 2, '<H'),
+ ('NumberOfColumns128', 2, '<H'),
+ ('NumberOfRows128', 2, '<H'),
+ ('VFPAquisition', 2000, None),
+ ('Comment', 200, None)
+ ]
+
+
+class GeImage(FabioImage):
+
+ DESCRIPTION = "GE a-Si Angio detector file format"
+
+ DEFAULT_EXTENTIONS = []
+
+ _need_a_seek_to_read = True
+
+ def _readheader(self, infile):
+ """Read a GE image header"""
+
+ infile.seek(0)
+
+ self.header = self.check_header()
+ for name, nbytes, fmt in GE_HEADER_INFO:
+ if fmt is None:
+ self.header[name] = infile.read(nbytes)
+ else:
+ self.header[name] = struct.unpack(fmt, infile.read(nbytes))[0]
+
+ def read(self, fname, frame=None):
+ """
+ Read in header into self.header and
+ the data into self.data
+ """
+ if frame is None:
+ frame = 0
+ self.header = self.check_header()
+ self.resetvals()
+ infile = self._open(fname, "rb")
+ self.sequencefilename = fname
+ self._readheader(infile)
+ self.nframes = self.header['NumberOfFrames']
+ self._readframe(infile, frame)
+ infile.close()
+ return self
+
+ def _makeframename(self):
+ """ The thing to be printed for the user to represent a frame inside
+ a file """
+ self.filename = "%s$%04d" % (self.sequencefilename, self.currentframe)
+
+ def _readframe(self, filepointer, img_num):
+ """
+ # Load only one image from the sequence
+ # Note: the first image in the sequence 0
+ # raises an exception if you give an invalid image
+ # otherwise fills in self.data
+ """
+ if(img_num > self.nframes or img_num < 0):
+ raise Exception("Bad image number")
+ imgstart = self.header['StandardHeaderSizeInBytes'] + \
+ self.header['UserHeaderSizeInBytes'] + \
+ img_num * self.header['NumberOfRowsInFrame'] * \
+ self.header['NumberOfColsInFrame'] * \
+ self.header['ImageDepthInBits'] // 8
+ # whence = 0 means seek from start of file
+ filepointer.seek(imgstart, 0)
+
+ self.bpp = self.header['ImageDepthInBits'] // 8 # hopefully 2
+ imglength = self.header['NumberOfRowsInFrame'] * \
+ self.header['NumberOfColsInFrame'] * self.bpp
+ if self.bpp != 2:
+ logger.warning("Using uint16 for GE but seems to be wrong, bpp=%s" % self.bpp)
+
+ data = numpy.fromstring(filepointer.read(imglength), numpy.uint16)
+ if not numpy.little_endian:
+ data.byteswap(True)
+ data.shape = (self.header['NumberOfRowsInFrame'],
+ self.header['NumberOfColsInFrame'])
+ self.data = data
+ self.dim2, self.dim1 = self.data.shape
+ self.currentframe = int(img_num)
+ self._makeframename()
+
+ def getframe(self, num):
+ """
+ Returns a frame as a new FabioImage object
+ """
+ if num < 0 or num > self.nframes:
+ raise Exception("Requested frame number is out of range")
+ # Do a deep copy of the header to make a new one
+ newheader = {}
+ for k in self.header.keys():
+ newheader[k] = self.header[k]
+ frame = GeImage(header=newheader)
+ frame.nframes = self.nframes
+ frame.sequencefilename = self.sequencefilename
+ infile = frame._open(self.sequencefilename, "rb")
+ frame._readframe(infile, num)
+ infile.close()
+ return frame
+
+ def next(self):
+ """
+ Get the next image in a series as a fabio image
+ """
+ if self.currentframe < (self.nframes - 1) and self.nframes > 1:
+ return self.getframe(self.currentframe + 1)
+ else:
+ newobj = GeImage()
+ newobj.read(next_filename(
+ self.sequencefilename))
+ return newobj
+
+ def previous(self):
+ """
+ Get the previous image in a series as a fabio image
+ """
+ if self.currentframe > 0:
+ return self.getframe(self.currentframe - 1)
+ else:
+ newobj = GeImage()
+ newobj.read(previous_filename(
+ self.sequencefilename))
+ return newobj
+
+
+def demo():
+ import sys
+ import time
+
+ if len(sys.argv) < 2:
+ print("USAGE: GE_script.py <GEaSi_raw_image_file>")
+ sys.exit()
+
+ image_file = sys.argv[1]
+
+ print("init read_GEaSi_data class and load header..")
+ sequence1 = GeImage()
+ sequence1.read(image_file)
+
+ print("TimeBetweenFramesInMicrosecs = ")
+ print(sequence1.header['TimeBetweenFramesInMicrosecs'])
+ print("AcquisitionTime = ")
+ print(sequence1.header['AcquisitionTime'])
+
+ print("Mean = ", sequence1.data.ravel().mean())
+
+ while 1:
+ start = time.time()
+ sequence1 = sequence1.next()
+ duration = time.time() - start
+ print(sequence1.currentframe, sequence1.data.ravel().mean(), duration)
+
+
+GEimage = GeImage
+
+if __name__ == '__main__':
+ demo()
diff --git a/fabio/HiPiCimage.py b/fabio/HiPiCimage.py
new file mode 100644
index 0000000..e1ac533
--- /dev/null
+++ b/fabio/HiPiCimage.py
@@ -0,0 +1,140 @@
+#!/usr/bin/env python# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE
+
+"""
+Authors: Henning O. Sorensen & Erik Knudsen
+ Center for Fundamental Research: Metal Structures in Four Dimensions
+ Risoe National Laboratory
+ Frederiksborgvej 399
+ DK-4000 Roskilde
+ email:erik.knudsen@risoe.dk
+
+ + Jon Wright, ESRF
+
+Information about the file format from Masakatzu Kobayashi is highly appreciated
+"""
+
+# Get ready for python3:
+from __future__ import with_statement, print_function
+
+import numpy
+import logging
+logger = logging.getLogger(__name__)
+from .fabioimage import FabioImage
+
+
+class HipicImage(FabioImage):
+ """ Read HiPic images e.g. collected with a Hamamatsu CCD camera"""
+
+ DESCRIPTION = "HiPic file format from Hamamatsu CCD cameras"
+
+ DEFAULT_EXTENTIONS = ["img"]
+
+ def _readheader(self, infile):
+ """
+ Read in a header from an already open file
+
+ """
+ Image_tag = infile.read(2)
+ Comment_len = numpy.fromstring(infile.read(2), numpy.uint16)
+ Dim_1 = numpy.fromstring(infile.read(2), numpy.uint16)[0]
+ Dim_2 = numpy.fromstring(infile.read(2), numpy.uint16)[0]
+ Dim_1_offset = numpy.fromstring(infile.read(2), numpy.uint16)[0]
+ Dim_2_offset = numpy.fromstring(infile.read(2), numpy.uint16)[0]
+ _HeaderType = numpy.fromstring(infile.read(2), numpy.uint16)[0]
+ _Dump = infile.read(50)
+ Comment = infile.read(Comment_len)
+ self.header['Image_tag'] = Image_tag
+ self.header['Dim_1'] = Dim_1
+ self.header['Dim_2'] = Dim_2
+ self.header['Dim_1_offset'] = Dim_1_offset
+ self.header['Dim_2_offset'] = Dim_2_offset
+ # self.header['Comment'] = Comment
+ if Image_tag != 'IM':
+ # This does not look like an HiPic file
+ logger.warning("No opening. Corrupt header of HiPic file %s",
+ str(infile.name))
+ Comment_split = Comment[:Comment.find('\x00')].split('\r\n')
+
+ for topcomment in Comment_split:
+ topsplit = topcomment.split(',')
+ for line in topsplit:
+ if '=' in line:
+ key, val = line.split('=', 1)
+ # Users cannot type in significant whitespace
+ key = key.rstrip().lstrip()
+ self.header_keys.append(key)
+ self.header[key] = val.lstrip().rstrip()
+ self.header[key] = val.lstrip('"').rstrip('"')
+
+ def read(self, fname, frame=None):
+ """
+ Read in header into self.header and
+ the data into self.data
+ """
+ self.header = self.check_header()
+ self.resetvals()
+ infile = self._open(fname, "rb")
+ self._readheader(infile)
+ # Compute image size
+ try:
+ self.dim1 = int(self.header['Dim_1'])
+ self.dim2 = int(self.header['Dim_2'])
+ except (ValueError, KeyError):
+ raise IOError("HiPic file %s is corrupted, cannot read it" % str(fname))
+ bytecode = numpy.uint16
+ self.bpp = len(numpy.array(0, bytecode).tostring())
+
+ # Read image data
+ block = infile.read(self.dim1 * self.dim2 * self.bpp)
+ infile.close()
+
+ # now read the data into the array
+ try:
+ self.data = numpy.reshape(
+ numpy.fromstring(block, bytecode),
+ [self.dim2, self.dim1])
+ except:
+ logger.debug("%s %s %s %s %s", len(block), bytecode, self.bpp, self.dim2, self.dim1)
+ raise IOError('Size spec in HiPic-header does not match size of image data field')
+ self.bytecode = self.data.dtype.type
+
+ # Sometimes these files are not saved as 12 bit,
+ # But as 16 bit after bg subtraction - which results
+ # negative values saved as 16bit. Therefore values higher
+ # 4095 is really negative values
+ if self.data.max() > 4095:
+ gt12bit = self.data > 4095
+ self.data = self.data - gt12bit * (2 ** 16 - 1)
+
+ # ensure the PIL image is reset
+ self.pilimage = None
+ return self
+
+
+HiPiCimage = HipicImage
diff --git a/fabio/OXDimage.py b/fabio/OXDimage.py
new file mode 100644
index 0000000..ee22703
--- /dev/null
+++ b/fabio/OXDimage.py
@@ -0,0 +1,570 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE
+
+"""Reads Oxford Diffraction Sapphire 3 images
+
+Authors:
+........
+* Henning O. Sorensen & Erik Knudsen:
+ Center for Fundamental Research: Metal Structures in Four Dimensions;
+ Risoe National Laboratory;
+ Frederiksborgvej 399;
+ DK-4000 Roskilde;
+ email:erik.knudsen@risoe.dk
+* Jon Wright, Jérôme Kieffer & Gaël Goret:
+ European Synchrotron Radiation Facility;
+ Grenoble (France)
+
+"""
+
+# Get ready for python3:
+from __future__ import with_statement, print_function
+
+__contact__ = "Jerome.Kieffer@esrf.fr"
+__license__ = "MIT"
+__copyright__ = "Jérôme Kieffer"
+__date__ = "27/07/2017"
+
+import time
+import logging
+import struct
+logger = logging.getLogger(__name__)
+import numpy
+from .fabioimage import FabioImage
+from .compression import decTY1, compTY1
+from .fabioutils import to_str
+from .utils.mathutils import rad2deg, deg2rad
+
+DETECTOR_TYPES = {0: 'Sapphire/KM4CCD (1x1: 0.06mm, 2x2: 0.12mm)',
+ 1: 'Sapphire2-Kodak (1x1: 0.06mm, 2x2: 0.12mm)',
+ 2: 'Sapphire3-Kodak (1x1: 0.03mm, 2x2: 0.06mm, 4x4: 0.12mm)',
+ 3: 'Onyx-Kodak (1x1: 0.06mm, 2x2: 0.12mm, 4x4: 0.24mm)',
+ 4: 'Unknown Oxford diffraction detector',
+ 7: 'Pilatus 300K-Dectris'}
+
+DEFAULT_HEADERS = {'Header Version': 'OD SAPPHIRE 3.0',
+ 'Compression': "TY1",
+ 'Header Size In Bytes': 5120,
+ "ASCII Section size in Byte": 256,
+ "General Section size in Byte": 512,
+ "Special Section size in Byte": 768,
+ "KM4 Section size in Byte": 1024,
+ "Statistic Section in Byte": 512,
+ "History Section in Byte": 2048,
+ 'NSUPPLEMENT': 0
+ }
+
+
+class OxdImage(FabioImage):
+ """
+ Oxford Diffraction Sapphire 3 images reader/writer class
+
+ Note: We assume the binary format is alway little-endian, is this True ?
+ """
+
+ DESCRIPTION = "Oxford Diffraction Sapphire 3 file format"
+
+ DEFAULT_EXTENTIONS = ["img"]
+
+ def _readheader(self, infile):
+
+ infile.seek(0)
+
+ # Ascii header part 256 byes long
+ self.header['Header Version'] = to_str(infile.readline()[:-2])
+ block = infile.readline()
+ self.header['Compression'] = to_str(block[12:15])
+ block = infile.readline()
+ self.header['NX'] = int(block[3:7])
+ self.header['NY'] = int(block[11:15])
+ self.header['OI'] = int(block[19:26])
+ self.header['OL'] = int(block[30:37])
+ block = infile.readline()
+ self.header['Header Size In Bytes'] = int(block[8:15])
+ self.header['General Section size in Byte'] = int(block[19:26])
+ self.header['Special Section size in Byte'] = int(block[30:37])
+ self.header['KM4 Section size in Byte'] = int(block[41:48])
+ self.header['Statistic Section in Byte'] = int(block[52:59])
+ self.header['History Section in Byte'] = int(block[63:])
+ block = infile.readline()
+ self.header['NSUPPLEMENT'] = int(block[12:19])
+ block = infile.readline()
+ self.header['Time'] = to_str(block[5:29])
+
+ header_version = float(self.header['Header Version'].split()[2])
+ if header_version < 4.0:
+ # for all our test files with header version 3.0
+ # ascii_section_size == 256
+ # but that's a legacy code
+ ascii_section_size = self.header['Header Size In Bytes'] - (
+ self.header['General Section size in Byte'] +
+ self.header['Special Section size in Byte'] +
+ self.header['KM4 Section size in Byte'] +
+ self.header['Statistic Section in Byte'] +
+ self.header['History Section in Byte'])
+ else:
+ ascii_section_size = DEFAULT_HEADERS["ASCII Section size in Byte"]
+ self.header["ASCII Section size in Byte"] = ascii_section_size
+
+ # Skip to general section (NG) 512 byes long <<<<<<"
+ infile.seek(self.header["ASCII Section size in Byte"])
+ block = infile.read(self.header['General Section size in Byte'])
+ self.header['Binning in x'] = struct.unpack("<H", block[0:2])[0]
+ self.header['Binning in y'] = struct.unpack("<H", block[2:4])[0]
+ self.header['Detector size x'] = struct.unpack("<H", block[22:24])[0]
+ self.header['Detector size y'] = struct.unpack("<H", block[24:26])[0]
+ self.header['Pixels in x'] = struct.unpack("<H", block[26:28])[0]
+ self.header['Pixels in y'] = struct.unpack("<H", block[28:30])[0]
+ self.header['No of pixels'] = struct.unpack("<I", block[36:40])[0]
+
+ # Speciel section (NS) 768 bytes long
+ block = infile.read(self.header['Special Section size in Byte'])
+ self.header['Gain'] = struct.unpack("<d", block[56:64])[0]
+ self.header['Overflows flag'] = struct.unpack("<h", block[464:466])[0]
+ self.header['Overflow after remeasure flag'] = struct.unpack("<h", block[466:468])[0]
+ self.header['Overflow threshold'] = struct.unpack("<i", block[472:476])[0]
+ self.header['Exposure time in sec'] = struct.unpack("<d", block[480:488])[0]
+ self.header['Overflow time in sec'] = struct.unpack("<d", block[488:496])[0]
+ self.header['Monitor counts of raw image 1'] = struct.unpack("<i", block[528:532])[0]
+ self.header['Monitor counts of raw image 2'] = struct.unpack("<i", block[532:536])[0]
+ self.header['Monitor counts of overflow raw image 1'] = struct.unpack("<i", block[536:540])[0]
+ self.header['Monitor counts of overflow raw image 2'] = struct.unpack("<i", block[540:544])[0]
+ self.header['Unwarping'] = struct.unpack("<i", block[544:548])[0]
+ self.header['Detector type'] = DETECTOR_TYPES[struct.unpack("<i", block[548:552])[0]]
+ self.header['Real pixel size x (mm)'] = struct.unpack("<d", block[568:576])[0]
+ self.header['Real pixel size y (mm)'] = struct.unpack("<d", block[576:584])[0]
+
+ # KM4 goniometer section (NK) 1024 bytes long
+ block = infile.read(self.header['KM4 Section size in Byte'])
+ # Spatial correction file
+ self.header['Spatial correction file'] = to_str(block[26:272].strip(b"\x00"))
+ self.header['Spatial correction file date'] = to_str(block[0:26].strip(b"\x00"))
+ # Angles are in steps due to stepper motors - conversion factor RAD
+ # angle[0] = omega, angle[1] = theta, angle[2] = kappa, angle[3] = phi,
+ start_angles_step = numpy.fromstring(block[284:304], numpy.int32)
+ end_angles_step = numpy.fromstring(block[324:344], numpy.int32)
+ step2rad = numpy.fromstring(block[368:408], numpy.float)
+ zero_correction_soft_step = numpy.fromstring(block[512:532], numpy.int32)
+ if not numpy.little_endian:
+ start_angles_step.byteswap(True)
+ end_angles_step.byteswap(True)
+ step2rad.byteswap(True)
+ zero_correction_soft_step.byteswap(True)
+ step_angles_deg = rad2deg(step2rad)
+ # calc angles
+ start_angles_deg = start_angles_step * step_angles_deg
+ end_angles_deg = end_angles_step * step_angles_deg
+ self.header['Omega start in deg'] = start_angles_deg[0]
+ self.header['Theta start in deg'] = start_angles_deg[1]
+ self.header['Kappa start in deg'] = start_angles_deg[2]
+ self.header['Phi start in deg'] = start_angles_deg[3]
+ self.header['Omega end in deg'] = end_angles_deg[0]
+ self.header['Theta end in deg'] = end_angles_deg[1]
+ self.header['Kappa end in deg'] = end_angles_deg[2]
+ self.header['Phi end in deg'] = end_angles_deg[3]
+ self.header['Omega step in deg'] = step_angles_deg[0]
+ self.header['Theta step in deg'] = step_angles_deg[1]
+ self.header['Kappa step in deg'] = step_angles_deg[2]
+ self.header['Phi step in deg'] = step_angles_deg[3]
+
+ zero_correction_soft_deg = zero_correction_soft_step * step_angles_deg
+ self.header['Omega zero corr. in deg'] = zero_correction_soft_deg[0]
+ self.header['Theta zero corr. in deg'] = zero_correction_soft_deg[1]
+ self.header['Kappa zero corr. in deg'] = zero_correction_soft_deg[2]
+ self.header['Phi zero corr. in deg'] = zero_correction_soft_deg[3]
+ # Beam rotation about e2,e3
+ self.header['Beam rot in deg (e2)'] = struct.unpack("<d", block[552:560])[0]
+ self.header['Beam rot in deg (e3)'] = struct.unpack("<d", block[560:568])[0]
+ # Wavelenghts alpha1, alpha2, beta
+ self.header['Wavelength alpha1'] = struct.unpack("<d", block[568:576])[0]
+ self.header['Wavelength alpha2'] = struct.unpack("<d", block[576:584])[0]
+ self.header['Wavelength alpha'] = struct.unpack("<d", block[584:592])[0]
+ self.header['Wavelength beta'] = struct.unpack("<d", block[592:600])[0]
+
+ # Detector tilts around e1,e2,e3 in deg
+ self.header['Detector tilt e1 in deg'] = struct.unpack("<d", block[640:648])[0]
+ self.header['Detector tilt e2 in deg'] = struct.unpack("<d", block[648:656])[0]
+ self.header['Detector tilt e3 in deg'] = struct.unpack("<d", block[656:664])[0]
+
+ # Beam center
+ self.header['Beam center x'] = struct.unpack("<d", block[664:672])[0]
+ self.header['Beam center y'] = struct.unpack("<d", block[672:680])[0]
+ # Angle (alpha) between kappa rotation axis and e3 (ideally 50 deg)
+ self.header['Alpha angle in deg'] = struct.unpack("<d", block[680:688])[0]
+ # Angle (beta) between phi rotation axis and e3 (ideally 0 deg)
+ self.header['Beta angle in deg'] = struct.unpack("<d", block[688:696])[0]
+
+ # Detector distance
+ self.header['Distance in mm'] = struct.unpack("<d", block[712:720])[0]
+ # Statistics section (NS) 512 bytes long
+ block = infile.read(self.header['Statistic Section in Byte'])
+ self.header['Stat: Min '] = struct.unpack("<i", block[0:4])[0]
+ self.header['Stat: Max '] = struct.unpack("<i", block[4:8])[0]
+ self.header['Stat: Average '] = struct.unpack("<d", block[24:32])[0]
+ self.header['Stat: Stddev '] = numpy.sqrt(struct.unpack("<d", block[32:40])[0])
+ self.header['Stat: Skewness '] = struct.unpack("<d", block[40:48])[0]
+
+ # History section (NH) 2048 bytes long
+ block = infile.read(self.header['History Section in Byte'])
+ self.header['Flood field image'] = to_str(block[99:126].strip(b"\x00"))
+
+ def read(self, fname, frame=None):
+ """
+ Read in header into self.header and
+ the data into self.data
+ """
+ self.header = self.check_header()
+ self.resetvals()
+ with self._open(fname) as infile:
+ self._readheader(infile)
+
+ infile.seek(self.header['Header Size In Bytes'])
+
+ # Compute image size
+ try:
+ self.dim1 = int(self.header['NX'])
+ self.dim2 = int(self.header['NY'])
+ except (ValueError, KeyError):
+ raise IOError("Oxford file %s is corrupted, cannot read it" % str(fname))
+
+ if self.header['Compression'] == 'TY1':
+ logger.debug("Compressed with the KM4CCD compression")
+ raw8 = infile.read(self.dim1 * self.dim2)
+ raw16 = None
+ raw32 = None
+ if self.header['OI'] > 0:
+ raw16 = infile.read(self.header['OI'] * 2)
+ if self.header['OL'] > 0:
+ raw32 = infile.read(self.header['OL'] * 4)
+
+ # endianess is handled at the decompression level
+ raw_data = decTY1(raw8, raw16, raw32)
+ bytecode = raw_data.dtype
+ elif self.header['Compression'] == 'TY5':
+ logger.info("Compressed with the TY5 compression")
+ bytecode = numpy.int8
+ self.bpp = 1
+ raw8 = infile.read(self.dim1 * self.dim2)
+ raw_data = numpy.fromstring(raw8, bytecode)
+
+ if self.header['OI'] > 0:
+ self.raw16 = infile.read(self.header['OI'] * 2)
+ else:
+ self.raw16 = b""
+ if self.header['OL'] > 0:
+ self.raw32 = infile.read(self.header['OL'] * 4)
+ else:
+ self.raw32 = b""
+ self.rest = infile.read()
+ self.blob = raw8 + self.raw16 + self.raw32 + self.rest
+ raw_data = self.dec_TY5(raw8 + self.raw16 + self.raw32)
+ else:
+ bytecode = numpy.int32
+ self.bpp = len(numpy.array(0, bytecode).tostring())
+ nbytes = self.dim1 * self.dim2 * self.bpp
+ raw_data = numpy.fromstring(infile.read(nbytes), bytecode)
+ # Always assume little-endian on the disk
+ if not numpy.little_endian:
+ raw_data.byteswap(True)
+ # infile.close()
+
+ logger.debug('OVER_SHORT2: %s', raw_data.dtype)
+ logger.debug("%s" % (raw_data < 0).sum())
+ logger.debug("BYTECODE: %s", bytecode)
+ self.data = raw_data.reshape((self.dim2, self.dim1))
+ self.bytecode = self.data.dtype.type
+ self.pilimage = None
+ return self
+
+ def _writeheader(self):
+ """
+ :return: a string containing the header for Oxford images
+ """
+ linesep = "\r\n"
+ for key in DEFAULT_HEADERS:
+ if key not in self.header:
+ self.header[key] = DEFAULT_HEADERS[key]
+
+ if "NX" not in self.header.keys() or "NY" not in self.header.keys():
+ self.header['NX'] = self.dim1
+ self.header['NY'] = self.dim2
+ ascii_headers = [self.header['Header Version'],
+ "COMPRESSION=%s (%5.1f)" % (self.header["Compression"], self.getCompressionRatio()),
+ "NX=%4i NY=%4i OI=%7i OL=%7i " % (self.header["NX"], self.header["NY"], self.header["OI"], self.header["OL"]),
+ "NHEADER=%7i NG=%7i NS=%7i NK=%7i NS=%7i NH=%7i" % (self.header['Header Size In Bytes'],
+ self.header['General Section size in Byte'],
+ self.header['Special Section size in Byte'],
+ self.header['KM4 Section size in Byte'],
+ self.header['Statistic Section in Byte'],
+ self.header['History Section in Byte']),
+ "NSUPPLEMENT=%7i" % (self.header["NSUPPLEMENT"])]
+ if "Time" in self.header:
+ ascii_headers.append("TIME=%s" % self.header["Time"])
+ else:
+
+ ascii_headers.append("TIME=%s" % time.ctime())
+
+ header = (linesep.join(ascii_headers)).ljust(256).encode("ASCII")
+
+ NG = Section(self.header['General Section size in Byte'], self.header)
+ NG.setData('Binning in x', 0, numpy.uint16)
+ NG.setData('Binning in y', 2, numpy.uint16)
+ NG.setData('Detector size x', 22, numpy.uint16)
+ NG.setData('Detector size y', 24, numpy.uint16)
+ NG.setData('Pixels in x', 26, numpy.uint16)
+ NG.setData('Pixels in y', 28, numpy.uint16)
+ NG.setData('No of pixels', 36, numpy.uint32)
+ header += NG.__repr__()
+
+ NS = Section(self.header['Special Section size in Byte'], self.header)
+ NS.setData('Gain', 56, numpy.float)
+ NS.setData('Overflows flag', 464, numpy.int16)
+ NS.setData('Overflow after remeasure flag', 466, numpy.int16)
+ NS.setData('Overflow threshold', 472, numpy.int32)
+ NS.setData('Exposure time in sec', 480, numpy.float)
+ NS.setData('Overflow time in sec', 488, numpy.float)
+ NS.setData('Monitor counts of raw image 1', 528, numpy.int32)
+ NS.setData('Monitor counts of raw image 2', 532, numpy.int32)
+ NS.setData('Monitor counts of overflow raw image 1', 536, numpy.int32)
+ NS.setData('Monitor counts of overflow raw image 2', 540, numpy.int32)
+ NS.setData('Unwarping', 544, numpy.int32)
+ if 'Detector type' in self.header:
+ for key, value in DETECTOR_TYPES.items():
+ if value == self.header['Detector type']:
+ NS.setData(None, 548, numpy.int32, default=key)
+ NS.setData('Real pixel size x (mm)', 568, numpy.float)
+ NS.setData('Real pixel size y (mm)', 576, numpy.float)
+ header += NS.__repr__()
+
+ KM = Section(self.header['KM4 Section size in Byte'], self.header)
+ KM.setData('Spatial correction file date', 0, "|S26")
+ KM.setData('Spatial correction file', 26, "|S246")
+ # Angles are in steps due to stepper motors - conversion factor RAD
+ # angle[0] = omega, angle[1] = theta, angle[2] = kappa, angle[3] = phi,
+ if self.header.get('Omega step in deg', None):
+ KM.setData(None, 368, numpy.float64, deg2rad(self.header["Omega step in deg"]))
+ if self.header.get('Omega start in deg', None):
+ KM.setData(None, 284, numpy.int32, self.header["Omega start in deg"] / self.header["Omega step in deg"])
+ if self.header.get('Omega end in deg', None):
+ KM.setData(None, 324, numpy.int32, self.header["Omega end in deg"] / self.header["Omega step in deg"])
+ if self.header.get('Omega zero corr. in deg', None):
+ KM.setData(None, 512, numpy.int32, self.header['Omega zero corr. in deg'] / self.header["Omega step in deg"])
+
+ if self.header.get('Theta step in deg', None):
+ KM.setData(None, 368 + 8, numpy.float64, deg2rad(self.header["Theta step in deg"]))
+ if self.header.get('Theta start in deg', None):
+ KM.setData(None, 284 + 4, numpy.int32, self.header["Theta start in deg"] / self.header["Theta step in deg"])
+ if self.header.get('Theta end in deg', None):
+ KM.setData(None, 324 + 4, numpy.int32, self.header["Theta end in deg"] / self.header["Theta step in deg"])
+ if self.header.get('Theta zero corr. in deg', None):
+ KM.setData(None, 512 + 4, numpy.int32, self.header['Theta zero corr. in deg'] / self.header["Theta step in deg"])
+
+ if self.header.get('Kappa step in deg', None):
+ KM.setData(None, 368 + 16, numpy.float64, deg2rad(self.header["Kappa step in deg"]))
+ if self.header.get('Kappa start in deg', None):
+ KM.setData(None, 284 + 8, numpy.int32, self.header["Kappa start in deg"] / self.header["Kappa step in deg"])
+ if self.header.get('Kappa end in deg', None):
+ KM.setData(None, 324 + 8, numpy.int32, self.header["Kappa end in deg"] / self.header["Kappa step in deg"])
+ if self.header.get('Kappa zero corr. in deg', None):
+ KM.setData(None, 512 + 8, numpy.int32, self.header['Kappa zero corr. in deg'] / self.header["Kappa step in deg"])
+
+ if self.header.get('Phi step in deg', None):
+ KM.setData(None, 368 + 24, numpy.float64, deg2rad(self.header["Phi step in deg"]))
+ if self.header.get('Phi start in deg', None):
+ KM.setData(None, 284 + 12, numpy.int32, self.header["Phi start in deg"] / self.header["Phi step in deg"])
+ if self.header.get('Phi end in deg', None):
+ KM.setData(None, 324 + 12, numpy.int32, self.header["Phi end in deg"] / self.header["Phi step in deg"])
+ if self.header.get('Phi zero corr. in deg', None):
+ KM.setData(None, 512 + 12, numpy.int32, self.header['Phi zero corr. in deg'] / self.header["Phi step in deg"])
+
+ # Beam rotation about e2,e3
+ KM.setData('Beam rot in deg (e2)', 552, numpy.float64)
+ KM.setData('Beam rot in deg (e3)', 560, numpy.float64)
+ # Wavelenghts alpha1, alpha2, beta
+ KM.setData('Wavelength alpha1', 568, numpy.float64)
+ KM.setData('Wavelength alpha2', 576, numpy.float64)
+ KM.setData('Wavelength alpha', 584, numpy.float64)
+ KM.setData('Wavelength beta', 592, numpy.float64)
+
+ # Detector tilts around e1,e2,e3 in deg
+ KM.setData('Detector tilt e1 in deg', 640, numpy.float64)
+ KM.setData('Detector tilt e2 in deg', 648, numpy.float64)
+ KM.setData('Detector tilt e3 in deg', 656, numpy.float64)
+
+ # Beam center
+ KM.setData('Beam center x', 664, numpy.float64)
+ KM.setData('Beam center y', 672, numpy.float64)
+ # Angle (alpha) between kappa rotation axis and e3 (ideally 50 deg)
+ KM.setData('Alpha angle in deg', 680, numpy.float64)
+ # Angle (beta) between phi rotation axis and e3 (ideally 0 deg)
+ KM.setData('Beta angle in deg', 688, numpy.float64)
+
+ # Detector distance
+ KM.setData('Distance in mm', 712, numpy.float64)
+ header += KM.__repr__()
+
+ SS = Section(self.header['Statistic Section in Byte'], self.header)
+ SS.setData('Stat: Min ', 0, numpy.int32)
+ SS.setData('Stat: Max ', 4, numpy.int32)
+ SS.setData('Stat: Average ', 24, numpy.float64)
+ if self.header.get('Stat: Stddev ', None):
+ SS.setData(None, 32, numpy.float64, self.header['Stat: Stddev '] ** 2)
+ SS.setData('Stat: Skewness ', 40, numpy.float64)
+ header += SS.__repr__()
+
+ HS = Section(self.header['History Section in Byte'], self.header)
+ HS.setData('Flood field image', 99, "|S27")
+ header += HS.__repr__()
+
+ return header
+
+ def write(self, fname):
+ """Write Oxford diffraction images: this is still beta
+ Only TY1 compressed images is currently possible
+ :param fname: output filename
+ """
+ if self.header.get("Compression") != "TY1":
+ logger.warning("Enforce TY1 compression")
+ self.header["Compression"] = "TY1"
+
+ datablock8, datablock16, datablock32 = compTY1(self.data)
+ self.header["OI"] = len(datablock16) / 2
+ self.header["OL"] = len(datablock32) / 4
+ with self._open(fname, mode="wb") as outfile:
+ outfile.write(self._writeheader())
+ outfile.write(datablock8)
+ outfile.write(datablock16)
+ outfile.write(datablock32)
+
+ def getCompressionRatio(self):
+ "calculate the compression factor obtained vs raw data"
+ return 100.0 * (self.data.size + 2 * self.header["OI"] + 4 * self.header["OL"]) / (self.data.size * 4)
+
+ @staticmethod
+ def checkData(data=None):
+ if data is None:
+ return None
+ else:
+ return data.astype(int)
+
+ def dec_TY5(self, stream):
+ """
+ Attempt to decode TY5 compression scheme
+
+ :param stream: input stream
+ :return: 1D array with data
+ """
+ logger.info("TY5 decompression is slow for now")
+ array_size = self.dim1 * self.dim2
+ stream_size = len(stream)
+ data = numpy.zeros(array_size)
+ raw = numpy.fromstring(stream, dtype="uint8")
+ pos_inp = pos_out = current = ex1 = ex2 = 0
+
+ while pos_inp < stream_size and pos_out < array_size:
+ if pos_out % self.dim2 == 0:
+ last = 0
+ else:
+ last = current
+ value = raw[pos_inp]
+ if value < 254:
+ # this is the normal case
+ # 1 bytes encode one pixel
+ current = last + value - 127
+ pos_inp += 1
+ elif value == 254:
+ ex1 += 1
+ # this is the special case 1:
+ # if the marker 254 is found the next 2 bytes encode one pixel
+ value = raw[pos_inp + 1:pos_inp + 3].view("int16")
+ if not numpy.little_endian:
+ value = value.byteswap(True)
+ current = last + value[0]
+ pos_inp += 3
+
+ elif value == 255:
+ # this is the special case 2:
+ # if the marker 255 is found the next 4 bytes encode one pixel
+ ex2 += 1
+ logger.info('special case 32 bits.')
+ value = raw[pos_inp + 1:pos_inp + 5].view("int32")
+ if not numpy.little_endian:
+ value = value.byteswap(True)
+ current = last + value[0]
+ pos_inp += 5
+ data[pos_out] = current
+ pos_out += 1
+
+ logger.info("TY5: Exception: 16bits: %s, 32bits: %s", ex1, ex2)
+ return data
+
+
+OXDimage = OxdImage
+
+
+class Section(object):
+ """
+ Small helper class for writing binary headers
+ """
+ def __init__(self, size, dictHeader):
+ """
+ :param size: size of the header section in bytes
+ :param dictHeader: headers of the image
+ """
+ self.size = size
+ self.header = dictHeader
+ self.lstChr = bytearray(size)
+ self._dictSize = {}
+
+ def __repr__(self):
+ return bytes(self.lstChr)
+
+ def getSize(self, dtype):
+ if dtype not in self._dictSize:
+ self._dictSize[dtype] = len(numpy.zeros(1, dtype=dtype).tostring())
+ return self._dictSize[dtype]
+
+ def setData(self, key, offset, dtype, default=None):
+ """
+ :param offset: int, starting position in the section
+ :param key: name of the header key
+ :param dtype: type of the data to insert (defines the size!)
+ """
+ if key in self.header:
+ value = self.header[key]
+ elif key in DEFAULT_HEADERS:
+ value = DEFAULT_HEADERS[key]
+ else:
+ value = default
+ if value is None:
+ value = b"\x00" * self.getSize(dtype)
+ elif numpy.little_endian:
+ value = numpy.array(value).astype(dtype).tostring()
+ else:
+ value = numpy.array(value).astype(dtype).byteswap().tostring()
+ self.lstChr[offset:offset + self.getSize(dtype)] = value
diff --git a/fabio/TiffIO.py b/fabio/TiffIO.py
new file mode 100644
index 0000000..11032e7
--- /dev/null
+++ b/fabio/TiffIO.py
@@ -0,0 +1,1247 @@
+# The PyMca X-Ray Fluorescence Toolkit
+#
+# Copyright (c) 2004-2015 European Synchrotron Radiation Facility
+#
+# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
+# the ESRF by the Software group.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+__author__ = "V.A. Sole - ESRF Data Analysis"
+__contact__ = "sole@esrf.fr"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "25/07/2017"
+
+import sys
+import os
+import struct
+import numpy
+import logging
+
+ALLOW_MULTIPLE_STRIPS = False
+
+TAG_ID = {256: "NumberOfColumns", # S or L ImageWidth
+ 257: "NumberOfRows", # S or L ImageHeight
+ 258: "BitsPerSample", # S Number of bits per component
+ 259: "Compression", # SHORT (1 - NoCompression, ...
+ 262: "PhotometricInterpretation", # SHORT (0 - WhiteIsZero, 1 -BlackIsZero, 2 - RGB, 3 - Palette color
+ 270: "ImageDescription", # ASCII
+ 273: "StripOffsets", # S or L, for each strip, the byte offset of the strip
+ 277: "SamplesPerPixel", # SHORT (>=3) only for RGB images
+ 278: "RowsPerStrip", # S or L, number of rows in each back may be not for the last
+ 279: "StripByteCounts", # S or L, The number of bytes in the strip AFTER any compression
+ 305: "Software", # ASCII
+ 306: "Date", # ASCII
+ 320: "Colormap", # Colormap of Palette-color Images
+ 339: "SampleFormat", # SHORT Interpretation of data in each pixel
+ }
+
+# TILES ARE TO BE SUPPORTED TOO ...
+TAG_NUMBER_OF_COLUMNS = 256
+TAG_NUMBER_OF_ROWS = 257
+TAG_BITS_PER_SAMPLE = 258
+TAG_PHOTOMETRIC_INTERPRETATION = 262
+TAG_COMPRESSION = 259
+TAG_IMAGE_DESCRIPTION = 270
+TAG_STRIP_OFFSETS = 273
+TAG_SAMPLES_PER_PIXEL = 277
+TAG_ROWS_PER_STRIP = 278
+TAG_STRIP_BYTE_COUNTS = 279
+TAG_SOFTWARE = 305
+TAG_DATE = 306
+TAG_COLORMAP = 320
+TAG_SAMPLE_FORMAT = 339
+
+FIELD_TYPE = {1: ('BYTE', "B"),
+ 2: ('ASCII', "s"), # string ending with binary zero
+ 3: ('SHORT', "H"),
+ 4: ('LONG', "I"),
+ 5: ('RATIONAL', "II"),
+ 6: ('SBYTE', "b"),
+ 7: ('UNDEFINED', "B"),
+ 8: ('SSHORT', "h"),
+ 9: ('SLONG', "i"),
+ 10: ('SRATIONAL', "ii"),
+ 11: ('FLOAT', "f"),
+ 12: ('DOUBLE', "d")}
+
+FIELD_TYPE_OUT = {'B': 1,
+ 's': 2,
+ 'H': 3,
+ 'I': 4,
+ 'II': 5,
+ 'b': 6,
+ 'h': 8,
+ 'i': 9,
+ 'ii': 10,
+ 'f': 11,
+ 'd': 12}
+
+# sample formats (http://www.awaresystems.be/imaging/tiff/tiffflags/sampleformat.html)
+SAMPLE_FORMAT_UINT = 1
+SAMPLE_FORMAT_INT = 2
+SAMPLE_FORMAT_FLOAT = 3 # floating point
+SAMPLE_FORMAT_VOID = 4 # undefined data, usually assumed UINT
+SAMPLE_FORMAT_COMPLEXINT = 5
+SAMPLE_FORMAT_COMPLEXIEEEFP = 6
+
+
+logger = logging.getLogger(__name__)
+
+
+class TiffIO(object):
+ def __init__(self, filename, mode=None, cache_length=20, mono_output=False):
+ if mode is None:
+ mode = 'rb'
+ if 'b' not in mode:
+ mode = mode + 'b'
+ if 'a' in mode.lower():
+ raise IOError("Mode %s makes no sense on TIFF files. Consider 'rb+'" % mode)
+ if ('w' in mode):
+ if '+' not in mode:
+ mode += '+'
+
+ if hasattr(filename, "seek") and\
+ hasattr(filename, "read"):
+ fd = filename
+ self._access = None
+ else:
+ # the b is needed for windows and python 3
+ fd = open(filename, mode)
+ self._access = mode
+
+ self._initInternalVariables(fd)
+ self._maxImageCacheLength = cache_length
+ self._forceMonoOutput = mono_output
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *arg):
+ # TODO: inspace type, value and traceback
+ self.close()
+
+ def _initInternalVariables(self, fd=None):
+ if fd is None:
+ fd = self.fd
+ else:
+ self.fd = fd
+ # read the order
+ fd.seek(0)
+ order = fd.read(2).decode()
+ if len(order):
+ if order == "II":
+ # intel, little endian
+ fileOrder = "little"
+ self._structChar = '<'
+ elif order == "MM":
+ # motorola, high endian
+ fileOrder = "big"
+ self._structChar = '>'
+ else:
+ raise IOError("File is not a Mar CCD file, nor a TIFF file")
+ a = fd.read(2)
+ fortyTwo = struct.unpack(self._structChar + "H", a)[0]
+ if fortyTwo != 42:
+ raise IOError("Invalid TIFF version %d" % fortyTwo)
+ else:
+ logger.debug("VALID TIFF VERSION")
+ if sys.byteorder != fileOrder:
+ swap = True
+ else:
+ swap = False
+ else:
+ if sys.byteorder == "little":
+ self._structChar = '<'
+ else:
+ self._structChar = '>'
+ swap = False
+ self._swap = swap
+ self._IFD = []
+ self._imageDataCacheIndex = []
+ self._imageDataCache = []
+ self._imageInfoCacheIndex = []
+ self._imageInfoCache = []
+ self.getImageFileDirectories(fd)
+
+ def __makeSureFileIsOpen(self):
+ if not self.fd.closed:
+ return
+ logger.debug("Reopening closed file")
+ fileName = self.fd.name
+ if self._access is None:
+ # we do not own the file
+ # open in read mode
+ newFile = open(fileName, 'rb')
+ else:
+ newFile = open(fileName, self._access)
+ self.fd = newFile
+
+ def __makeSureFileIsClosed(self):
+ if self._access is None:
+ # we do not own the file
+ logger.debug("Not closing not owned file")
+ return
+
+ if not self.fd.closed:
+ self.fd.close()
+
+ def close(self):
+ return self.__makeSureFileIsClosed()
+
+ def getNumberOfImages(self):
+ # update for the case someone has done anything?
+ self._updateIFD()
+ return len(self._IFD)
+
+ def _updateIFD(self):
+ self.__makeSureFileIsOpen()
+ self.getImageFileDirectories()
+ self.__makeSureFileIsClosed()
+
+ def getImageFileDirectories(self, fd=None):
+ if fd is None:
+ fd = self.fd
+ else:
+ self.fd = fd
+ st = self._structChar
+ fd.seek(4)
+ self._IFD = []
+ nImages = 0
+ fmt = st + 'I'
+ inStr = fd.read(struct.calcsize(fmt))
+ if not len(inStr):
+ offsetToIFD = 0
+ else:
+ offsetToIFD = struct.unpack(fmt, inStr)[0]
+ logger.debug("Offset to first IFD = %d", offsetToIFD)
+ while offsetToIFD != 0:
+ self._IFD.append(offsetToIFD)
+ nImages += 1
+ fd.seek(offsetToIFD)
+ fmt = st + 'H'
+ numberOfDirectoryEntries = struct.unpack(fmt, fd.read(struct.calcsize(fmt)))[0]
+ logger.debug("Number of directory entries = %d", numberOfDirectoryEntries)
+
+ fmt = st + 'I'
+ fd.seek(offsetToIFD + 2 + 12 * numberOfDirectoryEntries)
+ offsetToIFD = struct.unpack(fmt, fd.read(struct.calcsize(fmt)))[0]
+ logger.debug("Next Offset to IFD = %d", offsetToIFD)
+ # offsetToIFD = 0
+ logger.debug("Number of images found = %d", nImages)
+ return nImages
+
+ def _parseImageFileDirectory(self, nImage):
+ offsetToIFD = self._IFD[nImage]
+ st = self._structChar
+ fd = self.fd
+ fd.seek(offsetToIFD)
+ fmt = st + 'H'
+ numberOfDirectoryEntries = struct.unpack(fmt, fd.read(struct.calcsize(fmt)))[0]
+ logger.debug("Number of directory entries = %d", numberOfDirectoryEntries)
+
+ fmt = st + 'HHI4s'
+ tagIDList = []
+ fieldTypeList = []
+ nValuesList = []
+ valueOffsetList = []
+ for _ in range(numberOfDirectoryEntries):
+ tagID, fieldType, nValues, valueOffset = struct.unpack(fmt, fd.read(12))
+ tagIDList.append(tagID)
+ fieldTypeList.append(fieldType)
+ nValuesList.append(nValues)
+ if nValues == 1:
+ ftype, vfmt = FIELD_TYPE[fieldType]
+ if ftype not in ['ASCII', 'RATIONAL', 'SRATIONAL']:
+ vfmt = st + vfmt
+ data = valueOffset[0: struct.calcsize(vfmt)]
+ if struct.calcsize(vfmt) > len(data):
+ # Add a 0 padding to have the expected size
+ logger.warning("Data at tag id '%s' is smaller than expected", tagID)
+ data = data + b"\x00" * (struct.calcsize(vfmt) - len(data))
+ actualValue = struct.unpack(vfmt, data)[0]
+ valueOffsetList.append(actualValue)
+ else:
+ valueOffsetList.append(valueOffset)
+ elif (nValues < 5) and (fieldType == 2):
+ ftype, vfmt = FIELD_TYPE[fieldType]
+ vfmt = st + "%d%s" % (nValues, vfmt)
+ actualValue = struct.unpack(vfmt, valueOffset[0: struct.calcsize(vfmt)])[0]
+ valueOffsetList.append(actualValue)
+ else:
+ valueOffsetList.append(valueOffset)
+ if logger.getEffectiveLevel() == logging.DEBUG:
+ if tagID in TAG_ID:
+ logger.debug("tagID = %s", TAG_ID[tagID])
+ else:
+ logger.debug("tagID = %d", tagID)
+ logger.debug("fieldType = %s", FIELD_TYPE[fieldType][0])
+ logger.debug("nValues = %d", nValues)
+ # if nValues == 1:
+ # logger.debug("valueOffset = %s", valueOffset)
+ return tagIDList, fieldTypeList, nValuesList, valueOffsetList
+
+ def _readIFDEntry(self, tag, tagIDList, fieldTypeList, nValuesList, valueOffsetList):
+ fd = self.fd
+ st = self._structChar
+ idx = tagIDList.index(tag)
+ nValues = nValuesList[idx]
+ output = []
+ _ftype, vfmt = FIELD_TYPE[fieldTypeList[idx]]
+ vfmt = st + "%d%s" % (nValues, vfmt)
+ requestedBytes = struct.calcsize(vfmt)
+ if nValues == 1:
+ output.append(valueOffsetList[idx])
+ elif requestedBytes < 5:
+ output.append(valueOffsetList[idx])
+ else:
+ fd.seek(struct.unpack(st + "I", valueOffsetList[idx])[0])
+ output = struct.unpack(vfmt, fd.read(requestedBytes))
+ return output
+
+ def getData(self, nImage, **kw):
+ if nImage >= len(self._IFD):
+ # update prior to raise an index error error
+ self._updateIFD()
+ return self._readImage(nImage, **kw)
+
+ def getImage(self, nImage):
+ return self.getData(nImage)
+
+ def getInfo(self, nImage, **kw):
+ if nImage >= len(self._IFD):
+ # update prior to raise an index error error
+ self._updateIFD()
+ # current = self._IFD[nImage]
+ return self._readInfo(nImage)
+
+ def _readInfo(self, nImage, close=True):
+ if nImage in self._imageInfoCacheIndex:
+ logger.debug("Reading info from cache")
+ return self._imageInfoCache[self._imageInfoCacheIndex.index(nImage)]
+
+ # read the header
+ self.__makeSureFileIsOpen()
+ tagIDList, fieldTypeList, nValuesList, valueOffsetList = self._parseImageFileDirectory(nImage)
+
+ # rows and columns
+ nColumns = valueOffsetList[tagIDList.index(TAG_NUMBER_OF_COLUMNS)]
+ nRows = valueOffsetList[tagIDList.index(TAG_NUMBER_OF_ROWS)]
+
+ # bits per sample
+ idx = tagIDList.index(TAG_BITS_PER_SAMPLE)
+ nBits = valueOffsetList[idx]
+ if nValuesList[idx] != 1:
+ # this happens with RGB and friends, nBits is not a single value
+ nBits = self._readIFDEntry(TAG_BITS_PER_SAMPLE,
+ tagIDList, fieldTypeList, nValuesList,
+ valueOffsetList)
+
+ if TAG_COLORMAP in tagIDList:
+ idx = tagIDList.index(TAG_COLORMAP)
+ tmpColormap = self._readIFDEntry(TAG_COLORMAP,
+ tagIDList, fieldTypeList, nValuesList, valueOffsetList)
+ if max(tmpColormap) > 255:
+ tmpColormap = numpy.array(tmpColormap, dtype=numpy.uint16)
+ tmpColormap = (tmpColormap / 256.).astype(numpy.uint8)
+ else:
+ tmpColormap = numpy.array(tmpColormap, dtype=numpy.uint8)
+ tmpColormap.shape = 3, -1
+ colormap = numpy.zeros((tmpColormap.shape[-1], 3), tmpColormap.dtype)
+ colormap[:, :] = tmpColormap.T
+ tmpColormap = None
+ else:
+ colormap = None
+
+ # sample format
+ if TAG_SAMPLE_FORMAT in tagIDList:
+ sampleFormat = valueOffsetList[tagIDList.index(TAG_SAMPLE_FORMAT)]
+ else:
+ # set to unknown
+ sampleFormat = SAMPLE_FORMAT_VOID
+
+ # compression
+ compression = False
+ compression_type = 1
+ if TAG_COMPRESSION in tagIDList:
+ compression_type = valueOffsetList[tagIDList.index(TAG_COMPRESSION)]
+ if compression_type == 1:
+ compression = False
+ else:
+ compression = True
+
+ # photometric interpretation
+ interpretation = 1
+ if TAG_PHOTOMETRIC_INTERPRETATION in tagIDList:
+ interpretation = valueOffsetList[tagIDList.index(TAG_PHOTOMETRIC_INTERPRETATION)]
+ else:
+ logger.debug("WARNING: Non standard TIFF. Photometric interpretation TAG missing")
+ helpString = ""
+ if sys.version > '2.6':
+ helpString = eval('b""')
+
+ if TAG_IMAGE_DESCRIPTION in tagIDList:
+ imageDescription = self._readIFDEntry(TAG_IMAGE_DESCRIPTION,
+ tagIDList, fieldTypeList, nValuesList, valueOffsetList)
+ if type(imageDescription) in [type([1]), type((1,))]:
+ imageDescription = helpString.join(imageDescription)
+ else:
+ imageDescription = "%d/%d" % (nImage + 1, len(self._IFD))
+
+ if sys.version < '3.0':
+ defaultSoftware = "Unknown Software"
+ else:
+ defaultSoftware = bytes("Unknown Software",
+ encoding='utf-8')
+ if TAG_SOFTWARE in tagIDList:
+ software = self._readIFDEntry(TAG_SOFTWARE,
+ tagIDList, fieldTypeList, nValuesList, valueOffsetList)
+ if type(software) in [type([1]), type((1,))]:
+ software = helpString.join(software)
+ else:
+ software = defaultSoftware
+
+ if software == defaultSoftware:
+ try:
+ if sys.version < '3.0':
+ if imageDescription.upper().startswith("IMAGEJ"):
+ software = imageDescription.split("=")[0]
+ else:
+ tmpString = imageDescription.decode()
+ if tmpString.upper().startswith("IMAGEJ"):
+ software = bytes(tmpString.split("=")[0],
+ encoding='utf-8')
+ except:
+ pass
+
+ if TAG_DATE in tagIDList:
+ date = self._readIFDEntry(TAG_DATE,
+ tagIDList, fieldTypeList, nValuesList, valueOffsetList)
+ if type(date) in [type([1]), type((1,))]:
+ date = helpString.join(date)
+ else:
+ date = "Unknown Date"
+
+ stripOffsets = self._readIFDEntry(TAG_STRIP_OFFSETS,
+ tagIDList,
+ fieldTypeList,
+ nValuesList,
+ valueOffsetList)
+ if TAG_ROWS_PER_STRIP in tagIDList:
+ rowsPerStrip = self._readIFDEntry(TAG_ROWS_PER_STRIP,
+ tagIDList,
+ fieldTypeList,
+ nValuesList,
+ valueOffsetList)[0]
+ else:
+ rowsPerStrip = nRows
+ logger.warning("Non standard TIFF. Rows per strip TAG missing")
+
+ if TAG_STRIP_BYTE_COUNTS in tagIDList:
+ stripByteCounts = self._readIFDEntry(TAG_STRIP_BYTE_COUNTS,
+ tagIDList,
+ fieldTypeList,
+ nValuesList,
+ valueOffsetList)
+ else:
+ logger.warning("Non standard TIFF. Strip byte counts TAG missing")
+ if hasattr(nBits, 'index'):
+ expectedSum = 0
+ for n in nBits:
+ expectedSum += int(nRows * nColumns * n / 8)
+ else:
+ expectedSum = int(nRows * nColumns * nBits / 8)
+ stripByteCounts = [expectedSum]
+
+ if close:
+ self.__makeSureFileIsClosed()
+
+ if self._forceMonoOutput and (interpretation > 1):
+ # color image but asked monochrome output
+ nBits = 32
+ colormap = None
+ sampleFormat = SAMPLE_FORMAT_FLOAT
+ interpretation = 1
+ # we cannot rely on any cache in this case
+ useInfoCache = False
+ logger.debug("FORCED MONO")
+ else:
+ useInfoCache = True
+
+ info = {}
+ info["nRows"] = nRows
+ info["nColumns"] = nColumns
+ info["nBits"] = nBits
+ info["compression"] = compression
+ info["compression_type"] = compression_type
+ info["imageDescription"] = imageDescription
+ info["stripOffsets"] = stripOffsets # This contains the file offsets to the data positions
+ info["rowsPerStrip"] = rowsPerStrip
+ info["stripByteCounts"] = stripByteCounts # bytes in strip since I do not support compression
+ info["software"] = software
+ info["date"] = date
+ info["colormap"] = colormap
+ info["sampleFormat"] = sampleFormat
+ info["photometricInterpretation"] = interpretation
+ infoDict = {}
+ if sys.version < '3.0':
+ testString = 'PyMca'
+ else:
+ testString = eval('b"PyMca"')
+ if software.startswith(testString):
+ # str to make sure python 2.x sees it as string and not unicode
+ if sys.version < '3.0':
+ descriptionString = imageDescription
+ else:
+ descriptionString = str(imageDescription.decode())
+ # interpret the image description in terms of supplied
+ # information at writing time
+ items = descriptionString.split('=')
+ for i in range(int(len(items) / 2)):
+ key = "%s" % items[i * 2]
+ # get rid of the \n at the end of the value
+ value = "%s" % items[i * 2 + 1][:-1]
+ infoDict[key] = value
+ info['info'] = infoDict
+
+ if (self._maxImageCacheLength > 0) and useInfoCache:
+ self._imageInfoCacheIndex.insert(0, nImage)
+ self._imageInfoCache.insert(0, info)
+ if len(self._imageInfoCacheIndex) > self._maxImageCacheLength:
+ self._imageInfoCacheIndex = self._imageInfoCacheIndex[:self._maxImageCacheLength]
+ self._imageInfoCache = self._imageInfoCache[:self._maxImageCacheLength]
+ return info
+
+ def _readImage(self, nImage, **kw):
+ logger.debug("Reading image %d", nImage)
+ if 'close' in kw:
+ close = kw['close']
+ else:
+ close = True
+ rowMin = kw.get('rowMin', None)
+ rowMax = kw.get('rowMax', None)
+ if nImage in self._imageDataCacheIndex:
+ logger.debug("Reading image data from cache")
+ return self._imageDataCache[self._imageDataCacheIndex.index(nImage)]
+
+ self.__makeSureFileIsOpen()
+ if self._forceMonoOutput:
+ oldMono = True
+ else:
+ oldMono = False
+ try:
+ self._forceMonoOutput = False
+ info = self._readInfo(nImage, close=False)
+ self._forceMonoOutput = oldMono
+ except:
+ self._forceMonoOutput = oldMono
+ raise
+ compression = info['compression']
+ compression_type = info['compression_type']
+ if compression:
+ if compression_type != 32773:
+ raise IOError("Compressed TIFF images not supported except packbits")
+ else:
+ # PackBits compression
+ logger.debug("Using PackBits compression")
+
+ interpretation = info["photometricInterpretation"]
+ if interpretation == 2:
+ # RGB
+ pass
+ # raise IOError("RGB Image. Only grayscale images supported")
+ elif interpretation == 3:
+ # Palette Color Image
+ pass
+ # raise IOError("Palette-color Image. Only grayscale images supported")
+ elif interpretation > 2:
+ # Palette Color Image
+ raise IOError("Only grayscale images supported")
+
+ nRows = info["nRows"]
+ nColumns = info["nColumns"]
+ nBits = info["nBits"]
+ colormap = info["colormap"]
+ sampleFormat = info["sampleFormat"]
+
+ if rowMin is None:
+ rowMin = 0
+
+ if rowMax is None:
+ rowMax = nRows - 1
+
+ if rowMin < 0:
+ rowMin = nRows - rowMin
+
+ if rowMax < 0:
+ rowMax = nRows - rowMax
+
+ if rowMax < rowMin:
+ txt = "Max Row smaller than Min Row. Reverse selection not supported"
+ raise NotImplemented(txt)
+
+ if rowMin >= nRows:
+ raise IndexError("Image only has %d rows" % nRows)
+
+ if rowMax >= nRows:
+ raise IndexError("Image only has %d rows" % nRows)
+
+ if sampleFormat == SAMPLE_FORMAT_FLOAT:
+ if nBits == 32:
+ dtype = numpy.float32
+ elif nBits == 64:
+ dtype = numpy.float64
+ else:
+ raise ValueError("Unsupported number of bits for a float: %d" % nBits)
+ elif sampleFormat in [SAMPLE_FORMAT_UINT, SAMPLE_FORMAT_VOID]:
+ if nBits in [8, (8, 8, 8), [8, 8, 8]]:
+ dtype = numpy.uint8
+ elif nBits in [16, (16, 16, 16), [16, 16, 16]]:
+ dtype = numpy.uint16
+ elif nBits in [32, (32, 32, 32), [32, 32, 32]]:
+ dtype = numpy.uint32
+ elif nBits in [64, (64, 64, 64), [64, 64, 64]]:
+ dtype = numpy.uint64
+ else:
+ raise ValueError("Unsupported number of bits for unsigned int: %s" % (nBits,))
+ elif sampleFormat == SAMPLE_FORMAT_INT:
+ if nBits in [8, (8, 8, 8), [8, 8, 8]]:
+ dtype = numpy.int8
+ elif nBits in [16, (16, 16, 16), [16, 16, 16]]:
+ dtype = numpy.int16
+ elif nBits in [32, (32, 32, 32), [32, 32, 32]]:
+ dtype = numpy.int32
+ elif nBits in [64, (64, 64, 64), [64, 64, 64]]:
+ dtype = numpy.int64
+ else:
+ raise ValueError("Unsupported number of bits for signed int: %s" % (nBits,))
+ else:
+ raise ValueError("Unsupported combination. Bits = %s Format = %d" % (nBits, sampleFormat))
+ if hasattr(nBits, 'index'):
+ image = numpy.zeros((nRows, nColumns, len(nBits)), dtype=dtype)
+ elif colormap is not None:
+ # should I use colormap dtype?
+ image = numpy.zeros((nRows, nColumns, 3), dtype=dtype)
+ else:
+ image = numpy.zeros((nRows, nColumns), dtype=dtype)
+
+ fd = self.fd
+ st = self._structChar
+ stripOffsets = info["stripOffsets"] # This contains the file offsets to the data positions
+ rowsPerStrip = info["rowsPerStrip"]
+ stripByteCounts = info["stripByteCounts"] # bytes in strip since I do not support compression
+
+ rowStart = 0
+ if len(stripOffsets) == 1:
+ bytesPerRow = int(stripByteCounts[0] / rowsPerStrip)
+ if nRows == rowsPerStrip:
+ actualBytesPerRow = int(image.nbytes / nRows)
+ if actualBytesPerRow != bytesPerRow:
+ logger.warning("Bogus StripByteCounts information")
+ bytesPerRow = actualBytesPerRow
+ fd.seek(stripOffsets[0] + rowMin * bytesPerRow)
+ nBytes = (rowMax - rowMin + 1) * bytesPerRow
+ if self._swap:
+ readout = numpy.fromstring(fd.read(nBytes), dtype).byteswap()
+ else:
+ readout = numpy.fromstring(fd.read(nBytes), dtype)
+ if hasattr(nBits, 'index'):
+ readout.shape = -1, nColumns, len(nBits)
+ elif info['colormap'] is not None:
+ readout = colormap[readout]
+ else:
+ readout.shape = -1, nColumns
+ image[rowMin:rowMax + 1, :] = readout
+ else:
+ for i in range(len(stripOffsets)):
+ # the amount of rows
+ nRowsToRead = rowsPerStrip
+ rowEnd = int(min(rowStart + nRowsToRead, nRows))
+ if rowEnd < rowMin:
+ rowStart += nRowsToRead
+ continue
+ if (rowStart > rowMax):
+ break
+ # we are in position
+ fd.seek(stripOffsets[i])
+ # the amount of bytes to read
+ nBytes = stripByteCounts[i]
+ if compression_type == 32773:
+ try:
+ bufferBytes = bytes()
+ except:
+ # python 2.5 ...
+ bufferBytes = ""
+ # packBits
+ readBytes = 0
+ # intermediate buffer
+ tmpBuffer = fd.read(nBytes)
+ while readBytes < nBytes:
+ n = struct.unpack('b', tmpBuffer[readBytes:(readBytes + 1)])[0]
+ readBytes += 1
+ if n >= 0:
+ # should I prevent reading more than the
+ # length of the chain? Let's python raise
+ # the exception...
+ bufferBytes += tmpBuffer[readBytes:
+ readBytes + (n + 1)]
+ readBytes += (n + 1)
+ elif n > -128:
+ bufferBytes += (-n + 1) * tmpBuffer[readBytes:(readBytes + 1)]
+ readBytes += 1
+ else:
+ # if read -128 ignore the byte
+ continue
+ if self._swap:
+ readout = numpy.fromstring(bufferBytes, dtype).byteswap()
+ else:
+ readout = numpy.fromstring(bufferBytes, dtype)
+ if hasattr(nBits, 'index'):
+ readout.shape = -1, nColumns, len(nBits)
+ elif info['colormap'] is not None:
+ readout = colormap[readout]
+ readout.shape = -1, nColumns, 3
+ else:
+ readout.shape = -1, nColumns
+ image[rowStart:rowEnd, :] = readout
+ else:
+ if 1:
+ # use numpy
+ if self._swap:
+ readout = numpy.fromstring(fd.read(nBytes), dtype).byteswap()
+ else:
+ readout = numpy.fromstring(fd.read(nBytes), dtype)
+ if hasattr(nBits, 'index'):
+ readout.shape = -1, nColumns, len(nBits)
+ elif colormap is not None:
+ readout = colormap[readout]
+ readout.shape = -1, nColumns, 3
+ else:
+ readout.shape = -1, nColumns
+ image[rowStart:rowEnd, :] = readout
+ else:
+ # using struct
+ readout = numpy.array(struct.unpack(st + "%df" % int(nBytes / 4), fd.read(nBytes)),
+ dtype=dtype)
+ if hasattr(nBits, 'index'):
+ readout.shape = -1, nColumns, len(nBits)
+ elif colormap is not None:
+ readout = colormap[readout]
+ readout.shape = -1, nColumns, 3
+ else:
+ readout.shape = -1, nColumns
+ image[rowStart:rowEnd, :] = readout
+ rowStart += nRowsToRead
+ if close:
+ self.__makeSureFileIsClosed()
+
+ if len(image.shape) == 3:
+ # color image
+ if self._forceMonoOutput:
+ # color image, convert to monochrome
+ image = (image[:, :, 0] * 0.114 +
+ image[:, :, 1] * 0.587 +
+ image[:, :, 2] * 0.299).astype(numpy.float32)
+
+ if (rowMin == 0) and (rowMax == (nRows - 1)):
+ self._imageDataCacheIndex.insert(0, nImage)
+ self._imageDataCache.insert(0, image)
+ if len(self._imageDataCacheIndex) > self._maxImageCacheLength:
+ self._imageDataCacheIndex = self._imageDataCacheIndex[:self._maxImageCacheLength]
+ self._imageDataCache = self._imageDataCache[:self._maxImageCacheLength]
+
+ return image
+
+ def writeImage(self, image0, info=None, software=None, date=None):
+ if software is None:
+ software = 'PyMca.TiffIO'
+ # if date is None:
+ # date = time.ctime()
+
+ self.__makeSureFileIsOpen()
+ fd = self.fd
+ # prior to do anything, perform some tests
+ if not len(image0.shape):
+ raise ValueError("Empty image")
+ if len(image0.shape) == 1:
+ # get a different view
+ image = image0[:]
+ image.shape = 1, -1
+ else:
+ image = image0
+
+ if image.dtype == numpy.float64:
+ image = image.astype(numpy.float32)
+ fd.seek(0)
+ mode = fd.mode
+ name = fd.name
+ if 'w' in mode:
+ # we have to overwrite the file
+ self.__makeSureFileIsClosed()
+ fd = None
+ if os.path.exists(name):
+ os.remove(name)
+ fd = open(name, mode='wb+')
+ self._initEmptyFile(fd)
+ self.fd = fd
+
+ # read the file size
+ self.__makeSureFileIsOpen()
+ fd = self.fd
+ fd.seek(0, os.SEEK_END)
+ endOfFile = fd.tell()
+ if fd.tell() == 0:
+ self._initEmptyFile(fd)
+ fd.seek(0, os.SEEK_END)
+ endOfFile = fd.tell()
+
+ # init internal variables
+ self._initInternalVariables(fd)
+ st = self._structChar
+
+ # get the image file directories
+ nImages = self.getImageFileDirectories()
+ logger.debug("File contains %d images", nImages)
+ if nImages == 0:
+ fd.seek(4)
+ fmt = st + 'I'
+ fd.write(struct.pack(fmt, endOfFile))
+ else:
+ fd.seek(self._IFD[-1])
+ fmt = st + 'H'
+ numberOfDirectoryEntries = struct.unpack(fmt, fd.read(struct.calcsize(fmt)))[0]
+ fmt = st + 'I'
+ pos = self._IFD[-1] + 2 + 12 * numberOfDirectoryEntries
+ fd.seek(pos)
+ fmt = st + 'I'
+ fd.write(struct.pack(fmt, endOfFile))
+ fd.flush()
+
+ # and we can write at the end of the file, find out the file length
+ fd.seek(0, os.SEEK_END)
+
+ # get the description information from the input information
+ if info is None:
+ description = info
+ else:
+ description = "%s" % ""
+ for key in info.keys():
+ description += "%s=%s\n" % (key, info[key])
+
+ # get the image file directory
+ outputIFD = self._getOutputIFD(image, description=description,
+ software=software,
+ date=date)
+
+ # write the new IFD
+ fd.write(outputIFD)
+
+ # write the image
+ if self._swap:
+ fd.write(image.byteswap().tostring())
+ else:
+ fd.write(image.tostring())
+
+ fd.flush()
+ self.fd = fd
+ self.__makeSureFileIsClosed()
+
+ def _initEmptyFile(self, fd=None):
+ if fd is None:
+ fd = self.fd
+ if sys.byteorder == "little":
+ order = "II"
+ # intel, little endian
+ fileOrder = "little"
+ self._structChar = '<'
+ else:
+ order = "MM"
+ # motorola, high endian
+ fileOrder = "big"
+ self._structChar = '>'
+ st = self._structChar
+ if fileOrder == sys.byteorder:
+ self._swap = False
+ else:
+ self._swap = True
+ fd.seek(0)
+ if sys.version < '3.0':
+ fd.write(struct.pack(st + '2s', order))
+ fd.write(struct.pack(st + 'H', 42))
+ fd.write(struct.pack(st + 'I', 0))
+ else:
+ fd.write(struct.pack(st + '2s', bytes(order, 'utf-8')))
+ fd.write(struct.pack(st + 'H', 42))
+ fd.write(struct.pack(st + 'I', 0))
+ fd.flush()
+
+ def _getOutputIFD(self, image, description=None, software=None, date=None):
+ # the tags have to be in order
+ # the very minimum is
+ # 256:"NumberOfColumns", # S or L ImageWidth
+ # 257:"NumberOfRows", # S or L ImageHeight
+ # 258:"BitsPerSample", # S Number of bits per component
+ # 259:"Compression", # SHORT (1 - NoCompression, ...
+ # 262:"PhotometricInterpretation", # SHORT (0 - WhiteIsZero, 1 -BlackIsZero, 2 - RGB, 3 - Palette color
+ # 270:"ImageDescription", # ASCII
+ # 273:"StripOffsets", # S or L, for each strip, the byte offset of the strip
+ # 277:"SamplesPerPixel", # SHORT (>=3) only for RGB images
+ # 278:"RowsPerStrip", # S or L, number of rows in each back may be not for the last
+ # 279:"StripByteCounts", # S or L, The number of bytes in the strip AFTER any compression
+ # 305:"Software", # ASCII
+ # 306:"Date", # ASCII
+ # 339:"SampleFormat", # SHORT Interpretation of data in each pixel
+
+ nDirectoryEntries = 9
+ imageDescription = None
+ if description is not None:
+ descriptionLength = len(description)
+ while descriptionLength < 4:
+ description = description + " "
+ descriptionLength = len(description)
+ if sys.version >= '3.0':
+ description = bytes(description, 'utf-8')
+ elif isinstance(description, str):
+ try:
+ description = description.decode('utf-8')
+ except UnicodeDecodeError:
+ try:
+ description = description.decode('latin-1')
+ except UnicodeDecodeError:
+ description = "%s" % description
+ if sys.version > '2.6':
+ description = description.encode('utf-8', errors="ignore")
+ description = "%s" % description
+ descriptionLength = len(description)
+ imageDescription = struct.pack("%ds" % descriptionLength, description)
+ nDirectoryEntries += 1
+
+ # software
+ if software is not None:
+ softwareLength = len(software)
+ while softwareLength < 4:
+ software = software + " "
+ softwareLength = len(software)
+ if sys.version >= '3.0':
+ software = bytes(software, 'utf-8')
+ softwarePackedString = struct.pack("%ds" % softwareLength, software)
+ nDirectoryEntries += 1
+ else:
+ softwareLength = 0
+
+ if date is not None:
+ dateLength = len(date)
+ if sys.version >= '3.0':
+ date = bytes(date, 'utf-8')
+ datePackedString = struct.pack("%ds" % dateLength, date)
+ dateLength = len(datePackedString)
+ nDirectoryEntries += 1
+ else:
+ dateLength = 0
+
+ if len(image.shape) == 2:
+ nRows, nColumns = image.shape
+ nChannels = 1
+ elif len(image.shape) == 3:
+ nRows, nColumns, nChannels = image.shape
+ else:
+ raise RuntimeError("Image does not have the right shape")
+ dtype = image.dtype
+ bitsPerSample = int(dtype.str[-1]) * 8
+
+ # only uncompressed data
+ compression = 1
+
+ # interpretation, black is zero
+ if nChannels == 1:
+ interpretation = 1
+ bitsPerSampleLength = 0
+ elif nChannels == 3:
+ interpretation = 2
+ bitsPerSampleLength = 3 * 2 # To store 3 shorts
+ nDirectoryEntries += 1 # For SamplesPerPixel
+ else:
+ raise RuntimeError(
+ "Image with %d color channel(s) not supported" % nChannels)
+
+ # image description
+ if imageDescription is not None:
+ descriptionLength = len(imageDescription)
+ else:
+ descriptionLength = 0
+
+ # strip offsets
+ # we are putting them after the directory and the directory is
+ # at the end of the file
+ self.fd.seek(0, os.SEEK_END)
+ endOfFile = self.fd.tell()
+ if endOfFile == 0:
+ # empty file
+ endOfFile = 8
+
+ # rows per strip
+ if ALLOW_MULTIPLE_STRIPS:
+ # try to segment the image in several pieces
+ if not (nRows % 4):
+ rowsPerStrip = int(nRows / 4)
+ elif not (nRows % 10):
+ rowsPerStrip = int(nRows / 10)
+ elif not (nRows % 8):
+ rowsPerStrip = int(nRows / 8)
+ elif not (nRows % 4):
+ rowsPerStrip = int(nRows / 4)
+ elif not (nRows % 2):
+ rowsPerStrip = int(nRows / 2)
+ else:
+ rowsPerStrip = nRows
+ else:
+ rowsPerStrip = nRows
+
+ # stripByteCounts
+ stripByteCounts = int(nColumns * rowsPerStrip *
+ bitsPerSample * nChannels / 8)
+
+ if descriptionLength > 4:
+ stripOffsets0 = endOfFile + dateLength + descriptionLength + \
+ 2 + 12 * nDirectoryEntries + 4
+ else:
+ stripOffsets0 = endOfFile + dateLength + \
+ 2 + 12 * nDirectoryEntries + 4
+
+ if softwareLength > 4:
+ stripOffsets0 += softwareLength
+
+ stripOffsets0 += bitsPerSampleLength
+
+ stripOffsets = [stripOffsets0]
+ stripOffsetsLength = 0
+ stripOffsetsString = None
+
+ st = self._structChar
+
+ if rowsPerStrip != nRows:
+ nStripOffsets = int(nRows / rowsPerStrip)
+ fmt = st + 'I'
+ stripOffsetsLength = struct.calcsize(fmt) * nStripOffsets
+ stripOffsets0 += stripOffsetsLength
+ # the length for the stripByteCounts will be the same
+ stripOffsets0 += stripOffsetsLength
+ stripOffsets = []
+ for i in range(nStripOffsets):
+ value = stripOffsets0 + i * stripByteCounts
+ stripOffsets.append(value)
+ if i == 0:
+ stripOffsetsString = struct.pack(fmt, value)
+ stripByteCountsString = struct.pack(fmt, stripByteCounts)
+ else:
+ stripOffsetsString += struct.pack(fmt, value)
+ stripByteCountsString += struct.pack(fmt, stripByteCounts)
+
+ logger.debug("IMAGE WILL START AT %d", stripOffsets[0])
+
+ # sample format
+ if dtype in [numpy.float32, numpy.float64] or\
+ dtype.str[-2] == 'f':
+ sampleFormat = SAMPLE_FORMAT_FLOAT
+ elif dtype in [numpy.uint8, numpy.uint16, numpy.uint32, numpy.uint64]:
+ sampleFormat = SAMPLE_FORMAT_UINT
+ elif dtype in [numpy.int8, numpy.int16, numpy.int32, numpy.int64]:
+ sampleFormat = SAMPLE_FORMAT_INT
+ else:
+ raise ValueError("Unsupported data type %s" % dtype)
+
+ info = {}
+ info["nColumns"] = nColumns
+ info["nRows"] = nRows
+ info["nBits"] = bitsPerSample
+ info["compression"] = compression
+ info["photometricInterpretation"] = interpretation
+ info["stripOffsets"] = stripOffsets
+ if interpretation == 2:
+ info["samplesPerPixel"] = 3 # No support for extra samples
+ info["rowsPerStrip"] = rowsPerStrip
+ info["stripByteCounts"] = stripByteCounts
+ info["date"] = date
+ info["sampleFormat"] = sampleFormat
+
+ outputIFD = ""
+ if sys.version > '2.6':
+ outputIFD = eval('b""')
+
+ fmt = st + "H"
+ outputIFD += struct.pack(fmt, nDirectoryEntries)
+
+ fmt = st + "HHII"
+ outputIFD += struct.pack(fmt, TAG_NUMBER_OF_COLUMNS,
+ FIELD_TYPE_OUT['I'], 1, info["nColumns"])
+ outputIFD += struct.pack(fmt, TAG_NUMBER_OF_ROWS,
+ FIELD_TYPE_OUT['I'], 1, info["nRows"])
+
+ if info["photometricInterpretation"] == 1:
+ fmt = st + 'HHIHH'
+ outputIFD += struct.pack(fmt, TAG_BITS_PER_SAMPLE,
+ FIELD_TYPE_OUT['H'], 1, info["nBits"], 0)
+ elif info["photometricInterpretation"] == 2:
+ fmt = st + 'HHII'
+ outputIFD += struct.pack(fmt, TAG_BITS_PER_SAMPLE,
+ FIELD_TYPE_OUT['H'], 3,
+ info["stripOffsets"][0] - 2 * stripOffsetsLength - descriptionLength -
+ dateLength - softwareLength - bitsPerSampleLength)
+ else:
+ raise RuntimeError("Unsupported photometric interpretation")
+
+ fmt = st + 'HHIHH'
+ outputIFD += struct.pack(fmt, TAG_COMPRESSION,
+ FIELD_TYPE_OUT['H'], 1, info["compression"], 0)
+ fmt = st + 'HHIHH'
+ outputIFD += struct.pack(fmt, TAG_PHOTOMETRIC_INTERPRETATION,
+ FIELD_TYPE_OUT['H'], 1, info["photometricInterpretation"], 0)
+ if imageDescription is not None:
+ descriptionLength = len(imageDescription)
+ if descriptionLength > 4:
+ fmt = st + 'HHII'
+ outputIFD += struct.pack(fmt, TAG_IMAGE_DESCRIPTION,
+ FIELD_TYPE_OUT['s'], descriptionLength,
+ info["stripOffsets"][0] - 2 * stripOffsetsLength -
+ descriptionLength)
+ else:
+ # it has to have length 4
+ fmt = st + 'HHI%ds' % descriptionLength
+ outputIFD += struct.pack(fmt, TAG_IMAGE_DESCRIPTION,
+ FIELD_TYPE_OUT['s'],
+ descriptionLength,
+ description)
+
+ if len(stripOffsets) == 1:
+ fmt = st + 'HHII'
+ outputIFD += struct.pack(fmt, TAG_STRIP_OFFSETS,
+ FIELD_TYPE_OUT['I'], 1,
+ info["stripOffsets"][0])
+ else:
+ fmt = st + 'HHII'
+ outputIFD += struct.pack(fmt, TAG_STRIP_OFFSETS,
+ FIELD_TYPE_OUT['I'],
+ len(stripOffsets),
+ info["stripOffsets"][0] - 2 * stripOffsetsLength)
+
+ if info["photometricInterpretation"] == 2:
+ fmt = st + 'HHIHH'
+ outputIFD += struct.pack(fmt, TAG_SAMPLES_PER_PIXEL,
+ FIELD_TYPE_OUT['H'], 1,
+ info["samplesPerPixel"], 0)
+
+ fmt = st + 'HHII'
+ outputIFD += struct.pack(fmt, TAG_ROWS_PER_STRIP,
+ FIELD_TYPE_OUT['I'], 1,
+ info["rowsPerStrip"])
+
+ if len(stripOffsets) == 1:
+ fmt = st + 'HHII'
+ outputIFD += struct.pack(fmt, TAG_STRIP_BYTE_COUNTS,
+ FIELD_TYPE_OUT['I'], 1,
+ info["stripByteCounts"])
+ else:
+ fmt = st + 'HHII'
+ outputIFD += struct.pack(fmt, TAG_STRIP_BYTE_COUNTS,
+ FIELD_TYPE_OUT['I'], len(stripOffsets),
+ info["stripOffsets"][0] - stripOffsetsLength)
+
+ if software is not None:
+ if softwareLength > 4:
+ fmt = st + 'HHII'
+ outputIFD += struct.pack(fmt, TAG_SOFTWARE,
+ FIELD_TYPE_OUT['s'],
+ softwareLength,
+ info["stripOffsets"][0] -
+ 2 * stripOffsetsLength -
+ descriptionLength - softwareLength - dateLength)
+ else:
+ # it has to have length 4
+ fmt = st + 'HHI%ds' % softwareLength
+ outputIFD += struct.pack(fmt, TAG_SOFTWARE,
+ FIELD_TYPE_OUT['s'],
+ softwareLength,
+ softwarePackedString)
+
+ if date is not None:
+ fmt = st + 'HHII'
+ outputIFD += struct.pack(fmt, TAG_DATE,
+ FIELD_TYPE_OUT['s'],
+ dateLength,
+ info["stripOffsets"][0] -
+ 2 * stripOffsetsLength -
+ descriptionLength - dateLength)
+
+ fmt = st + 'HHIHH'
+ outputIFD += struct.pack(fmt, TAG_SAMPLE_FORMAT,
+ FIELD_TYPE_OUT['H'], 1,
+ info["sampleFormat"], 0)
+ fmt = st + 'I'
+ outputIFD += struct.pack(fmt, 0)
+
+ if info["photometricInterpretation"] == 2:
+ outputIFD += struct.pack('HHH', info["nBits"],
+ info["nBits"], info["nBits"])
+
+ if softwareLength > 4:
+ outputIFD += softwarePackedString
+
+ if date is not None:
+ outputIFD += datePackedString
+
+ if imageDescription is not None:
+ if descriptionLength > 4:
+ outputIFD += imageDescription
+
+ if stripOffsetsString is not None:
+ outputIFD += stripOffsetsString
+ outputIFD += stripByteCountsString
+
+ return outputIFD
+
+
+if __name__ == "__main__":
+ filename = sys.argv[1]
+ dtype = numpy.uint16
+ if not os.path.exists(filename):
+ print("Testing file creation")
+ tif = TiffIO(filename, mode='wb+')
+ data = numpy.arange(10000).astype(dtype)
+ data.shape = 100, 100
+ tif.writeImage(data, info={'Title': '1st'})
+ tif = None
+ if os.path.exists(filename):
+ print("Testing image appending")
+ tif = TiffIO(filename, mode='rb+')
+ tif.writeImage((data * 2).astype(dtype), info={'Title': '2nd'})
+ tif = None
+ tif = TiffIO(filename)
+ print("Number of images = %d" % tif.getNumberOfImages())
+ for i in range(tif.getNumberOfImages()):
+ info = tif.getInfo(i)
+ for key in info:
+ if key not in ["colormap"]:
+ print("%s = %s" % (key, info[key]))
+ elif info['colormap'] is not None:
+ print("RED %s = %s" % (key, info[key][0:10, 0]))
+ print("GREEN %s = %s" % (key, info[key][0:10, 1]))
+ print("BLUE %s = %s" % (key, info[key][0:10, 2]))
+ data = tif.getImage(i)[0, 0:10]
+ print("data [0, 0:10] = ", data)
diff --git a/fabio/__init__.py b/fabio/__init__.py
new file mode 100644
index 0000000..a2d9ca9
--- /dev/null
+++ b/fabio/__init__.py
@@ -0,0 +1,87 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+"""FabIO module"""
+
+from __future__ import absolute_import, print_function, division
+
+__author__ = "Jérôme Kieffer"
+__contact__ = "Jerome.Kieffer@ESRF.eu"
+__license__ = "GPLv3+"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "27/07/2017"
+__status__ = "stable"
+
+
+import sys
+import logging
+
+if "ps1" in dir(sys):
+ # configure logging with interactive console
+ logging.basicConfig()
+
+import os
+project = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
+try:
+ from ._version import __date__ as date # noqa
+ from ._version import version, version_info, hexversion, strictversion # noqa
+except ImportError:
+ raise RuntimeError("Do NOT use %s from its sources: build it and use the built version" % project)
+
+from . import fabioimage
+factory = fabioimage.FabioImage.factory
+from . import openimage
+from .fabioutils import COMPRESSORS, jump_filename, FilenameObject, \
+ previous_filename, next_filename, deconstruct_filename, \
+ extract_filenumber, getnum, construct_filename, exists
+
+# Compatibility with outside world:
+filename_object = FilenameObject
+
+from .openimage import openimage as open
+from .openimage import openheader as openheader
+
+
+def tests():
+ """
+ Run the FabIO test suite.
+
+ If the test-images are not already installed (via the debian package for example),
+ they need to be downloaded from sourceforge.net, which make take a while.
+ Ensure your network connection is operational and your proxy settings are correct,
+ for example:
+
+ export http_proxy=http://proxy.site.com:3128
+ """
+ from . import test
+ test.run_tests()
+
+
+def benchmarks():
+ """
+ Run the benchmarks
+ """
+ from . import benchmark
+ res = benchmark.run()
+ return res
diff --git a/fabio/adscimage.py b/fabio/adscimage.py
new file mode 100644
index 0000000..41108c4
--- /dev/null
+++ b/fabio/adscimage.py
@@ -0,0 +1,143 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+
+Authors: Henning O. Sorensen & Erik Knudsen
+ Center for Fundamental Research: Metal Structures in Four Dimensions
+ Risoe National Laboratory
+ Frederiksborgvej 399
+ DK-4000 Roskilde
+ email:erik.knudsen@risoe.dk
+
++ mods for fabio by JPW
+
+"""
+# Get ready for python3:
+from __future__ import with_statement, print_function
+import numpy
+import logging
+from .fabioimage import FabioImage
+from .fabioutils import to_str
+logger = logging.getLogger(__name__)
+
+
+class AdscImage(FabioImage):
+ """ Read an image in ADSC format (quite similar to edf?) """
+
+ DESCRIPTION = "ADSC format (from Area Detector Systems Corporation)"
+
+ DEFAULT_EXTENTIONS = ["img"]
+
+ def __init__(self, *args, **kwargs):
+ FabioImage.__init__(self, *args, **kwargs)
+
+ def read(self, fname, frame=None):
+ """ read in the file """
+ with self._open(fname, "rb") as infile:
+ try:
+ self._readheader(infile)
+ except:
+ raise Exception("Error processing adsc header")
+ # banned by bzip/gzip???
+ try:
+ infile.seek(int(self.header['HEADER_BYTES']), 0)
+ except TypeError:
+ # Gzipped does not allow a seek and read header is not
+ # promising to stop in the right place
+ infile.close()
+ infile = self._open(fname, "rb")
+ infile.read(int(self.header['HEADER_BYTES']))
+ binary = infile.read()
+ # infile.close()
+
+ # now read the data into the array
+ self.dim1 = int(self.header['SIZE1'])
+ self.dim2 = int(self.header['SIZE2'])
+ data = numpy.fromstring(binary, numpy.uint16)
+ if self.swap_needed():
+ data.byteswap(True)
+ try:
+ data.shape = (self.dim2, self.dim1)
+ except ValueError:
+ raise IOError('Size spec in ADSC-header does not match ' +
+ 'size of image data field %sx%s != %s' % (self.dim1, self.dim2, data.size))
+ self.data = data
+ self.bytecode = numpy.uint16
+ self.resetvals()
+ return self
+
+ def _readheader(self, infile):
+ """ read an adsc header """
+ line = infile.readline()
+ bytesread = len(line)
+ while b'}' not in line:
+ if b'=' in line:
+ (key, val) = to_str(line).split('=')
+ self.header[key.strip()] = val.strip(' ;\n\r')
+ line = infile.readline()
+ bytesread = bytesread + len(line)
+
+ def write(self, fname):
+ """
+ Write adsc format
+ """
+ out = b'{\n'
+ for key in self.header:
+ out += b"%s = %s;\n" % (key, self.header[key])
+ if "HEADER_BYTES" in self.header:
+ pad = int(self.header["HEADER_BYTES"]) - len(out) - 2
+ else:
+ # hsize = ((len(out) + 23) // 512 + 1) * 512
+ hsize = (len(out) + 533) & ~(512 - 1)
+ out += b"HEADER_BYTES=%d;\n" % (hsize)
+ pad = hsize - len(out) - 2
+ out += pad * b' ' + b"}\n"
+ assert len(out) % 512 == 0, "Header is not multiple of 512"
+
+ data = self.data.astype(numpy.uint16)
+ if self.swap_needed():
+ data.byteswap(True)
+
+ with open(fname, "wb") as outf:
+ outf.write(out)
+ outf.write(data.tostring())
+ # outf.close()
+
+ def swap_needed(self):
+ if "BYTE_ORDER" not in self.header:
+ logger.warning("No byte order specified, assuming little_endian")
+ BYTE_ORDER = "little_endian"
+ else:
+ BYTE_ORDER = self.header["BYTE_ORDER"]
+ if "little" in BYTE_ORDER and numpy.little_endian:
+ return False
+ elif "big" in BYTE_ORDER and not numpy.little_endian:
+ return False
+ elif "little" in BYTE_ORDER and not numpy.little_endian:
+ return True
+ elif "big" in BYTE_ORDER and numpy.little_endian:
+ return True
+
+
+adscimage = AdscImage
diff --git a/fabio/app/__init__.py b/fabio/app/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/fabio/app/__init__.py
diff --git a/fabio/app/convert.py b/fabio/app/convert.py
new file mode 100644
index 0000000..df28dd9
--- /dev/null
+++ b/fabio/app/convert.py
@@ -0,0 +1,400 @@
+#!/usr/bin/env python
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+"""Portable image converter based on FabIO library.
+"""
+from __future__ import with_statement, print_function
+
+__author__ = "Valentin Valls"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__licence__ = "MIT"
+__date__ = "31/07/2017"
+__status__ = "production"
+
+import logging
+logging.basicConfig()
+
+import sys
+import os
+import glob
+
+import fabio
+from fabio.third_party import six
+from fabio.third_party import argparse
+
+
+logger = logging.getLogger("fabio-convert")
+
+
+def get_default_extension_from_format(format_name):
+ """"
+ Get a default file extension from a fabio format
+
+ :param str format: String format like "edfimage"
+ :rtype: str
+ """
+ class_ = fabio.fabioformats.get_class_by_name(format_name)
+ if class_ is None:
+ raise RuntimeError("Format '%s' unsupported" % format_name)
+
+ extensions = class_.DEFAULT_EXTENTIONS
+ if len(extensions) == 0:
+ # No extensions
+ return ""
+ else:
+ return extensions[0]
+
+
+def get_output_filename(input_filename, format_name):
+ """
+ Returns the output filename from the input filename and the format.
+
+ :param str input_filename: Input filename path
+ :param str format_name: String format like "edfimage"
+ :rtype: str
+ """
+ basename, _ = os.path.splitext(input_filename)
+ extension = get_default_extension_from_format(format_name)
+ if extension == "":
+ extension = "bin"
+ return basename + "." + extension
+
+
+def is_user_want_to_overwrite_filename(filename):
+ """
+ Ask question in the shell and returns true if the user want to overwrite
+ a file passed in parameter.
+
+ :param str filename: The filename it asks for
+ :rtype: bool
+ """
+ while True:
+ question = "Do you want to overwrite the file '%s' (y/n): " % filename
+ answer = six.moves.input(question)
+ answer = answer.strip().lower()
+ if answer in ["y", "yes", "n", "no"]:
+ break
+ return answer in ["y", "yes"]
+
+
+def is_older(filename1, filename2):
+ """Returns true if the first file is older than the second one.
+
+ :param str filename1: An existing filename
+ :param str filename2: An existing filename
+ :rtype: bool
+ """
+ time1 = os.path.getmtime(filename1)
+ time2 = os.path.getmtime(filename2)
+ return time1 > time2
+
+
+def convert_one(input_filename, output_filename, options):
+ """
+ Convert a single file using options
+
+ :param str input_filename: The input filename
+ :param str output_filename: The output filename
+ :param object options: List of options provided from the command line
+ :rtype: bool
+ :returns: True is the conversion succeeded
+ """
+ input_filename = os.path.abspath(input_filename)
+ input_exists = os.path.exists(input_filename)
+ output_filename = os.path.abspath(output_filename)
+ output_exists = os.path.exists(output_filename)
+
+ if options.verbose:
+ print("Converting file '%s' to '%s'" % (input_filename, output_filename))
+
+ if not input_exists:
+ logger.error("Input file '%s' do not exists. Conversion skipped.", input_filename)
+ return False
+
+ skip_conversion = False
+ remove_file = False
+
+ if output_exists:
+ if options.interactive:
+ if is_user_want_to_overwrite_filename(output_filename):
+ remove_file = True
+ else:
+ skip_conversion = True
+ elif options.no_clobber:
+ skip_conversion = True
+ elif options.force or options.remove_destination:
+ remove_file = True
+ elif options.update:
+ if is_older(output_filename, input_filename):
+ skip_conversion = True
+ else:
+ remove_file = True
+ elif is_user_want_to_overwrite_filename(output_filename):
+ remove_file = True
+ else:
+ skip_conversion = True
+
+ if remove_file:
+ if options.verbose:
+ print("Overwrite file %s" % output_filename)
+ try:
+ if not options.dry_run:
+ os.remove(output_filename)
+ except OSError as e:
+ logger.error("Removing previous file %s failed cause: \"%s\". Conversion skipped.", e.message, output_filename)
+ logger.debug("Backtrace", exc_info=True)
+ return False
+
+ if skip_conversion:
+ if options.verbose:
+ print("Conversion to file %s skipped" % output_filename)
+ return True
+
+ try:
+ logger.debug("Load '%s'", input_filename)
+ source = fabio.open(input_filename)
+ except KeyboardInterrupt:
+ raise
+ except Exception as e:
+ logger.error("Loading input file '%s' failed cause: \"%s\". Conversion skipped.", input_filename, e.message)
+ logger.debug("Backtrace", exc_info=True)
+ return False
+
+ try:
+ logger.debug("Convert '%s' into '%s'", input_filename, options.format)
+ converted = source.convert(options.format)
+ except KeyboardInterrupt:
+ raise
+ except Exception as e:
+ logger.error("Converting input file '%s' failed cause: \"%s\". Conversion skipped.", input_filename, e.message)
+ logger.debug("Backtrace", exc_info=True)
+ return False
+
+ try:
+ logger.debug("Write '%s'", output_filename)
+ if not options.dry_run:
+ converted.write(output_filename)
+ except KeyboardInterrupt:
+ raise
+ except Exception as e:
+ logger.error("Saving output file '%s' failed cause: \"%s\". Conversion skipped.", output_filename, e.message)
+ logger.debug("Backtrace", exc_info=True)
+ return False
+
+ # a success
+ return True
+
+
+def convert_all(options):
+ """Convert all the files from the command line.
+
+ :param object options: List of options provided from the command line
+ :rtype: bool
+ :returns: True is the conversion succeeded
+ """
+ succeeded = True
+ for filename in options.images:
+
+ if options.output is None:
+ output_filename = get_output_filename(filename, options.format)
+ elif os.path.isdir(options.output):
+ output_filename = get_output_filename(filename, options.format)
+ output_filename = os.path.basename(output_filename)
+ directory = os.path.abspath(options.output)
+ output_filename = os.path.join(directory, output_filename)
+ else:
+ output_filename = options.output
+
+ succeeded = succeeded and convert_one(filename, output_filename, options)
+
+ return succeeded
+
+
+def print_supported_formats():
+ """List supported format to the output"""
+ classes = fabio.fabioformats.get_classes(writer=True)
+ classes.sort(key=lambda c: c.__module__.lower())
+
+ indentation = " "
+
+ print("List of writable file formats supported by FabIO version %s" % fabio.version)
+ print()
+
+ for class_ in classes:
+ if len(class_.DEFAULT_EXTENTIONS) > 0:
+ extensions = ", ".join(["*." + x for x in class_.DEFAULT_EXTENTIONS])
+ extensions = "(%s)" % extensions
+ else:
+ extensions = ""
+
+ print("- %s %s" % (class_.codec_name(), extensions))
+ print("%s%s" % (indentation, class_.DESCRIPTION))
+
+
+def is_format_supported(format_name):
+ """
+ Returns true if the file format is supported.
+
+ :param str format_name: Name of the format (for example edfimage)
+ :rtype: bool
+ """
+ try:
+ fabio.fabioimage.FabioImage.factory(format_name)
+ return True
+ except RuntimeError:
+ logger.debug("Backtrace", exc_info=True)
+ return False
+
+
+def expand_args(args):
+ """
+ Takes an argv and expand it (under Windows, cmd does not convert *.tif into
+ a list of files.
+
+ :param list args: list of files or wildcards
+ :return: list of actual args
+ """
+ new = []
+ for afile in args:
+ if glob.has_magic(afile):
+ new += glob.glob(afile)
+ else:
+ new.append(afile)
+ return new
+
+
+EXIT_SUCCESS = 0
+EXIT_FAILURE = 1
+EXIT_ARGUMENT_FAILURE = 2
+
+
+def main():
+
+ epilog = """return codes: 0 means a success. 1 means the conversion
+ contains a failure, 2 means there was an error in the
+ arguments"""
+
+ parser = argparse.ArgumentParser(prog="fabio-convert",
+ description=__doc__,
+ epilog=epilog)
+ parser.add_argument("IMAGE", nargs="*",
+ help="Input file images")
+ parser.add_argument("-V", "--version", action='version', version=fabio.version,
+ help="output version and exit")
+ parser.add_argument("-v", "--verbose", action='store_true', dest="verbose", default=False,
+ help="show information for each conversions")
+ parser.add_argument("--debug", action='store_true', dest="debug", default=False,
+ help="show debug information")
+
+ group = parser.add_argument_group("main arguments")
+ group.add_argument("-l", "--list", action="store_true", dest="list", default=None,
+ help="show the list of available formats and exit")
+ group.add_argument("-o", "--output", dest='output', type=str,
+ help="output file or directory")
+ group.add_argument("-F", "--output-format", dest="format", type=str, default=None,
+ help="output format")
+
+ group = parser.add_argument_group("optional behaviour arguments")
+ group.add_argument("-f", "--force", dest="force", action="store_true", default=False,
+ help="if an existing destination file cannot be" +
+ " opened, remove it and try again (this option" +
+ " is ignored when the -n option is also used)")
+ group.add_argument("-n", "--no-clobber", dest="no_clobber", action="store_true", default=False,
+ help="do not overwrite an existing file (this option" +
+ " is ignored when the -i option is also used)")
+ group.add_argument("--remove-destination", dest="remove_destination", action="store_true", default=False,
+ help="remove each existing destination file before" +
+ " attempting to open it (contrast with --force)")
+ group.add_argument("-u", "--update", dest="update", action="store_true", default=False,
+ help="copy only when the SOURCE file is newer" +
+ " than the destination file or when the" +
+ " destination file is missing")
+ group.add_argument("-i", "--interactive", dest="interactive", action="store_true", default=False,
+ help="prompt before overwrite (overrides a previous -n" +
+ " option)")
+ group.add_argument("--dry-run", dest="dry_run", action="store_true", default=False,
+ help="do everything except modifying the file system")
+
+ try:
+ args = parser.parse_args()
+
+ if args.debug:
+ logger.setLevel(logging.DEBUG)
+
+ if args.list:
+ print_supported_formats()
+ return
+
+ if len(args.IMAGE) == 0:
+ raise argparse.ArgumentError(None, "No input file specified.")
+
+ # the upper case IMAGE is used for the --help auto-documentation
+ args.images = expand_args(args.IMAGE)
+ args.images.sort()
+
+ if args.format is None or not args.format.endswith("image"):
+
+ if args.format is None:
+ if args.output is None:
+ raise argparse.ArgumentError(None, "No format specified. Use -F or -o.")
+ dummy_filename = args.output
+ else:
+ # format looks to be an extension
+ dummy_filename = "foo." + args.format
+
+ # extract file format from file name
+ filename = fabio.fabioutils.FilenameObject(filename=dummy_filename)
+
+ if filename.format is None or len(filename.format) == 0:
+ raise argparse.ArgumentError(None, "This file extension is unknown. You have also to specify a format using -F.")
+ elif filename.format is None or len(filename.format) > 1:
+ formats = [i + "image" for i in filename.format]
+ formats = ', '.join(formats)
+ raise argparse.ArgumentError(None, "This file extension correspond to different file formats: '%s'. You have to specify it using -F." % formats)
+ args.format = filename.format[0] + "image"
+
+ if not is_format_supported(args.format):
+ raise argparse.ArgumentError(None, "Format '%s' is unknown. Use -l to list all available formats." % args.format)
+ except argparse.ArgumentError as e:
+ logger.error(e.message)
+ logger.debug("Backtrace", exc_info=True)
+ return EXIT_ARGUMENT_FAILURE
+
+ succeeded = convert_all(args)
+ if not succeeded:
+ print("Conversion or part of it failed. You can try with --debug to have more output information.")
+ return EXIT_FAILURE
+
+ return EXIT_SUCCESS
+
+
+if __name__ == "__main__":
+ result = main()
+ sys.exit(result)
diff --git a/fabio/app/setup.py b/fabio/app/setup.py
new file mode 100644
index 0000000..41a4da3
--- /dev/null
+++ b/fabio/app/setup.py
@@ -0,0 +1,39 @@
+# coding: utf-8
+# /*##########################################################################
+# Copyright (C) 2016 European Synchrotron Radiation Facility
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+# ############################################################################*/
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "18/05/2017"
+
+from numpy.distutils.misc_util import Configuration
+
+
+def configuration(parent_package='', top_path=None):
+ config = Configuration('app', parent_package, top_path)
+ return config
+
+
+if __name__ == "__main__":
+ from numpy.distutils.core import setup
+ setup(configuration=configuration)
diff --git a/fabio/app/viewer.py b/fabio/app/viewer.py
new file mode 100755
index 0000000..68052bc
--- /dev/null
+++ b/fabio/app/viewer.py
@@ -0,0 +1,1523 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fast Azimuthal integration
+# https://github.com/silx-kit/pyFAI
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Authors: Gael Goret <gael.goret@esrf.fr>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# .
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# .
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+"""
+Portable diffraction images viewer/converter
+
+* Written in Python, it combines the functionalities of the I/O library fabIO
+ with a user friendly Qt4 GUI.
+* Image converter is also a light viewer based on the visualization tool
+ provided by the module matplotlib.
+"""
+from __future__ import with_statement, print_function
+__version__ = "1.0"
+__author__ = u"Gaël Goret, Jérôme Kieffer"
+__copyright__ = "2015 ESRF"
+__licence__ = "GPL"
+
+import sys
+import os
+import time
+
+from PyQt4.QtCore import QDir, Qt, QRect, QCoreApplication
+try:
+ from PyQt4.QtCore import QString
+except ImportError:
+ QString = str
+
+from PyQt4.QtGui import QLabel, QVBoxLayout, QWidget, QSplitter, QListWidget, \
+ QComboBox, QApplication, QStyleFactory, QHBoxLayout, \
+ QTabWidget, QPlainTextEdit, QPushButton, QGroupBox, \
+ QCheckBox, QMainWindow, QSizePolicy, QButtonGroup, \
+ QProgressBar, QDialogButtonBox, QLineEdit, \
+ QIcon, QAction, QFileDialog, QMessageBox, QDialog
+
+try:
+ _fromUtf8 = QString.fromUtf8
+except AttributeError:
+ _fromUtf8 = lambda s: s
+
+import numpy
+numpy.seterr(divide='ignore')
+
+import matplotlib
+matplotlib.use("QT4Agg")
+from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
+from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
+from matplotlib.figure import Figure
+import fabio
+
+from fabio.nexus import Nexus
+from fabio.third_party.argparse import ArgumentParser
+
+output_format = ['*.bin', '*.cbf', '*.edf', '*.h5', '*.img', '*.mar2300', '*.mar3450', '*.marccd', '*.tiff', "*.sfrm"]
+
+#--------------------------------------------------------------------------------------------------------
+# Application Form
+#--------------------------------------------------------------------------------------------------------
+
+
+class AppForm(QMainWindow):
+ def __init__(self, parent=None):
+
+ # Main window
+ QMainWindow.__init__(self, parent)
+ self.setWindowTitle('FabIO Viewer')
+ self.setSizePolicy(QSizePolicy().Expanding, QSizePolicy().Expanding)
+ # Menu and widget
+ self.create_menu()
+ self.create_main_frame()
+ self.create_status_bar()
+
+ # Active Data
+ self.data = numpy.array([])
+ self.header = []
+
+ # Data Series
+ self.imgDict = {}
+ self.data_series = []
+ self.header_series = []
+ self.sequential_file_list = []
+ self.sequential_file_dict = {}
+
+ # Miscellaneous
+ self.mask = None
+ self.transform_data_series = False
+ self.transform_list = []
+ self.sequential_file_mode = False
+ self.h5_loaded = False
+ self.counter_format = '%03d'
+#--------------------------------------------------------------------------------------------------------
+# Opening
+#--------------------------------------------------------------------------------------------------------
+
+ def format_header(self, d):
+ """
+ :param d: dict containing headers
+ :return: formated string
+ """
+ keys = list(d.keys())
+ keys.sort()
+ res = " \n".join(['%s: %s' % (k, d[k]) for k in keys]) + " \n"
+ return res
+
+ def open_data_series(self, series=None):
+ if not series:
+ series = QFileDialog.getOpenFileNames(self, 'Select and open series of files')
+ series = [str(f) for f in list(series)]
+ total = len(series)
+ if len(series) != 0:
+ self.data_series = []
+ self.header_series = []
+ self.sequential_file_list = []
+ iid = 0
+ self.imgDict = {}
+ self.sequential_file_dict = {}
+ self.images_list.clear()
+ self.imagelistWidget.clear()
+ self.headerTextEdit.clear()
+ self.axes.clear()
+ self.canvas.draw()
+ self.h5_loaded = False
+ for fname in series:
+ if fname:
+ extract_fname = self.extract_fname_from_path(fname)
+ if self.sequential_file_mode:
+ self.statusBar().showMessage('Adding path %s to batch image list, please wait ...' % fname)
+ self.log.appendPlainText('Adding path %s to batch image list' % fname)
+ QCoreApplication.processEvents()
+ self.imagelistWidget.addItem(extract_fname)
+ self.sequential_file_list += [extract_fname]
+ self.sequential_file_dict[extract_fname] = fname
+ iid += 1
+ else:
+ self.statusBar().showMessage('Opening file %s, please wait ...' % fname)
+ self.log.appendPlainText('Opening file %s' % fname)
+ QCoreApplication.processEvents()
+ try:
+ img = fabio.open(fname)
+ except:
+ QMessageBox.warning(self, 'Message', 'Automatic format recognition procedure failed or perhaps you are trying to open a binary data block...\n\n ...Switch to manual procedure ')
+ dial = BinDialog(self)
+ dim1, dim2, offset, bytecode, endian = dial.exec_()
+ if dim1 is not None and dim2 is not None:
+ if endian == 'Short':
+ endian = '<'
+ else:
+ endian = '>'
+ img = fabio.binaryimage.binaryimage()
+ img.read(fname, dim1, dim2, offset, bytecode, endian)
+ img.header = {'Info': 'No header information available in binary data blocks'}
+ else:
+ continue
+ if img.nframes > 1:
+ for img_idx in range(img.nframes):
+ frame = img.getframe(img_idx)
+ self.data_series.append(frame.data[:])
+ self.header_series.append(frame.header.copy())
+ frame_name = "%s # %i" % (extract_fname, img_idx)
+ self.images_list.addItem(frame_name)
+ self.imagelistWidget.addItem(frame_name)
+ self.imgDict[frame_name] = iid
+ self.sequential_file_list += [frame_name]
+ self.sequential_file_dict[frame_name] = fname
+ iid += 1
+ else:
+ self.data_series.append(img.data[:])
+ self.header_series.append(img.header.copy())
+ extract_fname = self.extract_fname_from_path(fname)
+ self.images_list.addItem(extract_fname)
+ self.imagelistWidget.addItem(extract_fname)
+ self.imgDict[extract_fname] = iid
+ self.sequential_file_list += [extract_fname]
+ self.sequential_file_dict[extract_fname] = fname
+ iid += 1
+ self.progressBar.setValue(float(iid + 1) / (total) * 100.)
+ self.statusBar().clearMessage()
+ self.progressBar.setValue(0)
+ self.log.appendPlainText('Opening procedure: Complete')
+ if self.data_series:
+ self.select_new_image(None, imgID=0)
+
+ def open_h5_data_series(self): # TODO batch mode compatibility
+ fname = QFileDialog.getOpenFileName(self, 'Select and open series of files')
+ fname = str(fname)
+ self.h5_loaded = True
+ if self.filecheckBox.checkState():
+ self.filecheckBox.stateChanged.disconnect()
+ self.filecheckBox.setCheckState(False)
+ self.sequential_file_mode = False
+ self.filecheckBox.stateChanged.connect(self.sequential_option)
+ QMessageBox.warning(self, 'Message', 'Sequential file mode is not compatible with hdf5 input file: option removed')
+ if fname:
+ self.data_series = []
+ self.header_series = []
+ self.sequential_file_list = []
+ self.sequential_file_dict = {}
+ self.imagelistWidget.clear()
+ self.headerTextEdit.clear()
+ with Nexus(fname, 'r') as nxs:
+ entry = nxs.get_entries()[0]
+ nxdata = nxs.get_class(entry, class_type="NXdata")[0]
+ dataset = nxdata.get("data", numpy.zeros(shape=(1, 1, 1)))
+ total = dataset.shape[0]
+ imgDict = {}
+ extract_fname = os.path.basename(os.path.splitext(fname)[0])
+ self.images_list.clear()
+ safeiid = 0
+ for iid in range(total):
+ self.progressBar.setValue(((iid + 1.0) / (total)) * 100.)
+ self.log.appendPlainText('Extracting data from hdf5 archive, image number %d' % iid)
+ QCoreApplication.processEvents()
+ self.data_series.append(dataset[iid])
+ self.header_series += [{'Info': 'No header information available in hdf5 Archive'}]
+ imgDict[extract_fname + str(iid)] = safeiid
+ self.images_list.addItem(extract_fname + str(iid))
+ safeiid += 1
+ self.statusBar().clearMessage()
+ self.progressBar.setValue(0)
+ self.log.appendPlainText('Hdf5 Extraction: Complete')
+ self.imgDict = imgDict.copy()
+ if self.data_series:
+ self.select_new_image(None, imgID=0)
+
+ def extract_fname_from_path(self, name):
+ posslash = name.rfind("/")
+ if posslash > -1:
+ return name[posslash + 1:]
+ else:
+ return name
+
+ def save_as(self):
+ info = QFileDialog.getSaveFileNameAndFilter(self, "Save active image as",
+ QDir.currentPath(),
+ filter=self.tr("binary data block (*.bin);;cbf image (*.cbf);;edf image (*.edf);;oxford diffraction image (*.img);;mar2300 image(*.mar2300);;mar3450 image (*.mar3450);;marccd image (*.marccd));;tiff image (*.tiff);;bruker image (*.sfrm)"))
+ if self.data.any():
+ if str(info[0]) != '' and str(info[0]) != '':
+ format_ = self.extract_format_from_string(str(info[1]))
+ fname = self.add_extention_if_absent(str(info[0]), format_)
+ self.convert_and_write(fname, format_, self.data, self.header)
+ else:
+ if str(info[0]) != '' and str(info[1]) != '':
+ QMessageBox.warning(self, 'Warning', "Could not save image as file if no data have been loaded")
+
+ def save_data_series_as_multiple_file(self):
+ info = QFileDialog.getSaveFileNameAndFilter(self, "Save data series as multiple files",
+ QDir.currentPath(),
+ filter=self.tr("binary data block (*.bin);;cbf image (*.cbf);;edf image (*.edf);;oxford diffraction image (*.img);;mar2300 image(*.mar2300);;mar3450 image (*.mar3450);;marccd image (*.marccd));;tiff image (*.tiff);;bruker image (*.sfrm)"))
+ if self.data_series or self.sequential_file_list:
+ if str(info[0]) != '' and str(info[1]) != '':
+ format_ = self.extract_format_from_string(str(info[1]))
+ fname = self.os.path.splitext(str(info[0]))[0]
+ self.convert_and_write_multiple_files(fname, format_)
+ else:
+ if str(info[0]) != '' and str(info[1]) != '':
+ QMessageBox.warning(self, 'Warning', "Could not save image as file if no data have been loaded")
+
+ def save_data_series_as_singlehdf(self):
+ info = QFileDialog.getSaveFileNameAndFilter(self, "Save data series as single high density file",
+ QDir.currentPath(),
+ filter=self.tr("HDF5 archive (*.h5)"))
+ if self.data_series or self.sequential_file_list:
+ if str(info[0]) != '' and str(info[1]) != '':
+ format_ = self.extract_format_from_string(str(info[1]))
+ fname = self.add_extention_if_absent(str(info[0]), format_)
+ if format_ == '*.h5':
+ self.convert_and_save_to_h5(fname)
+ else:
+ QMessageBox.warning(self, 'Warning', "Unknown format: %s" % format_)
+ return
+ else:
+ if str(info[0]) != '' and str(info[1]) != '':
+ QMessageBox.warning(self, 'Warning', "Could not save image as file if no data have been loaded")
+
+ def convert_and_save_to_h5(self, fname):
+ """
+ Save a stack as Nexus entry (create a new entry in the file each time)
+ """
+ with Nexus(fname) as nxs:
+ entry = nxs.new_entry(entry="entry", program_name="fabio_viewer", title="FabIO Viewer")
+ nxdata = nxs.new_class(entry, "fabio", class_type="NXdata")
+ # Read shape:
+ if self.sequential_file_mode:
+ total = len(self.sequential_file_list)
+ tmpfname = self.sequential_file_dict[self.sequential_file_list[0]]
+ try:
+ img = fabio.open(tmpfname)
+ except:
+ QMessageBox.warning(self, 'Message', 'Automatic format recognition procedure failed or perhaps you are trying to open a binary data block...\n\n ...Switch to manual procedure ')
+ dial = BinDialog(self)
+ dim1, dim2, offset, bytecode, endian = dial.exec_()
+ if dim1 is not None and dim2 is not None:
+ if endian == 'Short':
+ endian = '<'
+ else:
+ endian = '>'
+ img = fabio.binaryimage.binaryimage()
+ img.read(tmpfname, dim1, dim2, offset, bytecode, endian)
+ img.header = {'Info': 'No header information available in binary data blocks'}
+ else:
+ return
+ data = img.data
+ else:
+ total = len(self.data_series)
+ data = self.data_series[0]
+ if self.transform_data_series:
+ tmpdata = self.apply_queued_transformations(data)
+ else:
+ tmpdata = data
+ shape = tmpdata.shape
+ dataset = nxdata.create_dataset("data", shape=(total,) + shape, dtype=numpy.float32, chunks=(1,) + shape, compression="gzip")
+ dataset.attrs["interpretation"] = "image"
+ dataset.attrs["signal"] = "1"
+ if self.sequential_file_mode:
+ for iid, imgkey in enumerate(self.sequential_file_list):
+ tmpfname = self.sequential_file_dict[imgkey]
+ try:
+ img = fabio.open(tmpfname)
+ except:
+ if dim1 is not None and dim2 is not None:
+ if endian == 'Short':
+ endian = '<'
+ else:
+ endian = '>'
+ img = fabio.binaryimage.binaryimage()
+ img.read(tmpfname, dim1, dim2, offset, bytecode, endian)
+ img.header = {'Info': 'No header information available in binary data blocks'}
+ else:
+ continue
+ self.progressBar.setValue((float(iid + 1) / (total)) * 100.)
+ self.log.appendPlainText('Converting and saving file %s. saving file number %d' % (tmpfname, iid))
+ QCoreApplication.processEvents()
+ if self.transform_data_series:
+ tmpdata = self.apply_queued_transformations(img.data)
+ else:
+ tmpdata = img.data
+ dataset[iid] = tmpdata
+ else:
+ for iid, data in enumerate(self.data_series):
+ self.log.appendPlainText('Saving file number %d' % iid)
+ self.progressBar.setValue((float(iid + 1) / (total)) * 100.)
+ QCoreApplication.processEvents()
+ if self.transform_data_series:
+ tmpdata = self.apply_queued_transformations(data)
+ else:
+ tmpdata = data
+ dataset[iid] = tmpdata
+ self.statusBar().clear()
+ self.progressBar.setValue(0)
+ self.log.appendPlainText('Hdf5 Recording: Complete')
+
+ def add_extention_if_absent(self, fname, format_):
+ posslash = fname.rfind("/")
+ posdot = fname.rfind(".")
+ if posdot > posslash:
+ return fname
+ else:
+ return fname + format_[1:]
+
+ def convert_and_write(self, fname, format_, data, header):
+ if format_ == '*.bin':
+ out = open(fname, mode="wb")
+ out.write(data.tostring())
+ out.close()
+ return
+ elif format_ == '*.marccd':
+ out = fabio.marccdimage.marccdimage(data=data, header=header)
+ elif format_ == '*.edf':
+ out = fabio.edfimage.edfimage(data=data, header=header)
+ elif format_ == '*.tiff':
+ out = fabio.tifimage.tifimage(data=data, header=header)
+ elif format_ == '*.cbf':
+ out = fabio.cbfimage.cbfimage(data=data, header=header)
+ elif format_ in ['*.mar3450', '*.mar2300']:
+ data = self.padd_mar(data, format_)
+ out = fabio.mar345image.mar345image(data=data, header=header)
+ elif format_ == '*.img':
+ out = fabio.OXDimage.OXDimage(data=data, header=header)
+ elif format_ == '*.sfrm':
+ out = fabio.brukerimage.brukerimage(data=data, header=header)
+ else:
+ raise Warning("Unknown format: %s" % format_)
+ self.statusBar().showMessage('Writing file %s to %s format, please wait ...' % (fname, format_[2:]))
+ self.log.appendPlainText('Writing file %s to %s format' % (fname, format_[2:]))
+ QCoreApplication.processEvents()
+ out.write(fname)
+ self.statusBar().clearMessage()
+
+ def convert_and_write_multiple_files(self, fname, format_):
+
+ if self.sequential_file_mode:
+ total = len(self.sequential_file_list)
+ ii = 0
+ for imgkey in self.sequential_file_list:
+ tmpfname = self.sequential_file_dict[imgkey]
+ try:
+ img = fabio.open(tmpfname)
+ except:
+ QMessageBox.warning(self, 'Message', 'Automatic format recognition procedure failed or pehaps you are trying to open a binary data block...\n\n ...Switch to manual procedure ')
+ dial = BinDialog(self)
+ dim1, dim2, offset, bytecode, endian = dial.exec_()
+ if dim1 is not None and dim2 is not None:
+ if endian == 'Short':
+ endian = '<'
+ else:
+ endian = '>'
+ img = fabio.binaryimage.binaryimage()
+ img.read(tmpfname, dim1, dim2, offset, bytecode, endian)
+ img.header = {'Info':'No header information available in binary data blocks'}
+ else:
+ continue
+ self.progressBar.setValue((float(ii + 1) / (total)) * 100.)
+ self.log.appendPlainText('Converting file %s' % tmpfname)
+ QCoreApplication.processEvents()
+ if self.transform_data_series:
+ tmpdata = self.apply_queued_transformations(img.data)
+ else:
+ tmpdata = img.data
+ self.convert_and_write(('%s_%s%s' % (fname, self.counter_format, format_[1:])) % ii, format_, tmpdata, img.header)
+ ii += 1
+ else:
+ total = len(self.data_series)
+ for i in range(len(self.data_series)):
+ tmpdata = self.data_series[i]
+ tmpheader = self.header_series[i]
+ tmpfname = ('%s_%s%s' % (fname, self.counter_format, format_[1:])) % i
+ self.progressBar.setValue((float(i + 1) / (total)) * 100.)
+ self.log.appendPlainText('Converting file %s' % i)
+ QCoreApplication.processEvents()
+ if self.transform_data_series:
+ tmpdata = self.apply_queued_transformations(tmpdata)
+ self.convert_and_write(tmpfname, format_, tmpdata, tmpheader)
+ self.progressBar.setValue(0)
+ self.log.appendPlainText('Convertion to %s: Complete' % format_[2:])
+
+ def extract_format_from_string(self, format_long):
+ for fmt in output_format:
+ if fmt in format_long:
+ return fmt
+ raise Warning("Unknown format: %s" % format_long)
+
+#--------------------------------------------------------------------------------------------------------
+# Transformation
+#--------------------------------------------------------------------------------------------------------
+ def horizontal_mirror(self):
+ if self.transform_data_series:
+ if self.sequential_file_mode:
+ self.transformation_queue.addItem('horizontal_mirror')
+ self.transform_list += ['horizontal_mirror']
+ self.log.appendPlainText('Add horizontal mirror to transformations queue')
+ QCoreApplication.processEvents()
+ else:
+ total = len(self.data_series)
+ if not total:
+ QMessageBox.warning(self, 'Warning', "Could not transform image if no data have been loaded")
+ return
+ for i in range(len(self.data_series)):
+ self.data_series[i] = numpy.flipud(self.data_series[i])[:]
+ self.progressBar.setValue((float(i + 1) / (total)) * 100.)
+ self.log.appendPlainText('Applying horizontal mirror to data series: image %d' % i)
+ QCoreApplication.processEvents()
+ iid = self.imgDict[str(self.images_list.currentText())]
+ self.select_new_image(None, imgID=iid)
+ else:
+
+ if self.data.any():
+ self.data = numpy.flipud(self.data)[:]
+ iid = self.imgDict[str(self.images_list.currentText())]
+ self.data_series[iid] = self.data[:]
+ self.log.appendPlainText('Applying horizontal mirror to current data')
+ self.on_draw()
+ else:
+ QMessageBox.warning(self, 'Warning', "Could not transform image if no data have been loaded")
+ self.progressBar.setValue(0)
+
+ def vertical_mirror(self):
+ if self.transform_data_series:
+ if self.sequential_file_mode:
+ self.transformation_queue.addItem('vertical_mirror')
+ self.transform_list += ['vertical_mirror']
+ self.log.appendPlainText('Add vertical mirror to transformations queue')
+ QCoreApplication.processEvents()
+ else:
+ total = len(self.data_series)
+ if not total:
+ QMessageBox.warning(self, 'Warning', "Could not transform image if no data have been loaded")
+ return
+ for i in range(len(self.data_series)):
+ self.data_series[i] = numpy.fliplr(self.data_series[i])[:]
+ self.progressBar.setValue((float(i + 1) / (total)) * 100.)
+ self.log.appendPlainText('Applying vertical mirror to data series: image %d' % i)
+ QCoreApplication.processEvents()
+ iid = self.imgDict[str(self.images_list.currentText())]
+ self.select_new_image(None, imgID=iid)
+ else:
+ if self.data.any():
+ self.data = numpy.fliplr(self.data)[:]
+ iid = self.imgDict[str(self.images_list.currentText())]
+ self.data_series[iid] = self.data[:]
+ self.log.appendPlainText('Applying vertical mirror to current data')
+ self.on_draw()
+ else:
+ QMessageBox.warning(self, 'Warning', "Could not transform image if no data have been loaded")
+ self.progressBar.setValue(0)
+
+ def transposition(self):
+ if self.transform_data_series:
+ if self.sequential_file_mode:
+ self.transformation_queue.addItem('transposition')
+ self.transform_list += ['transposition']
+ self.log.appendPlainText('Add transposition to transformations queue')
+ QCoreApplication.processEvents()
+ else:
+ total = len(self.data_series)
+ if not total:
+ QMessageBox.warning(self, 'Warning', "Could not transform image if no data have been loaded")
+ return
+ for i in range(len(self.data_series)):
+ self.data_series[i] = self.data_series[i].transpose()[:]
+ self.progressBar.setValue((float(i + 1) / (total)) * 100.)
+ self.log.appendPlainText('Applying transposition to data series: image %d' % i)
+ QCoreApplication.processEvents()
+ iid = self.imgDict[str(self.images_list.currentText())]
+ self.select_new_image(None, imgID=iid)
+ else:
+ if self.data.any():
+ self.data = self.data.transpose()[:]
+ iid = self.imgDict[str(self.images_list.currentText())]
+ self.data_series[iid] = self.data[:]
+ self.log.appendPlainText('Applying transposition to current data')
+ self.on_draw()
+ else:
+ QMessageBox.warning(self, 'Warning', "Could not transform image if no data have been loaded")
+ self.progressBar.setValue(0)
+
+ def rotation_90(self):
+ if self.transform_data_series:
+ if self.sequential_file_mode:
+ self.transformation_queue.addItem('rotation(+90)')
+ self.transform_list += ['rotation(+90)']
+ self.log.appendPlainText('Add + 90 rotation to transformations queue')
+ QCoreApplication.processEvents()
+ else:
+ total = len(self.data_series)
+ if not total:
+ QMessageBox.warning(self, 'Warning', "Could not transform image if no data have been loaded")
+ return
+ for i in range(len(self.data_series)):
+ self.data_series[i] = numpy.rot90(self.data_series[i])[:]
+ self.progressBar.setValue((float(i + 1) / (total)) * 100.)
+ self.log.appendPlainText('Applying + 90 rotation to data series: image %d' % i)
+ QCoreApplication.processEvents()
+ iid = self.imgDict[str(self.images_list.currentText())]
+ self.select_new_image(None, imgID=iid)
+ else:
+ if self.data.any():
+ self.data = numpy.rot90(self.data)[:]
+ iid = self.imgDict[str(self.images_list.currentText())]
+ self.data_series[iid] = self.data[:]
+ self.log.appendPlainText('Applying + 90 rotation to current data')
+ self.on_draw()
+ else:
+ QMessageBox.warning(self, 'Warning', "Could not transform image if no data have been loaded")
+ self.progressBar.setValue(0)
+
+ def rotation_180(self):
+ if self.transform_data_series:
+ if self.sequential_file_mode:
+ self.transformation_queue.addItem('rotation(+180)')
+ self.transform_list += ['rotation(+180)']
+ self.log.appendPlainText('Add + 180 rotation to transformations queue')
+ QCoreApplication.processEvents()
+ else:
+ total = len(self.data_series)
+ if not total:
+ QMessageBox.warning(self, 'Warning', "Could not transform image if no data have been loaded")
+ return
+ for i in range(len(self.data_series)):
+ self.data_series[i] = numpy.rot90(self.data_series[i], 2)[:]
+ self.progressBar.setValue((float(i + 1) / (total)) * 100.)
+ self.log.appendPlainText('Applying + 180 rotation to data series: image %d' % i)
+ QCoreApplication.processEvents()
+ iid = self.imgDict[str(self.images_list.currentText())]
+ self.select_new_image(None, imgID=iid)
+ else:
+ if self.data.any():
+ self.data = numpy.rot90(self.data, 2)[:]
+ iid = self.imgDict[str(self.images_list.currentText())]
+ self.data_series[iid] = self.data[:]
+ self.log.appendPlainText('Applying + 180 rotation to current data')
+ self.on_draw()
+ else:
+ QMessageBox.warning(self, 'Warning', "Could not transform image if no data have been loaded")
+ self.progressBar.setValue(0)
+
+ def rotation_270(self):
+ if self.transform_data_series:
+ if self.sequential_file_mode:
+ self.transformation_queue.addItem('rotation(-90)')
+ self.transform_list += ['rotation(-90)']
+ self.log.appendPlainText('Add - 90 rotation to transformations queue')
+ QCoreApplication.processEvents()
+ else:
+ total = len(self.data_series)
+ if not total:
+ QMessageBox.warning(self, 'Warning', "Could not transform image if no data have been loaded")
+ return
+ for i in range(len(self.data_series)):
+ self.data_series[i] = numpy.rot90(self.data_series[i], 3)[:]
+ self.progressBar.setValue((float(i + 1) / (total)) * 100.)
+ self.log.appendPlainText('Applying - 90 rotation to data series: image %d' % i)
+ QCoreApplication.processEvents()
+ iid = self.imgDict[str(self.images_list.currentText())]
+ self.select_new_image(None, imgID=iid)
+ else:
+ if self.data.any():
+ self.data = numpy.rot90(self.data, 3)[:]
+ iid = self.imgDict[str(self.images_list.currentText())]
+ self.data_series[iid] = self.data[:]
+ self.log.appendPlainText('Applying - 90 rotation to current data')
+ self.on_draw()
+ else:
+ QMessageBox.warning(self, 'Warning', "Could not transform image if no data have been loaded")
+ self.progressBar.setValue(0)
+
+ def mask(self):
+ fname = QFileDialog.getOpenFileName(self, 'Select and import a boolean mask from binary data block file')
+ fname = str(fname)
+ if fname:
+ dial = BinDialog(self)
+ dim1, dim2, offset, bytecode, endian = dial.exec_()
+ if dim1 is not None and dim2 is not None:
+ if endian == 'Short':
+ endian = '<'
+ else:
+ endian = '>'
+ img = fabio.binaryimage.binaryimage()
+ img.read(fname, dim1, dim2, offset, bytecode, endian)
+ self.mask = img.data[:]
+ if self.transform_data_series:
+ if self.sequential_file_mode:
+ self.transformation_queue.addItem('masking')
+ self.transform_list += ['masking']
+ self.log.appendPlainText('Add masking to transformations queue')
+ QCoreApplication.processEvents()
+ else:
+ total = len(self.data_series)
+ if not total:
+ QMessageBox.warning(self, 'Warning', "Could not transform image if no data have been loaded")
+ return
+ for i in range(len(self.data_series)):
+ if self.data_series[i].shape != self.mask.shape:
+ QMessageBox.warning(self, 'Warning', "Mask and image have different shapes, skipping image %d" % i)
+ self.log.appendPlainText('Mask and image have different shapes, skipping image %d' % i)
+ else:
+ self.data_series[i] = self.mask * self.data_series[i]
+ self.progressBar.setValue((float(i + 1) / (total)) * 100.)
+ self.log.appendPlainText('Applying mask to data series: image %d' % i)
+ QCoreApplication.processEvents()
+ iid = self.imgDict[str(self.images_list.currentText())]
+ self.select_new_image(None, imgID=iid)
+ else:
+ if self.data.any():
+ self.data = self.mask * self.data
+ iid = self.imgDict[str(self.images_list.currentText())]
+ self.data_series[iid] = self.data[:]
+ self.on_draw()
+ self.statusBar().showMessage('Binary boolean mask loaded and applied', 2000)
+ self.log.appendPlainText('Binary boolean mask loaded and applied')
+ QCoreApplication.processEvents()
+ else:
+ QMessageBox.warning(self, 'Warning', "Could not transform image if no data have been loaded")
+ else:
+ return
+ self.progressBar.setValue(0)
+
+ def apply_queued_transformations(self, data):
+ transformations = ['horizontal_mirror', 'vertical_mirror', 'transposition', 'rotation(+90)', 'rotation(+180)', 'rotation(-90)', 'masking', 'downsampling']
+ for t in self.transform_list:
+ if t in transformations:
+ if t == 'horizontal_mirror':
+ data = numpy.flipud(data)[:]
+ self.log.appendPlainText('horizontal_mirror Done')
+ elif t == 'vertical_mirror':
+ data = numpy.fliplr(data)[:]
+ self.log.appendPlainText('vertical_mirror Done')
+ elif t == 'transposition':
+ data = data.transpose()[:]
+ self.log.appendPlainText('transposition Done')
+ elif t == 'rotation(+90)':
+ data = numpy.rot90(data)[:]
+ self.log.appendPlainText('rotation(+90) Done')
+ elif t == 'rotation(+180)':
+ data = numpy.rot90(data, 2)[:]
+ self.log.appendPlainText('rotation(+180) Done')
+ elif t == 'rotation(-90)':
+ data = numpy.rot90(data, 3)[:]
+ self.log.appendPlainText('rotation(-90) Done')
+ elif t == 'masking':
+ data = self.mask * data
+ self.log.appendPlainText('masking Done')
+ else:
+ raise Warning('Unknown transformation %s' % t)
+ return data
+
+ def transformation_options(self):
+ if self.transform_option_action.isChecked():
+ self.transform_data_series = True
+ else:
+ self.transform_data_series = False
+
+ def clear_transform_list(self):
+ self.transform_list = []
+ self.transformation_queue.clear()
+
+ def downsample(self):
+ dial = down_sampling_Dialog()
+ thick, start_angle, step_angle = dial.exec_()
+ if thick is not None:
+ info = QFileDialog.getSaveFileNameAndFilter(self, "Save downsampled data series as multiple files", QDir.currentPath(), filter=self.tr("binary data block (*.bin);;cbf image (*.cbf);;edf image (*.edf);;oxford diffraction image (*.img);;mar2300 image(*.mar2300);;mar3450 image (*.mar3450);;marccd image (*.marccd));;tiff image (*.tiff);;bruker image (*.sfrm)"))
+ if self.data_series or self.sequential_file_list:
+ if str(info[0]) != '' and str(info[1]) != '':
+ format_ = self.extract_format_from_string(str(info[1]))
+ fname = self.os.path.splitext(str(info[0]))[0]
+
+ if self.sequential_file_mode:
+ total = len(self.sequential_file_list)
+ img = fabio.open(self.sequential_file_dict[self.sequential_file_list[0]])
+ stack = numpy.zeros_like(img.data)
+ t0 = time.time()
+ subtotal = (total // thick) * thick
+ for i in range(subtotal):
+ j = i % thick
+ k = i // thick
+ imgkey = self.sequential_file_list[i]
+ tmpfname = self.sequential_file_dict[imgkey]
+ try:
+ img = fabio.open(tmpfname)
+ except:
+ QMessageBox.warning(self, 'Message', 'Automatic format recognition procedure failed or pehaps you are trying to open a binary data block...\n\n ...Switch to manual procedure ')
+ dial = BinDialog(self)
+ dim1, dim2, offset, bytecode, endian = dial.exec_()
+ if dim1 is not None and dim2 is not None:
+ if endian == 'Short':
+ endian = '<'
+ else:
+ endian = '>'
+ img = fabio.binaryimage.binaryimage()
+ img.read(tmpfname, dim1, dim2, offset, bytecode, endian)
+ img.header = {'Info':'No header information available in binary data blocks'}
+ else:
+ continue
+ if img.data.shape != stack.shape:
+ self.log.appendPlainText("Error image shape: %s summed data shape: %s" % (img.data.shape, stack.shape))
+ continue
+ numpy.add(stack, img.data, stack)
+ self.progressBar.setValue((float(i + 1) / (subtotal)) * 100.)
+ self.log.appendPlainText('File %s stacked' % imgkey)
+ QCoreApplication.processEvents()
+ if j == thick - 1:
+ self.log.appendPlainText('stack number %d summing up' % k)
+ QCoreApplication.processEvents()
+ if format_ in ['*.mar3450', '*.mar2300']:
+ img.header["PHI_START"] = '%.3f' % (start_angle + step_angle * (i - thick + 1))
+ img.header["PHI_END"] = '%.3f' % (start_angle + step_angle * (i))
+ self.convert_and_write(('%s_%s%s' % (fname, self.counter_format, format_[1:])) % k, format_, stack, img.header)
+ t1 = time.time()
+ print('time: %s' % (t1 - t0))
+ stack = numpy.zeros_like(img.data)
+ t0 = time.time()
+ else:
+ total = len(self.data_series)
+ stack = numpy.zeros_like(self.data_series[0])
+ subtotal = (total // thick) * thick
+ for i in range(subtotal):
+ j = i % thick
+ k = i // thick
+ data = self.data_series[i]
+ if data.shape != stack.shape:
+ self.log.appendPlainText("Error image shape: %s summed data shape: %s" % (img.data.shape, stack.shape))
+ continue
+ numpy.add(stack, data, stack)
+ self.progressBar.setValue((float(i + 1) / (subtotal)) * 100.)
+ self.log.appendPlainText('File number %d stacked' % i)
+ QCoreApplication.processEvents()
+ if j == thick - 1:
+ self.log.appendPlainText('stack number %d summing up' % k)
+ QCoreApplication.processEvents()
+ if format_ in ['*.mar3450', '*.mar2300']:
+ self.header_series[i]["PHI_START"] = '%.3f' % (start_angle + step_angle * (i - thick + 1))
+ self.header_series[i]["PHI_END"] = '%.3f' % (start_angle + step_angle * (i))
+ self.convert_and_write(('%s_%s%s' % (fname, self.counter_format, format_[1:])) % k, format_, stack, self.header_series[i])
+ stack = numpy.zeros_like(data)
+ self.progressBar.setValue(0)
+ self.log.appendPlainText('Downsampling: Complete')
+ QCoreApplication.processEvents()
+ else:
+ if str(info[0]) != '' and str(info[1]) != '':
+ QMessageBox.warning(self, 'Warning', "Could not save image as file if no data have been loaded")
+
+
+#--------------------------------------------------------------------------------------------------------
+# Miscelaneous
+#--------------------------------------------------------------------------------------------------------
+
+ def select_new_image(self, name, imgID=None):
+ if imgID is not None:
+ iid = imgID
+ else:
+ iid = self.imgDict[str(name)]
+ self.data = self.data_series[iid]
+ self.header = self.header_series[iid]
+
+ self.headerTextEdit.setPlainText(str(self.format_header(self.header)))
+ self.on_draw()
+
+ def on_pick(self, event):
+ if event.inaxes and self.data.any():
+ x = int(round(event.xdata))
+ y = int(round(event.ydata))
+ if x < self.data.shape[1] and y < self.data.shape[0]:
+ i = self.data[y, x]
+ self.pix_coords_label.setText("Pixel coordinates and intensity: x =%6d, y =%6d, i =%6g" % (x, y, i))
+ else:
+ self.pix_coords_label.setText("Pixel coordinates and intensity: x = None , y = None , i = None ")
+ else:
+ self.pix_coords_label.setText("Pixel coordinates and intensity: x = None , y = None , i = None ")
+
+ def on_draw(self):
+ """ Redraws the figure"""
+ self.statusBar().showMessage('Loading display ...')
+ QCoreApplication.processEvents()
+ # clear the axes and redraw a new plot
+ self.axes.clear()
+ # self.axes.imshow(numpy.log(numpy.clip(self.data,1.0e-12,1.0e260) ),interpolation = 'nearest')
+ self.axes.imshow(numpy.log(self.data), interpolation='nearest')
+
+ self.axes.set_visible(True)
+ if self.axes.get_ylim()[0] < self.axes.get_ylim()[1]:
+ self.axes.set_ylim(self.axes.get_ylim()[::-1])
+ self.canvas.draw()
+ self.statusBar().clearMessage()
+
+ def batch_to_view(self):
+ items = self.imagelistWidget.selectedItems()
+ iid = 0
+ item = items[0]
+ item = str(item.text())
+ hdfxtens = ['.h5', '.H5', '.hdf', '.HDF', 'hdf5', '.HDF5']
+ for xtens in hdfxtens:
+ if xtens in item:
+ QMessageBox.warning(self, 'Message', "Can't display hdf archive from batch mode ")
+ return
+ if self.sequential_file_mode:
+ self.data_series = []
+ self.header_series = []
+ self.imgDict = {}
+ self.images_list.clear()
+ self.headerTextEdit.clear()
+ self.axes.clear()
+ self.canvas.draw()
+ self.statusBar().showMessage('Import image %s in the View Mode tab, please wait ...' % item)
+ self.log.appendPlainText('Import image %s in the View Mode tab' % item)
+ QCoreApplication.processEvents()
+ fname = self.sequential_file_dict[item]
+ extract_fname = os.path.splitext(os.path.basename(fname))[0]
+ try:
+ img = fabio.open(fname)
+ except:
+ QMessageBox.warning(self, 'Message', 'Automatic format recognition procedure failed or pehaps you are trying to open a binary data block...\n\n ...Switch to manual procedure ')
+ dial = BinDialog(self)
+ dim1, dim2, offset, bytecode, endian = dial.exec_()
+ if dim1 is not None and dim2 is not None:
+ if endian == 'Short':
+ endian = '<'
+ else:
+ endian = '>'
+ img = fabio.binaryimage.binaryimage()
+ img.read(fname, dim1, dim2, offset, bytecode, endian)
+ img.header = {'Info': 'No header information available in binary data blocks'}
+ else:
+ return
+ if img.nframes > 1:
+ for img_idx in range(img.nframes):
+ frame = img.getframe(img_idx)
+ self.data_series.append(frame.data[:])
+ self.header_series.append(frame.header.copy())
+ frame_name = "%s # %i" % (extract_fname, img_idx)
+ self.images_list.addItem(frame_name)
+ self.imagelistWidget.addItem(frame_name)
+ self.imgDict[frame_name] = iid
+ self.sequential_file_list += [frame_name]
+ self.sequential_file_dict[frame_name] = fname
+ iid += 1
+ else:
+ self.data_series.append(img.data[:])
+ self.header_series.append(img.header.copy())
+ extract_fname = self.extract_fname_from_path(fname)
+ self.images_list.addItem(extract_fname)
+ self.imagelistWidget.addItem(extract_fname)
+ self.imgDict[extract_fname] = iid
+ self.sequential_file_list += [extract_fname]
+ self.sequential_file_dict[extract_fname] = fname
+ iid += 1
+
+ self.statusBar().clearMessage()
+ if self.data_series:
+ self.select_new_image(None, imgID=0)
+ self.tabWidget.setCurrentIndex(0)
+
+ def set_counter_format_option(self):
+ dial = counter_format_option_Dialog(self.counter_format)
+ self.counter_format = dial.exec_()
+
+ def padd_mar(self, data, format_):
+ dim1, dim2 = data.shape
+
+ if format_ == '*.mar2300':
+ size = 2300
+ else:
+ size = 3450
+
+ left = (size - dim1) // 2
+ right = size - (dim1 + left)
+ up = (size - dim2) // 2
+ down = size - (dim2 + up)
+
+ out = numpy.zeros((size, size))
+
+ if left > 0: # pad
+ outlm = left
+ inlm = 0
+ else: # crop
+ outlm = 0
+ inlm = -left
+ if right > 0: # pad
+ outrm = -right
+ inrm = dim1
+ else: # crop
+ outrm = size
+ inrm = right
+ if up > 0: # pad
+ outum = up
+ inum = 0
+ else: # crop
+ outum = 0
+ inum = -up
+ if down > 0: # pad
+ outdm = -down
+ indm = dim2
+ else: # crop
+ outdm = size
+ indm = down
+
+ out[outlm:outrm, outum:outdm] = data[inlm:inrm, inum:indm]
+ return out
+
+ def sequential_option(self, state):
+ if not self.h5_loaded:
+ if state == Qt.Checked:
+ self.sequential_file_mode = True
+ else:
+ self.sequential_file_mode = False
+ else:
+ self.filecheckBox.stateChanged.disconnect()
+ self.filecheckBox.setCheckState(False)
+ self.sequential_file_mode = False
+ self.filecheckBox.stateChanged.connect(self.sequential_option)
+ QMessageBox.warning(self, 'Message', 'Sequential file mode is not compatible with hdf5 input file: option removed')
+
+#--------------------------------------------------------------------------------------------------------
+# Main Frame
+#--------------------------------------------------------------------------------------------------------
+
+ def create_main_frame(self):
+
+ self.tabWidget = QTabWidget()
+ tab1 = QWidget()
+ self.tabWidget.addTab(tab1, "View Mode")
+ tab2 = QWidget()
+ self.tabWidget.addTab(tab2, "Batch Mode")
+ #--------------------------------------------------------------------------------------------------------
+ # Tab 1
+ #--------------------------------------------------------------------------------------------------------
+
+ # Create the mpl Figure and FigCanvas objects.
+ # 100 dots-per-inch
+ self.dpi = 100
+ # self.fig = Figure((100, 100), dpi=self.dpi)
+ self.fig = Figure(dpi=self.dpi)
+ self.canvas = FigureCanvas(self.fig)
+ self.canvas.setParent(tab1)
+
+ # Since we have only one plot, we can use add_axes
+ # instead of add_subplot, but then the subplot
+ # configuration tool in the navigation toolbar wouldn't
+ # work.
+ #
+ self.axes = self.fig.add_subplot(111)
+ self.axes.set_visible(False)
+ # Bind the 'pick' event for clicking on one of the bars
+ self.canvas.mpl_connect('motion_notify_event', self.on_pick)
+
+ # Create the navigation toolbar, tied to the canvas
+ self.mpl_toolbar = NavigationToolbar(self.canvas, tab1, coordinates=False)
+
+ # Other GUI controls
+ selector_label = QLabel('Active Image:')
+ self.images_list = QComboBox(self)
+ self.images_list.activated[str].connect(self.select_new_image)
+
+ viewer_label = QLabel("Images Viewer: ", self)
+ self.pix_coords_label = QLabel("Pixel coordinates and intensity: x = None , y = None , i = None ", self)
+ self.mpl_toolbar.addWidget(self.pix_coords_label)
+
+ self.headerTextEdit = QPlainTextEdit(tab1)
+ self.headerTextEdit.setReadOnly(True)
+ # Layout with box sizers
+
+ header_vbox = QVBoxLayout()
+ header_label = QLabel("Header Info:", self)
+ header_vbox.addWidget(header_label)
+ header_vbox.addWidget(self.headerTextEdit)
+
+ hbox = QHBoxLayout()
+ hbox.addWidget(selector_label, alignment=Qt.AlignRight)
+ hbox.addWidget(self.images_list)
+
+ vbox = QVBoxLayout()
+ vbox.addWidget(viewer_label, alignment=Qt.AlignVCenter)
+ vbox.addWidget(self.canvas, alignment=Qt.AlignVCenter)
+ vbox.addWidget(self.mpl_toolbar, alignment=Qt.AlignVCenter)
+ vbox.addLayout(hbox)
+
+ left = QWidget()
+ right = QWidget()
+
+ left.setLayout(header_vbox)
+ right.setLayout(vbox)
+ splitter = QSplitter(Qt.Horizontal)
+ splitter.addWidget(left)
+ splitter.addWidget(right)
+ Bighbox = QHBoxLayout()
+ Bighbox.addWidget(splitter)
+
+ tab1.setLayout(Bighbox)
+
+ #--------------------------------------------------------------------------------------------------------
+ # Tab 2
+ #--------------------------------------------------------------------------------------------------------
+
+ imagelistvbox = QVBoxLayout()
+
+ imagelistlabel = QLabel(tab2)
+ imagelistlabel.setText("Images List:")
+ self.imagelistWidget = QListWidget(tab2)
+ import_view_button = QPushButton('Export image to View Mode', tab2)
+ import_view_button.clicked.connect(self.batch_to_view)
+
+ imagelistvbox.addWidget(imagelistlabel)
+ imagelistvbox.addWidget(self.imagelistWidget)
+ imagelistvbox.addWidget(import_view_button)
+
+ rightsidevbox = QVBoxLayout()
+
+ optiongroupBox = QGroupBox(tab2)
+ optiongroupBox.setTitle("File Modes:")
+
+ optionbox = QVBoxLayout()
+
+ self.butttonGroup = QButtonGroup()
+
+ self.filecheckBox = QCheckBox()
+ self.filecheckBox.setText("Sequential access (for large data series)")
+ self.filecheckBox.stateChanged.connect(self.sequential_option)
+ self.butttonGroup.addButton(self.filecheckBox)
+
+ self.filecheckBox2 = QCheckBox()
+ self.filecheckBox2.setText("Direct access (all images are store in memory simultaneously)")
+ self.filecheckBox2.setChecked(True)
+ self.butttonGroup.addButton(self.filecheckBox2)
+
+ self.butttonGroup.setExclusive(True)
+
+ optionbox.addWidget(self.filecheckBox)
+ optionbox.addWidget(self.filecheckBox2)
+
+ optiongroupBox.setLayout(optionbox)
+
+ rightsidevbox.addWidget(optiongroupBox)
+
+ splitter3 = QSplitter(Qt.Vertical)
+
+ queuegroupBox = QGroupBox(tab2)
+ queuegroupBox.setTitle("Transformations Queue:")
+
+ queuebox = QVBoxLayout()
+ self.transformation_queue = QListWidget(tab2)
+ queuebox.addWidget(self.transformation_queue)
+ clear_trans_list_button = QPushButton('Clear Transformation List', tab2)
+ clear_trans_list_button.clicked.connect(self.clear_transform_list)
+ queuebox.addWidget(clear_trans_list_button)
+
+ queuegroupBox.setLayout(queuebox)
+
+ splitter3.addWidget(queuegroupBox)
+
+ loggroupBox = QGroupBox(tab2)
+ loggroupBox.setTitle("Log View:")
+
+ logbox = QHBoxLayout()
+ self.log = QPlainTextEdit()
+ logbox.addWidget(self.log)
+
+ loggroupBox.setLayout(logbox)
+ splitter3.addWidget(loggroupBox)
+ splitter3.setStretchFactor(1, 1)
+
+ rightsidevbox.addWidget(splitter3)
+
+ self.progressBar = QProgressBar(tab2)
+ self.progressBar.setProperty("value", 0)
+ rightsidevbox.addWidget(self.progressBar)
+
+ left2 = QWidget()
+ right2 = QWidget()
+ left2.setLayout(imagelistvbox)
+ right2.setLayout(rightsidevbox)
+ splitter2 = QSplitter(Qt.Horizontal)
+ splitter2.addWidget(left2)
+ splitter2.addWidget(right2)
+ splitter2.setStretchFactor(1, 2)
+
+ Bighbox2 = QHBoxLayout()
+ Bighbox2.addWidget(splitter2)
+
+ tab2.setLayout(Bighbox2)
+
+ self.setCentralWidget(self.tabWidget)
+
+ def create_status_bar(self):
+ self.status_text = QLabel('')
+ self.statusBar().addWidget(self.status_text, 1)
+ self.statusBar().showMessage('Thanks for using FabIO viewer.', 5000)
+
+ def on_about(self):
+ msg = [__doc__,
+ "",
+ "Version: \t\t%s" % __version__,
+ "FabIO version: \t%s" % fabio.version,
+ "Author: \t\t%s" % __author__,
+ "Copyright: \t\t%s" % __copyright__,
+ "License: \t\t%s" % __licence__]
+
+ QMessageBox.about(self, "About FabIO Viewer", os.linesep.join(msg))
+
+#--------------------------------------------------------------------------------------------------------
+# Menu
+#--------------------------------------------------------------------------------------------------------
+
+ def create_menu(self):
+ #0----------------------------------------------
+ self.file_menu = self.menuBar().addMenu("&File")
+ #1----------------------------------------------
+ self.open_menu = self.file_menu.addMenu("&Open")
+ #2----------------------------------------------
+ load_data_series_action = self.create_action("&Image(s)",
+ shortcut="", slot=self.open_data_series,
+ tip="Load single file and data series (files sequence)")
+
+ self.add_actions(self.open_menu, (load_data_series_action,))
+ #2----------------------------------------------
+ load_h5_data_series_action = self.create_action("&Hdf5 data series",
+ shortcut="", slot=self.open_h5_data_series,
+ tip="Load single file and data series (files sequence)")
+
+ self.add_actions(self.open_menu, (load_h5_data_series_action,))
+ #1----------------------------------------------
+ self.save_as_menu = self.file_menu.addMenu("&Save")
+ #2----------------------------------------------
+ save_as_action = self.create_action("&Active image", slot=self.save_as,
+ shortcut="", tip="Save/Convert the image which is currently displayed")
+
+ self.add_actions(self.save_as_menu, (save_as_action,))
+
+ #2----------------------------------------------
+ self.save_data_series_menu = self.save_as_menu.addMenu("&Data series as")
+ #3----------------------------------------------
+ save_data_series_as_multiplefile_action = self.create_action("&Multiple files", slot=self.save_data_series_as_multiple_file,
+ shortcut="", tip="Save/Convert the set of images currently loaded into the images list")
+
+ self.add_actions(self.save_data_series_menu, (save_data_series_as_multiplefile_action,))
+ #3----------------------------------------------
+ save_data_series_as_singlehdf_action = self.create_action("&Hdf5 archive", slot=self.save_data_series_as_singlehdf,
+ shortcut="", tip="Save/Convert the set of images currently loaded into the images list")
+
+ self.add_actions(self.save_data_series_menu, (save_data_series_as_singlehdf_action,))
+
+ #1----------------------------------------------
+ quit_action = self.create_action("&Quit", slot=self.close,
+ shortcut="Ctrl+Q", tip="Close the application")
+
+ self.add_actions(self.file_menu, (quit_action,))
+
+ #1----------------------------------------------
+ self.transform_menu = self.menuBar().addMenu("&Transform")
+ #2----------------------------------------------
+ self.mirror_menu = self.transform_menu.addMenu("&Mirror")
+ #3----------------------------------------------
+ horizontal_mirror_action = self.create_action("&Horizontal",
+ shortcut='', slot=self.horizontal_mirror,
+ tip="Horizontal mirror")
+
+ self.add_actions(self.mirror_menu, (horizontal_mirror_action,))
+
+ #3 ----------------------------------------------
+ vertical_mirror_action = self.create_action("&Vertical",
+ shortcut='', slot=self.vertical_mirror,
+ tip="Vertical mirror")
+
+ self.add_actions(self.mirror_menu, (vertical_mirror_action,))
+
+ #3----------------------------------------------
+ transposition_action = self.create_action("&Transposition",
+ shortcut='', slot=self.transposition,
+ tip="Transposition")
+
+ self.add_actions(self.mirror_menu, (transposition_action,))
+
+ #2----------------------------------------------
+ self.rotation_menu = self.transform_menu.addMenu("&Rotation")
+
+ #3----------------------------------------------
+ rotation_90_action = self.create_action("+90",
+ shortcut='', slot=self.rotation_90,
+ tip="Rotation of +90 degrees (counter-clockwise)")
+
+ self.add_actions(self.rotation_menu, (rotation_90_action,))
+
+ #3----------------------------------------------
+ rotation_180_action = self.create_action("+180",
+ shortcut='', slot=self.rotation_180,
+ tip="Rotation of +180 degrees (counter-clockwise)")
+
+ self.add_actions(self.rotation_menu, (rotation_180_action,))
+
+ #3----------------------------------------------
+ rotation_270_action = self.create_action("- 90",
+ shortcut='', slot=self.rotation_270,
+ tip="Rotation of -90 degrees (counter-clockwise)")
+
+ self.add_actions(self.rotation_menu, (rotation_270_action,))
+
+ #2----------------------------------------------
+ import_mask_action = self.create_action("&Mask",
+ shortcut='', slot=self.mask,
+ tip="Import a mask from file and apply it to image(s)")
+
+ self.add_actions(self.transform_menu, (import_mask_action,))
+ #2----------------------------------------------
+ downsample_action = self.create_action("&Downsample",
+ shortcut='', slot=self.downsample,
+ tip="Summation over groups of images")
+
+ self.add_actions(self.transform_menu, (downsample_action,))
+ #2----------------------------------------------
+ self.transform_option_action = self.create_action("&Apply transform to the whole data series",
+ shortcut='', slot=self.transformation_options,
+ tip="Define if transformations are Applied to the whole data series (checked) or only to the active image (unchecked) ")
+ self.transform_option_action.setCheckable(True)
+
+ self.add_actions(self.transform_menu, (self.transform_option_action,))
+ #0----------------------------------------------
+ self.options = self.menuBar().addMenu("&Options")
+ #1----------------------------------------------
+ about_action = self.create_action("&Counter format",
+ shortcut='', slot=self.set_counter_format_option,
+ tip='Allow to define the format for the counter in multiple saving')
+
+ self.add_actions(self.options, (about_action,))
+ #0----------------------------------------------
+ self.help_menu = self.menuBar().addMenu("&Help")
+ #1----------------------------------------------
+ about_action = self.create_action("&About",
+ shortcut='F1', slot=self.on_about,
+ tip='About Images Converter')
+
+ self.add_actions(self.help_menu, (about_action,))
+
+ def add_actions(self, target, actions):
+ for action in actions:
+ if action is None:
+ target.addSeparator()
+ else:
+ target.addAction(action)
+
+ def create_action(self, text, slot=None, shortcut=None, icon=None, tip=None, checkable=False, signal="triggered"):
+ action = QAction(text, self)
+ if icon is not None:
+ action.setIcon(QIcon(":/%s.png" % icon))
+ if shortcut is not None:
+ action.setShortcut(shortcut)
+ if tip is not None:
+ action.setToolTip(tip)
+ action.setStatusTip(tip)
+ if slot is not None:
+# bug debian6: AttributeError: 'QAction' object has no attribute '__getattr__'
+# action.__getattr__(signal).connect(slot)
+ getattr(action, signal).connect(slot)
+
+ if checkable:
+ action.setCheckable(True)
+ return action
+
+#--------------------------------------------------------------------------------------------------------
+# External top level window class
+#--------------------------------------------------------------------------------------------------------
+
+
+class counter_format_option_Dialog(QDialog): # option doivent refleter l etat des couche du dessous
+ """Dialog containing entry for down sampling"""
+ def __init__(self, counter_format, parent=None):
+ QDialog.__init__(self, parent)
+ self.resize(350, 100)
+ self.setWindowTitle('Options')
+ self.counter_format = counter_format
+ buttonBox = QDialogButtonBox(self)
+ buttonBox.setGeometry(QRect(0, 60, 341, 32))
+ buttonBox.setOrientation(Qt.Horizontal)
+ buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok)
+
+ label = QLabel(self)
+ label.setGeometry(QRect(38, 23, 181, 16))
+ label.setText("File Counter format:")
+
+ self.lineEdit = QLineEdit(self)
+ self.lineEdit.setGeometry(QRect(175, 18, 113, 25))
+ self.lineEdit.setText(counter_format)
+
+ buttonBox.accepted.connect(self.accept)
+ buttonBox.rejected.connect(self.reject)
+
+ def exec_(self):
+ if QDialog.exec_(self) == QDialog.Accepted:
+ if str(self.lineEdit.text()) != '':
+ return str(self.lineEdit.text())
+ else:
+ QMessageBox.warning(self, 'Warning', "All informations are mandatory, please fill the blanks")
+ else:
+ return self.counter_format
+
+
+class down_sampling_Dialog(QDialog):
+ """Dialog containing entry for down sampling"""
+ def __init__(self, parent=None):
+ QDialog.__init__(self, parent)
+ self.resize(407, 250)
+ self.setWindowTitle('Downsampling')
+ buttonBox = QDialogButtonBox(self)
+ buttonBox.setGeometry(QRect(45, 200, 341, 32))
+ buttonBox.setOrientation(Qt.Horizontal)
+ buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok)
+
+ label = QLabel(self)
+ label.setGeometry(QRect(38, 63, 181, 16))
+ label.setText("Number of files to sum up:")
+
+ self.lineEdit = QLineEdit(self)
+ self.lineEdit.setGeometry(QRect(220, 58, 113, 25))
+
+ label2 = QLabel(self)
+ label2.setGeometry(QRect(90, 100, 131, 20))
+ label2.setText("Starting Phi angle:")
+
+ self.lineEdit2 = QLineEdit(self)
+ self.lineEdit2.setGeometry(QRect(220, 95, 113, 25))
+
+ label3 = QLabel(self)
+ label3.setGeometry(QRect(151, 133, 101, 16))
+ label3.setText("Phi step:")
+
+ self.lineEdit3 = QLineEdit(self)
+ self.lineEdit3.setGeometry(QRect(219, 130, 113, 25))
+
+ buttonBox.accepted.connect(self.accept)
+ buttonBox.rejected.connect(self.reject)
+
+ def exec_(self):
+ if QDialog.exec_(self) == QDialog.Accepted:
+ if str(self.lineEdit.text()) != '' and str(self.lineEdit2.text()) != '' and str(self.lineEdit3.text()) != '':
+ return int(str(self.lineEdit.text())), float(str(self.lineEdit2.text())), float(str(self.lineEdit3.text()))
+ else:
+ QMessageBox.warning(self, 'Warning', "All informations are mandatory, please fill the blanks")
+ else:
+ return None, None, None
+
+
+class BinDialog(QDialog):
+ """Dialog containing entry for binary data block opening"""
+ def __init__(self, parent=None):
+ QDialog.__init__(self, parent)
+ self.resize(410, 270)
+ self.setWindowTitle("Binary data block opening")
+
+ self.dim1 = None
+ self.dim2 = None
+ self.offset = None
+ self.bytecode = None
+ self.endian = None
+
+ buttonBox = QDialogButtonBox(self)
+ buttonBox.setGeometry(QRect(50, 230, 341, 32))
+ buttonBox.setOrientation(Qt.Horizontal)
+ buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok)
+
+ groupBox = QGroupBox(self)
+ groupBox.setGeometry(QRect(10, 10, 370, 191))
+ groupBox.setTitle("Binary data block required informations:")
+ label = QLabel(self)
+ label.setGeometry(QRect(67, 48, 91, 16))
+ label.setText("Dimention 1:")
+ label_2 = QLabel(self)
+ label_2.setGeometry(QRect(66, 76, 91, 16))
+ label_2.setText("Dimention 2:")
+ self.lineEdit = QLineEdit(self)
+ self.lineEdit.setGeometry(QRect(185, 40, 91, 25))
+ self.lineEdit_2 = QLineEdit(self)
+ self.lineEdit_2.setGeometry(QRect(185, 70, 91, 25))
+ label_5 = QLabel(self)
+ label_5.setGeometry(QRect(105, 106, 51, 16))
+ label_5.setText("Offset:")
+ self.lineEdit_3 = QLineEdit(self)
+ self.lineEdit_3.setGeometry(QRect(184, 100, 91, 25))
+ self.lineEdit_3.setText('0')
+ label_3 = QLabel(groupBox)
+ label_3.setGeometry(QRect(70, 130, 91, 16))
+ label_3.setText("ByteCode:")
+ self.comboBox = QComboBox(groupBox)
+ self.comboBox.setGeometry(QRect(173, 123, 91, 25))
+ bytecodes = ["int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64", "float32", "float64"]
+ for bytecode in bytecodes:
+ self.comboBox.addItem(_fromUtf8(bytecode))
+ self.comboBox.setCurrentIndex(2)
+ label_4 = QLabel(self)
+ label_4.setGeometry(QRect(98, 170, 61, 16))
+ label_4.setText("Endian:")
+ self.comboBox_2 = QComboBox(self)
+ self.comboBox_2.setGeometry(QRect(182, 166, 91, 25))
+ self.comboBox_2.addItem(_fromUtf8("Short"))
+ self.comboBox_2.addItem(_fromUtf8("Long"))
+
+ buttonBox.rejected.connect(self.cancel)
+ buttonBox.accepted.connect(self.binary_block_info)
+
+ def binary_block_info(self):
+ if str(self.lineEdit.text()) != '' and str(self.lineEdit_2.text()) != '' and str(self.lineEdit_3.text()) != '':
+ self.dim1 = int(str(self.lineEdit.text()))
+ self.dim2 = int(str(self.lineEdit_2.text()))
+ self.offset = int(str(self.lineEdit_3.text()))
+ else:
+ QMessageBox.warning(self, 'Warning', "All informations are mandatory, please fill the blanks")
+ return
+ self.bytecode = str(self.comboBox.currentText())
+ self.endian = str(self.comboBox_2.currentText())
+ self.accept()
+
+ def cancel(self):
+ self.close()
+
+ def exec_(self):
+ if QDialog.exec_(self) == QDialog.Accepted:
+ return self.dim1, self.dim2, self.offset, self.bytecode, self.endian
+ else:
+ return None, None, None, None, None
+
+#--------------------------------------------------------------------------------------------------------
+# Main
+#--------------------------------------------------------------------------------------------------------
+
+
+def main():
+ parser = ArgumentParser(prog="fabio_viewer", usage="fabio_viewer img1 img2 ... imgn",
+ description=__doc__,
+ epilog="Based on FabIO version %s" % fabio.version)
+ parser.add_argument("images", nargs="*")
+ parser.add_argument("-V", "--version", action='version', version=__version__, help="Print version & quit")
+ args = parser.parse_args()
+ QApplication.setStyle(QStyleFactory.create("Cleanlooks"))
+ app = QApplication([])
+ form = AppForm()
+ if args.images:
+ form.open_data_series(args.images)
+ form.show()
+ return app.exec_()
+
+
+if __name__ == "__main__":
+ result = main()
+ sys.exit(result)
diff --git a/fabio/benchmark/__init__.py b/fabio/benchmark/__init__.py
new file mode 100644
index 0000000..b5d84f7
--- /dev/null
+++ b/fabio/benchmark/__init__.py
@@ -0,0 +1,95 @@
+#!/usr/bin/python
+# coding: utf-8
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+"""Benchmark for file reading"""
+
+from __future__ import print_function, division
+
+__author__ = "Jérôme Kieffer"
+__date__ = "25/07/2017"
+__license__ = "MIT"
+__copyright__ = "2016 European Synchrotron Radiation Facility, Grenoble, France"
+
+import json
+import sys
+import time
+import timeit
+import os
+import platform
+import subprocess
+import numpy
+import fabio
+import os.path as op
+import logging
+
+# To use use the locally build version of PyFAI, use ../bootstrap.py
+try:
+ from .. import open as fabio_open, version, date
+except ImportError:
+ from fabio import open as fabio_open, version, date
+from ..test import utilstest
+
+datasets = ["mb_LP_1_001.img",
+ "Cr8F8140k103.0026",
+ "run2_1_00148.cbf",
+ "F2K_Seb_Lyso0675.edf",
+ "fit2d_click.msk",
+ "GE_aSI_detector_image_1529",
+ "i01f0001.kcd",
+ "example.mar2300",
+ "corkcont2_H_0089.mccd",
+ "b191_1_9_1.img",
+ "image0001.pgm",
+ "mgzn-20hpt.img",
+ "oPPA_5grains_0001.tif",
+ "XSDataImage.xml", ]
+
+setup = """
+import fabio
+"""
+stmt = "data = fabio.open(r'%s').data"
+
+
+def run_benchmark(number=10, repeat=3):
+ """
+ :param number: Measure timimg over number of executions
+ :param repeat: number of measurement, takes the best of them
+
+ """
+ print("Averaging over %i repetitions (best of %s)." % (number, repeat))
+ print("Python %s" % sys.version)
+ print("FabIO %s (%s)" % (version, date))
+ print("#" * 80)
+ print(" Module filename \t file size \t image size \t read time (ms) \t ms/Mpix")
+ for img in datasets:
+ fn = utilstest.UtilsTest.getimage(img)
+ fimg = fabio_open(fn)
+ file_size = os.stat(fn).st_size / 1.0e6 # MB
+ img_size = fimg.data.size / 1.0e6 # Mpix
+ timer = timeit.Timer(stmt % fn, setup + (stmt % fn))
+ tmin = min([i / (0.001 * number) for i in timer.repeat(repeat=repeat, number=number)])
+ print("%13s %25s %.3f Mb \t %.3f Mpix \t %.3f ms \t %.3f ms/Mpix" %
+ (fimg.__class__.__name__, img, file_size, img_size, tmin, tmin / img_size))
+
+
+run = run_benchmark
diff --git a/fabio/benchmark/setup.py b/fabio/benchmark/setup.py
new file mode 100644
index 0000000..590fb32
--- /dev/null
+++ b/fabio/benchmark/setup.py
@@ -0,0 +1,39 @@
+# coding: utf-8
+# /*##########################################################################
+# Copyright (C) 2016 European Synchrotron Radiation Facility
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+# ############################################################################*/
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "31/07/2017"
+
+from numpy.distutils.misc_util import Configuration
+
+
+def configuration(parent_package='', top_path=None):
+ config = Configuration('benchmark', parent_package, top_path)
+ return config
+
+
+if __name__ == "__main__":
+ from numpy.distutils.core import setup
+ setup(configuration=configuration)
diff --git a/fabio/binaryimage.py b/fabio/binaryimage.py
new file mode 100644
index 0000000..ffa04da
--- /dev/null
+++ b/fabio/binaryimage.py
@@ -0,0 +1,133 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+"""
+Authors: Gael Goret, Jerome Kieffer, ESRF, France
+
+Emails: gael.goret@esrf.fr, jerome.kieffer@esrf.fr
+ Brian Richard Pauw <brian@stack.nl>
+
+Binary files images are simple none-compressed 2D images only defined by their :
+data-type, dimensions, byte order and offset
+
+This simple library has been made for manipulating exotic/unknown files format.
+"""
+
+# Get ready for python3:
+from __future__ import with_statement, print_function
+
+__authors__ = ["Gaël Goret", "Jérôme Kieffer", "Brian Pauw"]
+__contact__ = "gael.goret@esrf.fr"
+__license__ = "GPLv3+"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__version__ = "17/10/2012"
+
+from .fabioimage import FabioImage
+import numpy
+import logging
+logger = logging.getLogger(__name__)
+
+
+class BinaryImage(FabioImage):
+ """
+ This simple library has been made for manipulating exotic/unknown files format.
+
+ Binary files images are simple none-compressed 2D images only defined by their:
+ data-type, dimensions, byte order and offset
+
+ if offset is set to a negative value, the image is read using the last data but n
+ data in the file, skipping any header.
+ """
+
+ DESCRIPTION = "Binary format (none-compressed 2D images)"
+
+ DEFAULT_EXTENTIONS = ["bin"]
+
+ def __init__(self, *args, **kwargs):
+ FabioImage.__init__(self, *args, **kwargs)
+
+ @staticmethod
+ def swap_needed(endian):
+ """
+ Decide if we need to byteswap
+ """
+ if (endian == '<' and numpy.little_endian) or (endian == '>' and not numpy.little_endian):
+ return False
+ if (endian == '>' and numpy.little_endian) or (endian == '<' and not numpy.little_endian):
+ return True
+
+ def read(self, fname, dim1, dim2, offset=0, bytecode="int32", endian="<"):
+ """
+ Read a binary image
+
+ :param str fname: file name
+ :param int dim1: image dimensions (Fast index)
+ :param int dim2: image dimensions (Slow index)
+ :param int offset: starting position of the data-block. If negative, starts at the end.
+ :param bytecode: can be "int8","int16","int32","int64","uint8","uint16","uint32","uint64","float32","float64",...
+ :param endian: among short or long endian ("<" or ">")
+
+ """
+ self.filename = fname
+ self.dim1 = dim1
+ self.dim2 = dim2
+ self.bytecode = bytecode
+ f = open(self.filename, "rb")
+ dims = [dim2, dim1]
+ bpp = len(numpy.array(0, bytecode).tostring())
+ size = dims[0] * dims[1] * bpp
+
+ if offset >= 0:
+ f.seek(offset)
+ else:
+ try:
+ f.seek(-size + offset + 1, 2) # seek from EOF backwards
+ except IOError:
+ logger.warning('expected datablock too large, please check bytecode settings: {}'.format(bytecode))
+ except:
+ logger.error('Uncommon error encountered when reading file')
+ rawData = f.read(size)
+ if self.swap_needed(endian):
+ data = numpy.fromstring(rawData, bytecode).byteswap().reshape(tuple(dims))
+ else:
+ data = numpy.fromstring(rawData, bytecode).reshape(tuple(dims))
+ self.data = data
+ return self
+
+ def estimate_offset_value(self, fname, dim1, dim2, bytecode="int32"):
+ "Estimates the size of a file"
+ with open(fname, "rb") as f:
+ bpp = len(numpy.array(0, bytecode).tostring())
+ size = dim1 * dim2 * bpp
+ totsize = len(f.read())
+ logger.info('total size (bytes): %s', totsize)
+ logger.info('expected data size given parameters (bytes): %s', size)
+ logger.info('estimation of the offset value (bytes): %s', totsize - size)
+
+ def write(self, fname):
+ with open(fname, mode="wb") as outfile:
+ outfile.write(self.data.tostring())
+
+
+binaryimage = BinaryImage
diff --git a/fabio/bruker100image.py b/fabio/bruker100image.py
new file mode 100644
index 0000000..a84b0dc
--- /dev/null
+++ b/fabio/bruker100image.py
@@ -0,0 +1,404 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+
+"""Authors: Henning O. Sorensen & Erik Knudsen
+ Center for Fundamental Research: Metal Structures in Four Dimensions
+ Risoe National Laboratory
+ Frederiksborgvej 399
+ DK-4000 Roskilde
+ email:erik.knudsen@risoe.dk
+
+
+ Jérôme Kieffer, ESRF, Grenoble, France
+ Sigmund Neher, GWDG, Göttingen, Germany
+
+"""
+
+# get ready for python3
+from __future__ import absolute_import, print_function, with_statement, division
+__authors__ = ["Henning O. Sorensen", "Erik Knudsen", "Jon Wright",
+ "Jérôme Kieffer", "Sigmund Neher"]
+__status__ = "production"
+__copyright__ = "2007-2009 Risoe National Laboratory; 2015-2016 ESRF, 2016 GWDG"
+__licence__ = "MIT"
+
+import numpy
+import logging
+import os
+from math import ceil
+logger = logging.getLogger(__name__)
+try:
+ from PIL import Image
+except ImportError:
+ Image = None
+
+from .brukerimage import BrukerImage
+from .readbytestream import readbytestream
+from .fabioutils import pad, StringTypes
+
+
+class Bruker100Image(BrukerImage):
+
+ DESCRIPTION = "SFRM File format used by Bruker detectors (version 100)"
+
+ DEFAULT_EXTENTIONS = ["sfrm"]
+
+ bpp_to_numpy = {1: numpy.uint8,
+ 2: numpy.uint16,
+ 4: numpy.int32}
+ version = 100
+
+ def __init__(self, data=None, header=None):
+ BrukerImage.__init__(self, data, header)
+ self.nover_one = self.nover_two = 0
+
+ def _readheader(self, infile):
+ """
+ The bruker format uses 80 char lines in key : value format
+ In the first 512*5 bytes of the header there should be a
+ HDRBLKS key, whose value denotes how many 512 byte blocks
+ are in the total header. The header is always n*5*512 bytes,
+ otherwise it wont contain whole key: value pairs
+ """
+ line = 80
+ blocksize = 512
+ nhdrblks = 5 # by default we always read 5 blocks of 512
+ self.__headerstring__ = infile.read(blocksize * nhdrblks).decode("ASCII")
+ self.header = self.check_header()
+ for i in range(0, nhdrblks * blocksize, line):
+ if self.__headerstring__[i: i + line].find(":") > 0:
+ key, val = self.__headerstring__[i: i + line].split(":", 1)
+ key = key.strip() # remove the whitespace (why?)
+ val = val.strip()
+ if key in self.header:
+ # append lines if key already there
+ self.header[key] = self.header[key] + os.linesep + val
+ else:
+ self.header[key] = val
+ # we must have read this in the first 5*512 bytes.
+ nhdrblks = int(self.header['HDRBLKS'])
+ self.header['HDRBLKS'] = nhdrblks
+ # Now read in the rest of the header blocks, appending
+ self.__headerstring__ += infile.read(blocksize * (nhdrblks - 5)).decode("ASCII")
+ for i in range(5 * blocksize, nhdrblks * blocksize, line):
+ if self.__headerstring__[i: i + line].find(":") > 0: # as for first 512 bytes of header
+ key, val = self.__headerstring__[i: i + line].split(":", 1)
+ key = key.strip()
+ val = val.strip()
+ if key in self.header:
+ self.header[key] = self.header[key] + os.linesep + val
+ else:
+ self.header[key] = val
+ # set the image dimensions
+ self.dim1 = int(self.header['NROWS'].split()[0])
+ self.dim2 = int(self.header['NCOLS'].split()[0])
+ self.version = int(self.header.get('VERSION', "100"))
+
+ def toPIL16(self, filename=None):
+ if not Image:
+ raise RuntimeError("PIL is not installed !!! ")
+
+ if filename:
+ self.read(filename)
+ PILimage = Image.frombuffer("F", (self.dim1, self.dim2), self.data, "raw", "F;16", 0, -1)
+ return PILimage
+
+ def read(self, fname, frame=None):
+ '''data is stored in three blocks: data (uint8), overflow (uint32), underflow (int32). The blocks are
+ zero paded to a multiple of 16 bits '''
+ with self._open(fname, "rb") as infile:
+ self._readheader(infile)
+ rows = self.dim1
+ cols = self.dim2
+ npixelb = int(self.header['NPIXELB'][0])
+ # you had to read the Bruker docs to know this!
+
+ # We are now at the start of the image - assuming bruker._readheader worked
+ # Get image block size from NPIXELB.
+ # The total size is nbytes * nrows * ncolumns.
+ self.data = readbytestream(infile, infile.tell(), rows, cols, npixelb,
+ datatype="int", signed='n', swap='n')
+ # now process the overflows
+ for k, nover in enumerate(self.header['NOVERFL'].split()):
+ if k == 0:
+ # read the set of "underflow pixels" - these will be completely disregarded for now
+ continue
+ nov = int(nover)
+ if nov <= 0:
+ continue
+ bpp = 1 << k # (2 ** k)
+ datatype = self.bpp_to_numpy[bpp]
+ # upgrade data type
+ self.data = self.data.astype(datatype)
+ # pad nov*bpp to a multiple of 16 bytes
+ nbytes = (nov * bpp + 15) & ~(15)
+
+ # Multiple of 16 just above
+ data_str = infile.read(nbytes)
+ # ar without zeros
+ ar = numpy.fromstring(data_str[:nov * bpp], datatype)
+ # insert the the overflow pixels in the image array:
+ lim = (1 << (8 * k)) - 1
+
+ # generate an array comprising of the indices into data.ravel()
+ # where its value equals lim.
+ flat = self.data.ravel()
+ mask = numpy.where(flat >= lim)[0]
+ # now put values from ar into those indices
+ if k != 0:
+ flat.put(mask, ar)
+ else: # only working because nov = - is treated bevor
+ self.ar_underflows = ar
+ logger.debug("%s bytes read + %d bytes padding" % (nov * bpp, nbytes - nov * bpp))
+# infile.close()
+ # replace zeros with values from underflow block
+ if int(self.header["NOVERFL"].split()[0]) > 0:
+ flat = self.data.ravel()
+ self.mask_undeflows = numpy.where(flat == 0)[0]
+ self.mask_no_undeflows = numpy.where(self.data != 0)
+ flat.put(self.mask_undeflows, self.ar_underflows)
+ # add basline
+ if int(self.header["NOVERFL"].split()[0]) != -1:
+ baseline = int(self.header["NEXP"].split()[2])
+ self.data[self.mask_no_undeflows] += baseline
+ # print(self.data.max(), self.data.min(), self.data[numpy.where(self.data==0)].shape)
+
+ self.resetvals()
+ return self
+
+ def gen_header(self):
+ """
+ Generate headers (with some magic and guesses)
+ format is Bruker100
+ """
+ headers = []
+ for key in self.HEADERS_KEYS:
+ if key in self.header:
+ value = self.header[key]
+ if key == "CFR":
+ line = key.ljust(4) + ":"
+ else:
+ line = key.ljust(7) + ":"
+ if type(value) in StringTypes:
+ if key == 'NOVERFL':
+ line += str(str(self.nunderFlows).ljust(24, ' ') + str(self.nover_one).ljust(24) + str(self.nover_two))
+ elif key == "DETTYPE":
+ line += str(value)
+ elif key == "CFR":
+ line += str(value)
+ elif os.linesep in value:
+ lines = value.split(os.linesep)
+ for i in lines[:-1]:
+ headers.append((line + str(i)).ljust(80, " "))
+ line = key.ljust(7) + ":"
+ line += str(lines[-1])
+ elif len(value) < 72:
+ line += str(value)
+ else:
+ for i in range(len(value) // 72):
+ headers.append((line + str(value[72 * i:72 * (i + 1)])))
+ line = key.ljust(7) + ":"
+ line += value[72 * (i + 1):]
+ elif "__len__" in dir(value):
+ f = "\%.%is" % 72 // len(value) - 1
+ line += " ".join([f % i for i in value])
+ else:
+ line += str(value)
+ headers.append(line.ljust(80, " "))
+ header = "".join(headers)
+ if len(header) > 512 * self.header["HDRBLKS"]:
+ tmp = ceil(len(header) / 512.0)
+ self.header["HDRBLKS"] = int(ceil(tmp / 5.0) * 5.0)
+ for i in range(len(headers)):
+ if headers[i].startswith("HDRBLKS"):
+ headers[i] = ("HDRBLKS:%s" % self.header["HDRBLKS"]).ljust(80, " ")
+ else:
+ self.header["HDRBLKS"] = 15
+ res = pad("".join(headers), self.SPACER + "." * 78, 512 * int(self.header["HDRBLKS"]))
+ return res
+
+ def gen_overflow(self):
+ """
+ Generate an overflow table, including the underflow, marked as 65535 .
+ """
+ bpp = 2
+ limit = 255
+ # noverf = int(self.header['NOVERFL'].split()[1])
+ noverf = self.noverf
+ read_bytes = (noverf * bpp + 15) & ~(15) # since data b
+ dif2usedbyts = read_bytes - (noverf * bpp)
+ pad_zeros = numpy.zeros(dif2usedbyts / bpp).astype(self.bpp_to_numpy[bpp])
+ flat = self.data.ravel() # flat memory view
+ flow_pos = numpy.logical_or(flat >= limit, flat < 0)
+# flow_pos_indexes = numpy.where(flow_pos)[0]
+ flow_vals = (flat[flow_pos])
+
+ flow_vals[flow_vals < 0] = 65535 # limit#flow_vals[flow_vals<0]
+ flow_vals_paded = numpy.hstack((flow_vals, pad_zeros)).astype(self.bpp_to_numpy[bpp])
+ return flow_vals_paded # pad(overflow, ".", 512)
+
+ def gen_underflow100(self):
+ """
+ Generate an underflow table
+ """
+ bpp = 4
+ noverf = int(self.header['NOVERFL'].split()[2])
+# nunderf = self.nunderf
+ read_bytes = (noverf * bpp + 15) & ~(15)
+ dif2usedbyts = read_bytes - (noverf * bpp)
+ pad_zeros = numpy.zeros(dif2usedbyts / bpp).astype(self.bpp_to_numpy[bpp])
+ flat = self.data.ravel() # flat memory view
+ underflow_pos = numpy.where(flat < 0)[0]
+ underflow_val = flat[underflow_pos]
+ underflow_val = underflow_val.astype(self.bpp_to_numpy[bpp])
+ nderflow_val_paded = numpy.hstack((underflow_val, pad_zeros))
+ return nderflow_val_paded
+
+ def write(self, fname):
+ """
+ Write a bruker image
+
+ """
+ if numpy.issubdtype(self.data.dtype, float):
+ if "LINEAR" in self.header:
+ try:
+ slope, offset = self.header["LINEAR"].split(None, 1)
+ slope = float(slope)
+ offset = float(offset)
+ except Exception:
+ logger.warning("Error in converting to float data with linear parameter: %s" % self.header["LINEAR"])
+ slope, offset = 1.0, 0.0
+
+ else:
+ offset = self.data.min()
+ max_data = self.data.max()
+ max_range = 2 ** 24 - 1 # similar to the mantissa of a float32
+ if max_data > offset:
+ slope = (max_data - offset) / float(max_range)
+ else:
+ slope = 1.0
+ tmp_data = numpy.round(((self.data - offset) / slope)).astype(numpy.uint32)
+ self.header["LINEAR"] = "%s %s" % (slope, offset)
+ else:
+ if int(self.header["NOVERFL"].split()[0]) > 0:
+ baseline = int(self.header["NEXP"].split()[2])
+ self.data[self.mask_no_undeflows] -= baseline
+
+ tmp_data = self.data
+
+ minusMask = numpy.where(tmp_data < 0)
+ bpp = self.calc_bpp(tmp_data)
+ # self.basic_translate(fname)
+ limit = 2 ** (8 * bpp) - 1
+ data = tmp_data.astype(self.bpp_to_numpy[bpp])
+ reset = numpy.where(tmp_data >= limit)
+ self.nunderFlows = int(self.header["NOVERFL"].split()[0])
+ self.nover_one = len(reset[0]) + len(minusMask[0])
+ self.nover_two = len(minusMask[0])
+ data[reset] = limit
+ data[minusMask] = limit
+ if not numpy.little_endian and bpp > 1:
+ # Bruker enforces little endian
+ data.byteswap(True)
+ with self._open(fname, "wb") as bruker:
+ bruker.write(self.gen_header().encode("ASCII"))
+ bruker.write(data.tostring())
+ overflows_one_byte = self.overflows_one_byte()
+ overflows_two_byte = self.overflows_two_byte()
+ if int(self.header["NOVERFL"].split()[0]) > 0:
+ underflows = self.underflows()
+ bruker.write(underflows.tostring())
+ bruker.write(overflows_one_byte.tostring())
+ bruker.write(overflows_two_byte.tostring())
+
+ def underflows(self):
+ """
+ Generate underflow table
+ """
+ bpp = 1
+ # limit = 255
+ nunderFlows = self.nunderFlows
+# temp_data = self.data
+ read_bytes = (nunderFlows * bpp + 15) & ~(15) # multiple of 16
+ dif2usedbyts = read_bytes - (nunderFlows * bpp)
+ pad_zeros = numpy.zeros(dif2usedbyts / bpp).astype(self.bpp_to_numpy[bpp])
+# flat = self.data.ravel() # flat memory view
+# flow_pos_indexes = self.mask_undeflows
+ flow_vals = (self.ar_underflows)
+ # flow_vals[flow_vals<0] = 65535#limit#flow_vals[flow_vals<0]
+ flow_vals_paded = numpy.hstack((flow_vals, pad_zeros)).astype(self.bpp_to_numpy[bpp])
+
+ return flow_vals_paded # pad(overflow, ".", 512)
+
+ def overflows_one_byte(self):
+ """
+ Generate one-byte overflow table
+ """
+ bpp = 2
+ limit = 255
+ nover_one = self.nover_one
+# temp_data = self.data
+ read_bytes = (nover_one * bpp + 15) & ~(15) # multiple of 16
+ dif2usedbyts = read_bytes - (nover_one * bpp)
+ pad_zeros = numpy.zeros(dif2usedbyts // bpp, dtype=self.bpp_to_numpy[bpp])
+ flat = self.data.ravel() # flat memory view
+ flow_pos = (flat >= limit) + (flat < 0)
+# flow_pos_indexes = numpy.where(flow_pos == True)[0]
+ flow_vals = (flat[flow_pos])
+ flow_vals[flow_vals < 0] = 65535 # limit#flow_vals[flow_vals<0]
+ # print("flow_vals",flow_vals)
+ flow_vals_paded = numpy.hstack((flow_vals, pad_zeros)).astype(self.bpp_to_numpy[bpp])
+ return flow_vals_paded # pad(overflow, ".", 512)
+
+ def overflows_two_byte(self):
+ """
+ Generate two byte overflow table
+ """
+
+ bpp = 4
+ noverf = int(self.header['NOVERFL'].split()[2])
+# nover_two = self.nover_two
+ read_bytes = (noverf * bpp + 15) & ~(15) # multiple of 16
+ dif2usedbyts = read_bytes - (noverf * bpp)
+ pad_zeros = numpy.zeros(dif2usedbyts // bpp, dtype=self.bpp_to_numpy[bpp])
+ flat = self.data.ravel() # flat memory view
+
+ underflow_pos = numpy.where(flat < 0)[0]
+ underflow_val = flat[underflow_pos] # [::-1]
+ # underflow_val[underflow_val 0] = 65535#limit#flow_vals[flow_vals<0]
+
+ underflow_val = underflow_val.astype(self.bpp_to_numpy[bpp])
+ nderflow_val_paded = numpy.hstack((underflow_val, pad_zeros))
+
+ return nderflow_val_paded # pad(overflow, ".", 512)
+
+
+bruker100image = Bruker100Image
diff --git a/fabio/brukerimage.py b/fabio/brukerimage.py
new file mode 100644
index 0000000..c9e2023
--- /dev/null
+++ b/fabio/brukerimage.py
@@ -0,0 +1,432 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+"""Authors: Henning O. Sorensen & Erik Knudsen
+ Center for Fundamental Research: Metal Structures in Four Dimensions
+ Risoe National Laboratory
+ Frederiksborgvej 399
+ DK-4000 Roskilde
+ email:erik.knudsen@risoe.dk
+
+Based on: openbruker,readbruker, readbrukerheader functions in the opendata
+ module of ImageD11 written by Jon Wright, ESRF, Grenoble, France
+
+Writer by Jérôme Kieffer, ESRF, Grenoble, France
+
+"""
+
+
+# get ready for python3 compatibility
+from __future__ import absolute_import, print_function, with_statement, division
+
+__authors__ = ["Henning O. Sorensen", "Erik Knudsen", "Jon Wright", "Jérôme Kieffer"]
+__date__ = "25/07/2017"
+__status__ = "production"
+__copyright__ = "2007-2009 Risoe National Laboratory; 2010-2015 ESRF"
+__licence__ = "MIT"
+
+import logging
+import numpy
+from math import ceil
+import os
+import getpass
+import time
+logger = logging.getLogger(__name__)
+from .fabioimage import FabioImage
+from .fabioutils import pad, StringTypes
+
+
+class BrukerImage(FabioImage):
+ """
+ Read and eventually write ID11 bruker (eg smart6500) images
+
+ TODO: int32 -> float32 conversion according to the "linear" keyword.
+ This is done and works but we need to check with other program that we
+ are appliing the right formula and not the reciprocal one.
+
+ """
+
+ DESCRIPTION = "File format used by Bruker detectors (version 86)"
+
+ # There is no extension. It is used as frame counter
+ DEFAULT_EXTENTIONS = []
+
+ bpp_to_numpy = {1: numpy.uint8,
+ 2: numpy.uint16,
+ 4: numpy.uint32}
+
+ # needed if you feel like writing - see ImageD11/scripts/edf2bruker.py
+ SPACER = "\x1a\x04" # this is CTRL-Z CTRL-D
+ HEADERS_KEYS = ["FORMAT", # Frame format. Always “86” or "100" for Bruker-format frames.
+ "VERSION", # Header version #, such as: 1 to 17 (6 is obsolete).
+ "HDRBLKS", # Header size in 512-byte blocks, such as 10 or 15. Determines where the image block begins.
+ "TYPE", # String indicating kind of data in the frame. Used to determine if a spatial correction table was applied to the frame imag
+ "SITE", # Site name
+ "MODEL", # Diffractometer model
+ "USER", # Username
+ "SAMPLE", # Sample ID,
+ "SETNAME", # Basic data set name
+ "RUN", # Run number within the data set, usually starts at 0, but 1 for APEX2.
+ "SAMPNUM", # Specimen number within the data set
+ "TITLE", # User comments (8 lines)
+ "NCOUNTS", # Total frame counts
+ "NOVERFL", # Number of overflows when compression frame.
+ "MINIMUM", # Minimum counts in a pixel (uncompressed value)
+ "MAXIMUM", # Maximum counts in a pixel (uncompressed value)
+ "NONTIME", # Number of on-time events
+ "NLATE", # Number of late events. Always zero for many detectors.
+ "FILENAM", # (Original) frame filename
+ "CREATED", # Date and time of creation
+ "CUMULAT", # Accumulated frame exposure time in seconds
+ "ELAPSDR", # Requested time for last exposure in seconds
+ "ELAPSDA", # Actual time for last exposure in seconds.
+ "OSCILLA", # Nonzero if acquired by oscillation
+ "NSTEPS", # steps or oscillations in this frame
+ "RANGE", # Scan range in decimal degrees (unsigned)
+ "START", # Starting scan angle value, decimal degrees
+ "INCREME", # Scan angle increment between frames (signed)
+ "NUMBER", # Sequence number of this frame in series, usually starts at 0, but 1 for APEX2
+ "NFRAMES", # Total number of frames in the series
+ "ANGLES", # Diffractometer angles in Eulerian space ( 2T, OM, PH, CH).
+ "NOVER64", # Number of pixels > 64K (actually LinearThreshold value)
+ "NPIXELB", # Number of bytes/pixel, such as 1, 2, or 4.
+ "NROWS", # Number of rasters in frame, such as 512, 1024, 2048, or 4096
+ "NCOLS", # Number of pixels/raster, such as 512, 1024, 2048 or 4096
+ "WORDORD", # Order of bytes in word (0=LSB first)
+ "LONGORD", # Order of words in a longword (0=LSW first)
+ "TARGET", # X-ray target material: Cu, Mo, Ag, Fe, Cr, Co, Ni, W, Mn, or other.
+ "SOURCEK", # X-ray source voltage in kV
+ "SOURCEM", # X-ray source current in mA
+ "FILTER", # Filter/monochromator setting: Such as: Parallel, graphite, Ni Filter, C Filter, Zr Filter,Cross coupled Goebel Mirrors ...
+ "CELL", # Unit cell A,B,C,ALPHA,BETA,GAMMA
+ "MATRIX", # 9R Orientation matrix (P3 conventions)
+ "LOWTEMP", # Low temp flag.
+ "TEMP", # set temperature
+ "HITEMP", # Acquired at high temperature
+ "ZOOM", # Zoom: Xc, Yc, Mag used for HI-STAR detectors: 0.5 0.5 1.0
+ "CENTER", # X, Y of direct beam at 2-theta = 0. These are raw center for raw frames and unwarped center for unwarped frames.
+ "DISTANC", # Sample-detector distance, cm (see CmToGrid value) Adds: Sample-detector grid/phosphor distance, cm
+ "TRAILER", # Byte pointer to trailer info
+ "COMPRES", # Compression scheme ID, if any. Such as: NONE, LINEAR (Linear scale, offset for pixel values, typically 1.0, 0.0).
+ "LINEAR", # Linear scale (1.0 0.0 for no change; 0.1 0 for divided by 10...)
+ "PHD", # Discriminator: Pulse height settings. X100 and X1000 only. Stores CCD phosphor efficiency (first field).
+ "PREAMP", # Preamp gain setting. X100 and X1000 only. SMART: Stores Roper CCD gain table index value.
+ "CORRECT", # Flood table correction filename, UNKNOWN or LINEAR.
+ "WARPFIL", # Brass plate correction filename, UNKNOWN or LINEAR. Note: A filename here does NOT mean that spatial correction was performed. See TYPE and string “UNWARP” to determine that.
+ "WAVELEN", # Wavelengths (average, a1, a2)
+ "MAXXY", # X,Y pixel # of maximum counts (from lower corner of 0,0)
+ "AXIS", # Scan axis ib Eulerian space (1-4 for 2-theta, omega, phi, chi) (0 =none, 2 = default).
+ "ENDING", # Actual goniometer angles at end of frame in Eulerian space.
+ "DETPAR", # Detector position corrections (dX,dY,dDist,Pitch,Roll,Yaw)
+ "LUT", # Recommended display lookup table
+ "DISPLIM", # Recommended display limits
+ "PROGRAM", # Name and version of program writing frame, such as:
+ "ROTATE", # Non zero if acquired by rotation of phi during scan (or oscilate)
+ "BITMASK", # File name of active pixel mask associated with this frame or $NULL
+ "OCTMASK", # Octagon mask parameters to use if BITMASK=$null. Min X, Min X+Y, Min Y, Max X-Y, Max X, Max X+Y, Max Y, Max Y-X.
+ "ESDCELL", # Unit cell parameter standard deviations
+ "DETTYPE", # Detector or CCD chip type (as displayed on CEU). Default is MULTIWIRE but UNKNOWN is advised, can contain PIXPERCM: CMTOGRID:
+ "NEXP", # Number of exposures: 1=single, 2=correlated sum.32 for most ccds, and 64 for 2K ccds.
+ "CCDPARM", # CCD parameters: readnoise, e/ADU, e/photon, bias, full scale
+ "BIS", # Potential full linear scale if rescan and attenuator used.
+ "CHEM", # Chemical formula in CIFTAB string, such as “?”
+ "MORPH", # Crystal morphology in CIFTAB string, such as “?”
+ "CCOLOR", # Crystal color in CIFTAB string, such as “?”
+ "CSIZE", # Crystal dimensions (3 ea) in CIFTAB string, such as “?”
+ "DNSMET", # Density measurement method in CIFTAB string, such as “?”
+ "DARK", # Name of dark current correction or NONE.
+ "AUTORNG", # Auto-ranging: gain, high-speed time, scale, offset, full linear scale Note: If full linear scale is zero, then CCDPARM full scale is the full linear scale (BIS frames).
+ "ZEROADJ", # Goniometer zero corrections (refined in least squares)
+ "XTRANS", # Crystal XYZ translations (refined in least squares)
+ "HKL&XY", # HKL and pixel XY for reciprocal space scan. GADDS only.
+ "AXES2", # Diffractometer setting linear axes (4 ea). (X, Y, Z, Aux)
+ "ENDING2", # Actual goniometer linear axes @ end of frame. (X, Y, Z, Aux)
+ "FILTER2", # Monochromator 2-theta angle and monochromator roll angle. v15: Adds beam tilt angle and attenuator factor.
+ "LEPTOS", # String for LEPTOS.
+ "CFR", # Only in 21CFRPart11 mode, writes the checksum for header and image (2str).]
+ ]
+ version = 86
+
+ def __init__(self, data=None, header=None):
+ FabioImage.__init__(self, data, header)
+ self.__bpp_file = None
+ self.__headerstring__ = ""
+
+ def _readheader(self, infile):
+ """
+ The bruker format uses 80 char lines in key : value format
+ In the first 512*5 bytes of the header there should be a
+ HDRBLKS key, whose value denotes how many 512 byte blocks
+ are in the total header. The header is always n*5*512 bytes,
+ otherwise it wont contain whole key: value pairs
+ """
+ line = 80
+ blocksize = 512
+ nhdrblks = 5 # by default we always read 5 blocks of 512
+ self.__headerstring__ = infile.read(blocksize * nhdrblks).decode("ASCII")
+ self.header = self.check_header()
+ for i in range(0, nhdrblks * blocksize, line):
+ if self.__headerstring__[i: i + line].find(":") > 0:
+ key, val = self.__headerstring__[i: i + line].split(":", 1)
+ key = key.strip() # remove the whitespace (why?)
+ val = val.strip()
+ if key in self.header:
+ # append lines if key already there
+ self.header[key] = self.header[key] + os.linesep + val
+ else:
+ self.header[key] = val
+ # we must have read this in the first 5*512 bytes.
+ nhdrblks = int(self.header.get('HDRBLKS', 5))
+ self.header['HDRBLKS'] = nhdrblks
+ # Now read in the rest of the header blocks, appending
+ self.__headerstring__ += infile.read(blocksize * (nhdrblks - 5)).decode("ASCII")
+ for i in range(5 * blocksize, nhdrblks * blocksize, line):
+ if self.__headerstring__[i: i + line].find(":") > 0: # as for first 512 bytes of header
+ key, val = self.__headerstring__[i: i + line].split(":", 1)
+ key = key.strip()
+ val = val.strip()
+ if key in self.header:
+ self.header[key] = self.header[key] + os.linesep + val
+ else:
+ self.header[key] = val
+ # make a (new) header item called "datastart"
+ self.header['datastart'] = blocksize * nhdrblks
+
+ # set the image dimensions
+ self.dim1 = int(self.header['NROWS'].split()[0])
+ self.dim2 = int(self.header['NCOLS'].split()[0])
+ self.version = int(self.header.get('VERSION', "86"))
+
+ def read(self, fname, frame=None):
+ """
+ Read in and unpack the pixels (including overflow table
+ """
+ with self._open(fname, "rb") as infile:
+ try:
+ self._readheader(infile)
+ except Exception as err:
+ raise RuntimeError("Unable to parse Bruker headers: %s" % err)
+
+ rows = self.dim1
+ cols = self.dim2
+
+ try:
+ # you had to read the Bruker docs to know this!
+ npixelb = int(self.header['NPIXELB'])
+ except Exception:
+ errmsg = "length " + str(len(self.header['NPIXELB'])) + "\n"
+ for byt in self.header['NPIXELB']:
+ errmsg += "char: " + str(byt) + " " + str(ord(byt)) + "\n"
+ logger.warning(errmsg)
+ raise RuntimeError(errmsg)
+
+ data = numpy.fromstring(infile.read(rows * cols * npixelb), dtype=self.bpp_to_numpy[npixelb])
+ if not numpy.little_endian and data.dtype.itemsize > 1:
+ data.byteswap(True)
+
+ # handle overflows
+ nov = int(self.header['NOVERFL'])
+ if nov > 0: # Read in the overflows
+ # need at least int32 sized data I guess - can reach 2^21
+ data = data.astype(numpy.uint32)
+ # 16 character overflows:
+ # 9 characters of intensity
+ # 7 character position
+ for _ in range(nov):
+ ovfl = infile.read(16)
+ intensity = int(ovfl[0: 9])
+ position = int(ovfl[9: 16])
+ data[position] = intensity
+ # infile.close()
+
+ # Handle Float images ...
+ if "LINEAR" in self.header:
+ try:
+ slope, offset = self.header["LINEAR"].split(None, 1)
+ slope = float(slope)
+ offset = float(offset)
+ except Exception:
+ logger.warning("Error in converting to float data with linear parameter: %s" % self.header["LINEAR"])
+ slope = 1
+ offset = 0
+ if (slope != 1) or (offset != 0):
+ # TODO: check that the formula is OK, not reverted.
+ logger.warning("performing correction with slope=%s, offset=%s (LINEAR=%s)" % (slope, offset, self.header["LINEAR"]))
+ data = (data * slope + offset).astype(numpy.float32)
+ self.data = data.reshape(self.dim1, self.dim2)
+
+ self.resetvals()
+ self.pilimage = None
+ return self
+
+ def write(self, fname):
+ """
+ Write a bruker image
+
+ """
+ if numpy.issubdtype(self.data.dtype, float):
+ if "LINEAR" in self.header:
+ try:
+ slope, offset = self.header["LINEAR"].split(None, 1)
+ slope = float(slope)
+ offset = float(offset)
+ except Exception:
+ logger.warning("Error in converting to float data with linear parameter: %s" % self.header["LINEAR"])
+ slope, offset = 1.0, 0.0
+
+ else:
+ offset = self.data.min()
+ max_data = self.data.max()
+ max_range = 2 ** 24 - 1 # similar to the mantissa of a float32
+ if max_data > offset:
+ slope = (max_data - offset) / float(max_range)
+ else:
+ slope = 1.0
+ tmp_data = numpy.round(((self.data - offset) / slope)).astype(numpy.uint32)
+ self.header["LINEAR"] = "%s %s" % (slope, offset)
+
+ else:
+ tmp_data = self.data
+
+ bpp = self.calc_bpp(tmp_data)
+ self.basic_translate(fname)
+ limit = 2 ** (8 * bpp) - 1
+ data = tmp_data.astype(self.bpp_to_numpy[bpp])
+ reset = numpy.where(tmp_data >= limit)
+ data[reset] = limit
+ if not numpy.little_endian and bpp > 1:
+ # Bruker enforces little endian
+ data.byteswap(True)
+ with self._open(fname, "wb") as bruker:
+ bruker.write(self.gen_header().encode("ASCII"))
+ bruker.write(data.tostring())
+ bruker.write(self.gen_overflow().encode("ASCII"))
+
+ def calc_bpp(self, data=None, max_entry=4096):
+ """
+ Calculate the number of byte per pixel to get an optimal overflow table.
+
+ :return: byte per pixel
+ """
+ if data is None:
+ data = self.data
+ if self.__bpp_file is None:
+ for i in [1, 2]:
+ overflown = (data >= (2 ** (8 * i) - 1))
+ if overflown.sum() < max_entry:
+ self.__bpp_file = i
+ break
+ else:
+ self.__bpp_file = 4
+ return self.__bpp_file
+
+ def gen_header(self):
+ """
+ Generate headers (with some magic and guesses)
+ :param format can be 86 or 100
+ """
+ headers = []
+ for key in self.HEADERS_KEYS:
+ if key in self.header:
+ value = self.header[key]
+ line = key.ljust(7) + ":"
+ if type(value) in StringTypes:
+ if os.linesep in value:
+ lines = value.split(os.linesep)
+ for i in lines[:-1]:
+ headers.append((line + str(i)).ljust(80, " "))
+ line = key.ljust(7) + ":"
+ line += str(lines[-1])
+ elif len(value) < 72:
+ line += str(value)
+ else:
+ for i in range(len(value) // 72):
+ headers.append((line + str(value[72 * i:72 * (i + 1)])))
+ line = key.ljust(7) + ":"
+ line += value[72 * (i + 1):]
+ elif "__len__" in dir(value):
+ f = "\%.%is" % 72 // len(value) - 1
+ line += " ".join([f % i for i in value])
+ else:
+ line += str(value)
+ headers.append(line.ljust(80, " "))
+
+ header = "".join(headers)
+ if len(header) > 512 * self.header["HDRBLKS"]:
+ tmp = ceil(len(header) / 512.0)
+ self.header["HDRBLKS"] = int(ceil(tmp / 5.0) * 5.0)
+ for i in range(len(headers)):
+ if headers[i].startswith("HDRBLKS"):
+ headers[i] = headers.append(("HDRBLKS:%s" % self.header["HDRBLKS"]).ljust(80, " "))
+ res = pad("".join(headers), self.SPACER + "." * 78, 512 * int(self.header["HDRBLKS"]))
+ return res
+
+ def gen_overflow(self):
+ """
+ Generate an overflow table
+ """
+ limit = 2 ** (8 * self.calc_bpp()) - 1
+ flat = self.data.ravel() # flat memory view
+ overflow_pos = numpy.where(flat >= limit)[0] # list of indexes
+ overflow_val = flat[overflow_pos]
+ overflow = "".join(["%09i%07i" % (val, pos) for pos, val in zip(overflow_pos, overflow_val)])
+ return pad(overflow, ".", 512)
+
+ def basic_translate(self, fname=None):
+ """
+ Does some basic population of the headers so that the writing is possible
+ """
+ if "FORMAT" not in self.header:
+ self.header["FORMAT"] = "86"
+ if "HDRBLKS" not in self.header:
+ self.header["HDRBLKS"] = 5
+ if "TYPE" not in self.header:
+ self.header["TYPE"] = "UNWARPED"
+ if "USER" not in self.header:
+ self.header["USER"] = getpass.getuser()
+ if "FILENAM" not in self.header:
+ self.header["FILENAM"] = "%s" % fname
+ if "CREATED" not in self.header:
+ self.header["CREATED"] = time.ctime()
+ if "NOVERFL" not in self.header:
+ self.header["NOVERFL"] = "0"
+# if not "NPIXELB" in self.header:
+ self.header["NPIXELB"] = self.calc_bpp()
+ # if not "NROWS" in self.header:
+ self.header["NROWS"] = self.data.shape[0]
+ # if not "NCOLS" in self.header:
+ self.header["NCOLS"] = self.data.shape[1]
+ if "WORDORD" not in self.header:
+ self.header["WORDORD"] = "0"
+ if "LONGORD" not in self.header:
+ self.header["LONGORD"] = "0"
+
+
+brukerimage = BrukerImage
diff --git a/fabio/cbfimage.py b/fabio/cbfimage.py
new file mode 100644
index 0000000..a9424d4
--- /dev/null
+++ b/fabio/cbfimage.py
@@ -0,0 +1,846 @@
+# coding: utf-8
+#
+# Project: FabIO X-ray image reader
+#
+# Copyright (C) 2010-2016 European Synchrotron Radiation Facility
+# Grenoble, France
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+"""
+Authors: Jérôme Kieffer, ESRF
+ email:jerome.kieffer@esrf.fr
+
+Cif Binary Files images are 2D images written by the Pilatus detector and others.
+They use a modified (simplified) byte-offset algorithm.
+
+CIF is a library for manipulating Crystallographic information files and tries
+to conform to the specification of the IUCR
+"""
+
+# get ready for python3
+from __future__ import with_statement, print_function, absolute_import
+
+__author__ = "Jérôme Kieffer"
+__contact__ = "jerome.kieffer@esrf.eu"
+__license__ = "MIT"
+__date__ = "11/08/2017"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__version__ = ["Generated by CIF.py: Jan 2005 - Oct 2015",
+ "Written by Jerome Kieffer: Jerome.Kieffer@esrf.eu",
+ "On-line data analysis / ISDD ", "ESRF Grenoble (France)"]
+
+
+import os
+import logging
+import numpy
+from .fabioimage import FabioImage
+from .compression import compByteOffset, decByteOffset, md5sum, six
+from .ext._cif import split_tokens
+
+
+logger = logging.getLogger(__name__)
+
+
+DATA_TYPES = {"signed 8-bit integer" : "int8",
+ "signed 16-bit integer" : "int16",
+ "signed 32-bit integer" : "int32",
+ "signed 64-bit integer" : "int64",
+ "unsigned 8-bit integer" : "uint8",
+ "unsigned 16-bit integer": "uint16",
+ "unsigned 32-bit integer": "uint32",
+ "unsigned 64-bit integer": "uint64"
+ }
+
+MINIMUM_KEYS = ["X-Binary-Size-Fastest-Dimension",
+ "X-Binary-Size-Second-Dimension",
+ "X-Binary-Size",
+ "X-Binary-Number-of-Elements",
+ 'X-Binary-Element-Type',
+ 'X-Binary-Number-of-Elements']
+
+
+class CbfImage(FabioImage):
+ """
+ Read the Cif Binary File data format
+ """
+
+ DESCRIPTION = "Cif Binary Files format (used by the Pilatus detectors and others)"
+
+ DEFAULT_EXTENTIONS = ["cbf"]
+
+ STARTER = b"\x0c\x1a\x04\xd5"
+ PADDING = 512
+ BINARAY_SECTION = b"--CIF-BINARY-FORMAT-SECTION--"
+ CIF_BINARY_BLOCK_KEY = "_array_data.data"
+
+ def __init__(self, data=None, header=None, fname=None):
+ """
+ Constructor of the class CIF Binary File reader.
+
+ :param str fname: the name of the file to open
+ """
+ FabioImage.__init__(self, data, header)
+ self.cif = CIF()
+ self.cbs = None
+ self.start_binary = None
+ if fname is not None: # load the file)
+ self.read(fname)
+
+ @staticmethod
+ def checkData(data=None):
+ if data is None:
+ return None
+ elif numpy.issubdtype(data.dtype, int):
+ return data
+ else:
+ return data.astype(int)
+
+ def _readheader(self, inStream):
+ """
+ Read in a header in some CBF format from a string representing binary stuff
+
+ :param file inStream: file containing the Cif Binary part.
+ """
+ self._read_cif_header(inStream)
+ self._read_binary_section_header(inStream)
+
+ def _read_cif_header(self, inStream):
+ """Read in a ASCII CIF header
+
+ :param inStream: file containing the Cif Binary part.
+ :type inStream: opened file.
+ """
+ blocks = []
+ last = ""
+ header_data = None
+ for i in range(16):
+ # up to 512*16 = 8k headers
+ ablock = inStream.read(self.PADDING)
+ blocks.append(ablock)
+ if last:
+ extra = len(self.BINARAY_SECTION)
+ extblock = last[-extra:] + ablock
+ else:
+ extra = 0
+ extblock = ablock
+ res = extblock.find(self.BINARAY_SECTION)
+ if res >= 0:
+ start_cbs = i * self.PADDING - extra + res
+ all_blocks = b"".join(blocks)
+ header_data = all_blocks[:start_cbs] + b"CIF Binary Section\n;\n"
+ self.cbs = all_blocks[start_cbs:]
+ break
+ last = ablock
+ else:
+ header_data = b"".join(blocks) + inStream.read()
+ self.cif._parseCIF(header_data)
+
+ # backport contents of the CIF data to the headers
+ for key, value in self.cif.items():
+ if key == self.CIF_BINARY_BLOCK_KEY:
+ if self.cbs is None:
+ self.cbs = value
+ else:
+ self.header[key] = (self.cif[key].strip(" \"\n\r\t"))
+
+ def _read_binary_section_header(self, inStream):
+ """
+ Read the binary section header
+ """
+ self.start_binary = self.cbs.find(self.STARTER)
+ while self.start_binary < 0:
+ self.cbs += inStream.read(self.PADDING)
+ self.start_binary = self.cbs.find(self.STARTER)
+ bin_headers = self.cbs[:self.start_binary]
+ lines = bin_headers.split(b"\n")
+ for line in lines[1:]:
+ if len(line) < 10:
+ break
+ try:
+ key, val = line.split(b':', 1)
+ except ValueError:
+ key, val = line.split(b'=', 1)
+ key = key.strip().decode("ASCII")
+ self.header[key] = val.strip(b" \"\n\r\t").decode("ASCII")
+ missing = []
+ for item in MINIMUM_KEYS:
+ if item not in self.header:
+ missing.append(item)
+ if missing:
+ logger.info("Mandatory keys missing in CBF file: " + ", ".join(missing))
+ # Compute image size
+ try:
+ self.dim1 = int(self.header['X-Binary-Size-Fastest-Dimension'])
+ self.dim2 = int(self.header['X-Binary-Size-Second-Dimension'])
+ except (KeyError, ValueError):
+ raise IOError("CBF file %s is corrupt, no dimensions in it" % inStream.name)
+ try:
+ self.bytecode = DATA_TYPES[self.header['X-Binary-Element-Type']]
+ except KeyError:
+ self.bytecode = "int32"
+ logger.warning("Defaulting type to int32")
+ self.bpp = numpy.dtype(self.bytecode).itemsize
+
+ def read_raw_data(self, infile):
+ """Read and return the raw data chunk
+
+ :param infile: opened file are correct position
+ :return: raw compressed stream
+ """
+ if self.CIF_BINARY_BLOCK_KEY not in self.cif:
+ err = "Not key %s in CIF, no CBF image in %s" % (self.CIF_BINARY_BLOCK_KEY, self.filename)
+ logger.error(err)
+ for kv in self.cif.items():
+ logger.debug("%s: %s", kv)
+ raise RuntimeError(err)
+ if self.cif[self.CIF_BINARY_BLOCK_KEY] == "CIF Binary Section":
+ self.cbs += infile.read(len(self.STARTER) + int(self.header["X-Binary-Size"]) - len(self.cbs) + self.start_binary)
+ else:
+ if len(self.cif[self.CIF_BINARY_BLOCK_KEY]) > int(self.header["X-Binary-Size"]) + self.start_binary + len(self.STARTER):
+ self.cbs = self.cif[self.CIF_BINARY_BLOCK_KEY][:int(self.header["X-Binary-Size"]) + self.start_binary + len(self.STARTER)]
+ else:
+ self.cbs = self.cif[self.CIF_BINARY_BLOCK_KEY]
+ return self.cbs[self.start_binary + len(self.STARTER):]
+
+ def read(self, fname, frame=None, check_MD5=True, only_raw=False):
+ """Read in header into self.header and the data into self.data
+
+ :param str fname: name of the file
+ :return: fabioimage instance
+ """
+ self.filename = fname
+ self.header = self.check_header()
+ self.resetvals()
+
+ infile = self._open(fname, "rb")
+ self._readheader(infile)
+
+ logger.debug("CBS type %s len %s" % (type(self.cbs), len(self.cbs)))
+
+ binary_data = self.read_raw_data(infile)
+ if only_raw:
+ return binary_data
+
+ if ("Content-MD5" in self.header) and check_MD5:
+ ref = numpy.string_(self.header["Content-MD5"])
+ obt = md5sum(binary_data)
+ if ref != obt:
+ logger.error("Checksum of binary data mismatch: expected %s, got %s" % (ref, obt))
+
+ if self.header["conversions"] == "x-CBF_BYTE_OFFSET":
+ self.data = numpy.ascontiguousarray(self._readbinary_byte_offset(binary_data,), self.bytecode).reshape((self.dim2, self.dim1))
+ else:
+ raise Exception(IOError, "Compression scheme not yet supported, please contact the author")
+
+ self.resetvals()
+# # ensure the PIL image is reset
+ self.pilimage = None
+ return self
+
+ def _readbinary_byte_offset(self, raw_bytes):
+ """
+ Read in a binary part of an x-CBF_BYTE_OFFSET compressed image
+
+ :param str inStream: the binary image (without any CIF decorators)
+ :return: a linear numpy array without shape and dtype set
+ :rtype: numpy array
+ """
+ myData = decByteOffset(raw_bytes, size=self.dim1 * self.dim2, dtype=self.bytecode)
+ assert len(myData) == self.dim1 * self.dim2
+ return myData
+
+ def write(self, fname):
+ """
+ write the file in CBF format
+ :param str fname: name of the file
+ """
+ if self.data is not None:
+ self.dim2, self.dim1 = self.data.shape
+ else:
+ raise RuntimeError("CBF image contains no data")
+ binary_blob = compByteOffset(self.data)
+ dtype = "Unknown"
+ for key, value in DATA_TYPES.items():
+ if value == self.data.dtype:
+ dtype = key
+ binary_block = [b"--CIF-BINARY-FORMAT-SECTION--",
+ b"Content-Type: application/octet-stream;",
+ b' conversions="x-CBF_BYTE_OFFSET"',
+ b'Content-Transfer-Encoding: BINARY',
+ numpy.string_("X-Binary-Size: %d" % (len(binary_blob))),
+ b"X-Binary-ID: 1",
+ numpy.string_('X-Binary-Element-Type: "%s"' % (dtype)),
+ b"X-Binary-Element-Byte-Order: LITTLE_ENDIAN",
+ b"Content-MD5: " + md5sum(binary_blob),
+ numpy.string_("X-Binary-Number-of-Elements: %d" % (self.dim1 * self.dim2)),
+ numpy.string_("X-Binary-Size-Fastest-Dimension: %d" % self.dim1),
+ numpy.string_("X-Binary-Size-Second-Dimension: %d" % self.dim2),
+ b"X-Binary-Size-Padding: 1",
+ b"",
+ self.STARTER + binary_blob,
+ b"",
+ b"--CIF-BINARY-FORMAT-SECTION----"]
+
+ if "_array_data.header_contents" not in self.header:
+ nonCifHeaders = []
+ else:
+ nonCifHeaders = [i.strip()[2:] for i in self.header["_array_data.header_contents"].split("\n") if i.find("# ") >= 0]
+
+ for key in self.header:
+ if key.startswith("_"):
+ if key not in self.cif or self.cif[key] != self.header[key]:
+ self.cif[key] = self.header[key]
+ elif key.startswith("X-Binary-"):
+ pass
+ elif key.startswith("Content-"):
+ pass
+ elif key.startswith("conversions"):
+ pass
+ elif key.startswith("filename"):
+ pass
+ elif key in self.header:
+ nonCifHeaders.append("%s %s" % (key, self.header[key]))
+ if len(nonCifHeaders) > 0:
+ self.cif["_array_data.header_contents"] = "\r\n".join(["# %s" % i for i in nonCifHeaders])
+
+ self.cbf = b"\r\n".join(binary_block)
+ block = b"\r\n".join([b"", self.CIF_BINARY_BLOCK_KEY.encode("ASCII"), b";", self.cbf, b";"])
+ self.cif.pop(self.CIF_BINARY_BLOCK_KEY, None)
+ with open(fname, "wb") as out_file:
+ out_file.write(self.cif.tostring(fname, "\r\n").encode("ASCII"))
+ out_file.write(block)
+
+
+################################################################################
+# CIF class
+################################################################################
+class CIF(dict):
+ """
+ This is the CIF class, it represents the CIF dictionary;
+ and as a a python dictionary thus inherits from the dict built in class.
+
+ keys are always unicode (str in python3)
+ values are bytes
+ """
+ EOL = [numpy.string_(i) for i in ("\r", "\n", "\r\n", "\n\r")]
+ BLANK = [numpy.string_(i) for i in (" ", "\t")] + EOL
+ SINGLE_QUOTE = numpy.string_("'")
+ DOUBLE_QUOTE = numpy.string_('"')
+ SEMICOLUMN = numpy.string_(';')
+ START_COMMENT = (SINGLE_QUOTE, DOUBLE_QUOTE)
+ BINARY_MARKER = numpy.string_("--CIF-BINARY-FORMAT-SECTION--")
+ HASH = numpy.string_("#")
+ LOOP = numpy.string_("loop_")
+ UNDERSCORE = ord("_") if six.PY3 else b"_"
+ QUESTIONMARK = ord("?") if six.PY3 else b"?"
+ STOP = numpy.string_("stop_")
+ GLOBAL = numpy.string_("global_")
+ DATA = numpy.string_("data_")
+ SAVE = numpy.string_("save_")
+
+ def __init__(self, _strFilename=None):
+ """
+ Constructor of the class.
+
+ :param _strFilename: the name of the file to open
+ :type _strFilename: filename (str) or file object
+ """
+ dict.__init__(self)
+ self._ordered = []
+ if _strFilename is not None: # load the file)
+ self.loadCIF(_strFilename)
+
+ def __setitem__(self, key, value):
+ if key not in self._ordered:
+ self._ordered.append(key)
+ return dict.__setitem__(self, key, value)
+
+ def pop(self, key, default=None):
+ if key in self._ordered:
+ self._ordered.remove(key)
+ return dict.pop(self, key, default)
+
+ def popitem(self, key, default=None):
+ if key in self._ordered:
+ self._ordered.remove(key)
+ return dict.popitem(self, key, None)
+
+ def loadCIF(self, _strFilename, _bKeepComment=False):
+ """Load the CIF file and populates the CIF dictionary into the object
+
+ :param str _strFilename: the name of the file to open
+ :return: None
+ """
+ own_fd = False
+ if isinstance(_strFilename, (six.binary_type, six.text_type)):
+ if os.path.isfile(_strFilename):
+ infile = open(_strFilename, "rb")
+ own_fd = True
+ else:
+ raise RuntimeError("CIF.loadCIF: No such file to open: %s" % _strFilename)
+ elif "read" in dir(_strFilename):
+ infile = _strFilename
+ else:
+ raise RuntimeError("CIF.loadCIF: what is %s type %s" % (_strFilename, type(_strFilename)))
+ if _bKeepComment:
+ self._parseCIF(numpy.string_(infile.read()))
+ else:
+ self._parseCIF(CIF._readCIF(infile))
+ if own_fd:
+ infile.close()
+ readCIF = loadCIF
+
+ @staticmethod
+ def isAscii(text):
+ """
+ Check if all characters in a string are ascii,
+
+ :param str text: input string
+ :return: boolean
+ :rtype: boolean
+ """
+ try:
+ text.decode("ascii")
+ except UnicodeDecodeError:
+ return False
+ else:
+ return True
+
+ @classmethod
+ def _readCIF(cls, instream):
+ """
+ - Check if the filename containing the CIF data exists
+ - read the cif file
+ - removes the comments
+
+ :param file instream: opened file object containing the CIF data
+ :return: a set of bytes (8-bit string) containing the raw data
+ :rtype: string
+ """
+ if "read" not in dir(instream):
+ raise RuntimeError("CIF._readCIF(instream): I expected instream to be an opened file,\
+ here I got %s type %s" % (instream, type(instream)))
+ out_bytes = numpy.string_("")
+ for sLine in instream:
+ nline = numpy.string_(sLine)
+ pos = nline.find(cls.HASH)
+ if pos >= 0:
+ if cls.isAscii(nline):
+ out_bytes += nline[:pos] + numpy.string_(os.linesep)
+ if pos > 80:
+ logger.warning("This line is too long and could cause problems in PreQuest: %s", sLine)
+ else:
+ out_bytes += nline
+ if len(sLine.strip()) > 80:
+ logger.warning("This line is too long and could cause problems in PreQuest: %s", sLine)
+ return out_bytes
+
+ def _parseCIF(self, bytes_text):
+ """
+ - Parses the text of a CIF file
+ - Cut it in fields
+ - Find all the loops and process
+ - Find all the keys and values
+
+ :param bytes_text: the content of the CIF - file
+ :type bytes_text: 8-bit string (str in python2 or bytes in python3)
+ :return: Nothing, the data are incorporated at the CIF object dictionary
+ :rtype: None
+ """
+ loopidx = []
+ looplen = []
+ loop = []
+ fields = split_tokens(bytes_text)
+
+ logger.debug("After split got %s fields of len: %s", len(fields), [len(i) for i in fields])
+
+ for idx, field in enumerate(fields):
+ if field.lower() == self.LOOP:
+ loopidx.append(idx)
+ if loopidx:
+ for i in loopidx:
+ loopone, length, keys = CIF._analyseOneLoop(fields, i)
+ loop.append([keys, loopone])
+ looplen.append(length)
+
+ for i in range(len(loopidx) - 1, -1, -1):
+ f1 = fields[:loopidx[i]] + fields[loopidx[i] + looplen[i]:]
+ fields = f1
+
+ self[self.LOOP.decode("ASCII")] = loop
+
+ for i in range(len(fields) - 1):
+ if len(fields[i + 1]) == 0:
+ fields[i + 1] = self.QUESTIONMARK
+ if fields[i][0] == self.UNDERSCORE and fields[i + 1][0] != self.UNDERSCORE:
+ try:
+ data = fields[i + 1].decode("ASCII")
+ except UnicodeError:
+ logger.warning("Unable to decode in ascii: %s" % fields[i + 1])
+ data = fields[i + 1]
+ self[(fields[i]).decode("ASCII")] = data
+
+ @classmethod
+ def _splitCIF(cls, bytes_text):
+ """
+ Separate the text in fields as defined in the CIF
+
+ :param bytes_text: the content of the CIF - file
+ :type bytes_text: 8-bit string (str in python2 or bytes in python3)
+ :return: list of all the fields of the CIF
+ :rtype: list
+ """
+ fields = []
+ while True:
+ if len(bytes_text) == 0:
+ break
+ elif bytes_text[0] == cls.SINGLE_QUOTE:
+ idx = 0
+ finished = False
+ while not finished:
+ idx += 1 + bytes_text[idx + 1:].find(cls.SINGLE_QUOTE)
+ if idx >= len(bytes_text) - 1:
+ fields.append(bytes_text[1:-1].strip())
+ bytes_text = numpy.string_("")
+ finished = True
+ break
+
+ if bytes_text[idx + 1] in cls.BLANK:
+ fields.append(bytes_text[1:idx].strip())
+ tmp_text = bytes_text[idx + 1:]
+ bytes_text = tmp_text.strip()
+ finished = True
+
+ elif bytes_text[0] == cls.DOUBLE_QUOTE:
+ idx = 0
+ finished = False
+ while not finished:
+ idx += 1 + bytes_text[idx + 1:].find(cls.DOUBLE_QUOTE)
+ if idx >= len(bytes_text) - 1:
+ fields.append(bytes_text[1:-1].strip())
+ bytes_text = numpy.string_("")
+ finished = True
+ break
+
+ if bytes_text[idx + 1] in cls.BLANK:
+ fields.append(bytes_text[1:idx].strip())
+ tmp_text = bytes_text[idx + 1:]
+ bytes_text = tmp_text.strip()
+ finished = True
+
+ elif bytes_text[0] == cls.SEMICOLUMN:
+ if bytes_text[1:].strip().find(cls.BINARY_MARKER) == 0:
+ idx = bytes_text[32:].find(cls.BINARY_MARKER)
+ if idx == -1:
+ idx = 0
+ else:
+ idx += 32 + len(cls.BINARY_MARKER)
+ else:
+ idx = 0
+ finished = False
+ while not finished:
+ idx += 1 + bytes_text[idx + 1:].find(cls.SEMICOLUMN)
+ if bytes_text[idx - 1] in cls.EOL:
+ fields.append(bytes_text[1:idx - 1].strip())
+ tmp_text = bytes_text[idx + 1:]
+ bytes_text = tmp_text.strip()
+ finished = True
+ else:
+ res = bytes_text.split(None, 1)
+ if len(res) == 2:
+ first, second = bytes_text.split(None, 1)
+ if cls.isAscii(first):
+ fields.append(first)
+ bytes_text = second.strip()
+ continue
+ start_binary = bytes_text.find(cls.BINARY_MARKER)
+ if start_binary > 0:
+ end_binary = bytes_text[start_binary + 1:].find(cls.BINARY_MARKER) + start_binary + 1 + len(cls.BINARY_MARKER)
+ fields.append(bytes_text[:end_binary])
+ bytes_text = bytes_text[end_binary:].strip()
+ else:
+ fields.append(bytes_text)
+ bytes_text = numpy.string_("")
+ break
+ return fields
+
+ @classmethod
+ def _analyseOneLoop(cls, fields, start_idx):
+ """Processes one loop in the data extraction of the CIF file
+ :param list fields: list of all the words contained in the cif file
+ :param int start_idx: the starting index corresponding to the "loop_" key
+ :return: the list of loop dictionaries, the length of the data
+ extracted from the fields and the list of all the keys of the loop.
+ :rtype: tuple
+ """
+ loop = []
+ keys = []
+ i = start_idx + 1
+ finished = False
+ while not finished:
+ if fields[i][0] == cls.UNDERSCORE:
+ keys.append(fields[i])
+ i += 1
+ else:
+ finished = True
+ data = []
+ while True:
+ if i >= len(fields):
+ break
+ elif len(fields[i]) == 0:
+ break
+ elif fields[i][0] == cls.UNDERSCORE:
+ break
+ elif fields[i] in (cls.LOOP, cls.STOP, cls.GLOBAL, cls.DATA, cls.SAVE):
+ break
+ else:
+ data.append(fields[i])
+ i += 1
+ k = 0
+
+ if len(data) < len(keys):
+ element = {}
+ for j in keys:
+ if k < len(data):
+ element[j] = data[k]
+ else:
+ element[j] = cls.QUESTIONMARK
+ k += 1
+ loop.append(element)
+
+ else:
+ for i in range(len(data) / len(keys)):
+ element = {}
+ for j in keys:
+ element[j] = data[k]
+ k += 1
+ loop.append(element)
+ return loop, 1 + len(keys) + len(data), keys
+
+##########################################
+# everything needed to write a CIF file #
+##########################################
+ def saveCIF(self, _strFilename="test.cif", linesep=os.linesep, binary=False):
+ """Transforms the CIF object in string then write it into the given file
+ :param _strFilename: the of the file to be written
+ :param linesep: line separation used (to force compatibility with windows/unix)
+ :param binary: Shall we write the data as binary (True only for imageCIF/CBF)
+ :return: None
+ """
+ if binary:
+ mode = "wb"
+ else:
+ mode = "w"
+ try:
+ fFile = open(_strFilename, mode)
+ except IOError:
+ logger.error("Error during the opening of file for write: %s",
+ _strFilename)
+ return
+ fFile.write(self.tostring(_strFilename, linesep))
+ try:
+ fFile.close()
+ except IOError:
+ logger.error("Error during the closing of file for write: %s",
+ _strFilename)
+
+ def tostring(self, _strFilename=None, linesep=os.linesep):
+ """
+ Converts a cif dictionnary to a string according to the CIF syntax.
+
+ :param str _strFilename: the name of the filename to be appended in the
+ header of the CIF file.
+ :param linesep: default line separation (can be '\\n' or '\\r\\n').
+ :return: a string that corresponds to the content of the CIF-file.
+ """
+ lstStrCif = ["# " + i for i in __version__]
+ if "_chemical_name_common" in self:
+ t = self["_chemical_name_common"].split()[0]
+ elif _strFilename is not None:
+ t = os.path.splitext(os.path.split(str(_strFilename).strip())[1])[0]
+ else:
+ t = ""
+ lstStrCif.append("data_%s" % (t))
+ # first of all get all the keys:
+ lKeys = list(self.keys())
+ lKeys.sort()
+ for key in lKeys[:]:
+ if key in self._ordered:
+ lKeys.remove(key)
+ self._ordered += lKeys
+
+ for sKey in self._ordered:
+ if sKey == "loop_":
+ continue
+ if sKey not in self:
+ self._ordered.remove(sKey)
+ logger.debug("Skipping key %s from ordered list as no more present in dict")
+ continue
+ sValue = str(self[sKey])
+ if sValue.find("\n") > -1: # should add value between ;;
+ lLine = [sKey, ";", sValue, ";", ""]
+ elif len(sValue.split()) > 1: # should add value between ''
+ sLine = "%s '%s'" % (sKey, sValue)
+ if len(sLine) > 80:
+ lLine = [str(sKey), sValue]
+ else:
+ lLine = [sLine]
+ else:
+ sLine = "%s %s" % (sKey, sValue)
+ if len(sLine) > 80:
+ lLine = [str(sKey), sValue]
+ else:
+ lLine = [sLine]
+ lstStrCif += lLine
+ if "loop_" in self:
+ for loop in self["loop_"]:
+ lstStrCif.append("loop_ ")
+ lKeys = loop[0]
+ llData = loop[1]
+ lstStrCif += [" %s" % (sKey) for sKey in lKeys]
+ for lData in llData:
+ sLine = " "
+ for key in lKeys:
+ sRawValue = lData[key]
+ if sRawValue.find("\n") > -1: # should add value between ;;
+ lstStrCif += [sLine, ";", str(sRawValue), ";"]
+ sLine = " "
+ else:
+ if len(sRawValue.split()) > 1: # should add value between ''
+ value = "'%s'" % (sRawValue)
+ else:
+ value = str(sRawValue)
+ if len(sLine) + len(value) > 78:
+ lstStrCif += [sLine]
+ sLine = " " + value
+ else:
+ sLine += " " + value
+ lstStrCif.append(sLine)
+ lstStrCif.append("")
+ return linesep.join(lstStrCif)
+
+ def exists(self, sKey):
+ """
+ Check if the key exists in the CIF and is non empty.
+
+ :param str sKey: CIF key
+ :param cif: CIF dictionary
+ :return: True if the key exists in the CIF dictionary and is non empty
+ :rtype: boolean
+ """
+ bExists = False
+ if sKey in self:
+ if len(self[sKey]) >= 1:
+ if self[sKey][0] not in (self.QUESTIONMARK, numpy.string_(".")):
+ bExists = True
+ return bExists
+
+ def existsInLoop(self, sKey):
+ """
+ Check if the key exists in the CIF dictionary.
+
+ :param str sKey: CIF key
+ :param cif: CIF dictionary
+ :return: True if the key exists in the CIF dictionary and is non empty
+ :rtype: boolean
+ """
+ if not self.exists(self.LOOP):
+ return False
+ bExists = False
+ if not bExists:
+ for i in self[self.LOOP]:
+ for j in i[0]:
+ if j == sKey:
+ bExists = True
+ return bExists
+
+ def loadCHIPLOT(self, _strFilename):
+ """
+ Load the powder diffraction CHIPLOT file and returns the
+ pd_CIF dictionary in the object
+
+ :param str _strFilename: the name of the file to open
+ :return: the CIF object corresponding to the powder diffraction
+ :rtype: dictionary
+ """
+ if not os.path.isfile(_strFilename):
+ errStr = "I cannot find the file %s" % _strFilename
+ logger.error(errStr)
+ raise IOError(errStr)
+ lInFile = open(_strFilename, "r").readlines()
+ self["_audit_creation_method"] = 'From 2-D detector using FIT2D and CIFfile'
+ self["_pd_meas_scan_method"] = "fixed"
+ self["_pd_spec_description"] = lInFile[0].strip()
+ try:
+ iLenData = int(lInFile[3])
+ except ValueError:
+ iLenData = None
+ lOneLoop = []
+ try:
+ f2ThetaMin = float(lInFile[4].split()[0])
+ last = ""
+ for sLine in lInFile[-20:]:
+ if sLine.strip() != "":
+ last = sLine.strip()
+ f2ThetaMax = float(last.split()[0])
+ limitsOK = True
+
+ except (ValueError, IndexError):
+ limitsOK = False
+ f2ThetaMin = 180.0
+ f2ThetaMax = 0
+# print "limitsOK:", limitsOK
+ for sLine in lInFile[4:]:
+ sCleaned = sLine.split("#")[0].strip()
+ data = sCleaned.split()
+ if len(data) == 2:
+ if not limitsOK:
+ f2Theta = float(data[0])
+ if f2Theta < f2ThetaMin:
+ f2ThetaMin = f2Theta
+ if f2Theta > f2ThetaMax:
+ f2ThetaMax = f2Theta
+ lOneLoop.append({"_pd_meas_intensity_total": data[1]})
+ if not iLenData:
+ iLenData = len(lOneLoop)
+ assert (iLenData == len(lOneLoop))
+ self["_pd_meas_2theta_range_inc"] = "%.4f" % ((f2ThetaMax - f2ThetaMin) / (iLenData - 1))
+ if self["_pd_meas_2theta_range_inc"] < 0:
+ self["_pd_meas_2theta_range_inc"] = abs(self["_pd_meas_2theta_range_inc"])
+ tmp = f2ThetaMax
+ f2ThetaMax = f2ThetaMin
+ f2ThetaMin = tmp
+ self["_pd_meas_2theta_range_max"] = "%.4f" % f2ThetaMax
+ self["_pd_meas_2theta_range_min"] = "%.4f" % f2ThetaMin
+ self["_pd_meas_number_of_points"] = str(iLenData)
+ self[self.LOOP] = [[["_pd_meas_intensity_total"], lOneLoop]]
+
+ @staticmethod
+ def LoopHasKey(loop, key):
+ "Returns True if the key (string) exist in the array called loop"""
+ try:
+ loop.index(key)
+ return True
+ except ValueError:
+ return False
+
+
+cbfimage = CbfImage
diff --git a/fabio/compression.py b/fabio/compression.py
new file mode 100644
index 0000000..5f8d4c8
--- /dev/null
+++ b/fabio/compression.py
@@ -0,0 +1,456 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+
+"""Compression and decompression algorithm for various formats
+
+Authors: Jérôme Kieffer, ESRF
+ email:jerome.kieffer@esrf.fr
+
+"""
+# get ready for python3
+from __future__ import absolute_import, print_function, with_statement, division
+__author__ = "Jérôme Kieffer"
+__contact__ = "jerome.kieffer@esrf.eu"
+__license__ = "MIT"
+__date__ = "11/08/2017"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+
+
+import sys
+import base64
+import hashlib
+import logging
+import subprocess
+import numpy
+
+try:
+ from .third_party import six
+except ImportError:
+ import six
+
+if six.PY2:
+ bytes = str
+
+logger = logging.getLogger(__name__)
+
+try:
+ from .third_party import gzip
+except ImportError:
+ logger.error("Unable to import gzip module: disabling gzip compression")
+ gzip = None
+
+try:
+ import bz2
+except ImportError:
+ logger.error("Unable to import bz2 module: disabling bz2 compression")
+ bz2 = None
+
+try:
+ import zlib
+except ImportError:
+ logger.error("Unable to import zlib module: disabling zlib compression")
+ zlib = None
+
+if sys.platform != "win32":
+ WindowsError = OSError
+
+
+def md5sum(blob):
+ """
+ returns the md5sum of an object...
+ """
+ return base64.b64encode(hashlib.md5(blob).digest())
+
+
+def endianness():
+ """
+ Return the native endianness of the system
+ """
+ if numpy.little_endian:
+ return "LITTLE_ENDIAN"
+ else:
+ return "BIG_ENDIAN"
+
+
+class ExternalCompressors(object):
+ """Class to handle lazy discovery of external compression programs"""
+ COMMANDS = {".bz2": ["bzip2" "-dcf"],
+ ".gz": ["gzip", "-dcf"]
+ }
+
+ def __init__(self):
+ """Empty constructor"""
+ self.compressors = {}
+
+ def __getitem__(self, key):
+ """Implement the dict-like behavior"""
+ if key not in self.compressors:
+ if key in self.COMMANDS:
+ commandline = self.COMMANDS[key]
+ testline = [commandline[0], "-h"]
+ try:
+ lines = subprocess.check_output(testline,
+ stderr=subprocess.STDOUT,
+ universal_newlines=True)
+ if "usage" in lines.lower():
+ self.compressors[key] = commandline
+ else:
+ self.compressors[key] = None
+ except (subprocess.CalledProcessError, WindowsError) as err:
+ logger.debug("No %s utility found: %s", commandline[0], err)
+ self.compressors[key] = None
+ else:
+ self.compressors[key] = None
+ return self.compressors[key]
+
+
+COMPRESSORS = ExternalCompressors()
+
+
+def decGzip(stream):
+ """Decompress a chunk of data using the gzip algorithm from system or from Python
+
+ :param stream: compressed data
+ :return: uncompressed stream
+
+ """
+ def _python_gzip(stream):
+ """Inefficient implementation based on loops in Python"""
+ for i in range(1, 513):
+ try:
+ fileobj = six.BytesIO(stream[:-i])
+ uncompessed = gzip.GzipFile(fileobj=fileobj).read()
+ except IOError:
+ logger.debug("trying with %s bytes less, doesn't work" % i)
+ else:
+ return uncompessed
+
+ if gzip is None:
+ raise ImportError("gzip module is not available")
+ fileobj = six.BytesIO(stream)
+ try:
+ uncompessed = gzip.GzipFile(fileobj=fileobj).read()
+ except IOError:
+ logger.warning("Encounter the python-gzip bug with trailing garbage, trying subprocess gzip")
+ cmd = COMPRESSORS[".gz"]
+ if cmd:
+ try:
+ sub = subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
+ uncompessed, err = sub.communicate(input=stream)
+ logger.debug("Gzip subprocess ended with %s err= %s; I got %s bytes back" % (sub.wait(), err, len(uncompessed)))
+ except OSError as error:
+ logger.warning("Unable to use the subprocess gzip (%s). Is gzip available? " % error)
+ uncompessed = _python_gzip(stream)
+ else:
+ uncompessed = _python_gzip(stream)
+ if uncompessed is None:
+ logger.error("I am totally unable to read this gzipped compressed data block, giving up")
+ return uncompessed
+
+
+def decBzip2(stream):
+ """
+ Decompress a chunk of data using the bzip2 algorithm from Python
+ """
+ if bz2 is None:
+ raise ImportError("bz2 module is not available")
+ return bz2.decompress(stream)
+
+
+def decZlib(stream):
+ """
+ Decompress a chunk of data using the zlib algorithm from Python
+ """
+ if zlib is None:
+ raise ImportError("zlib module is not available")
+ return zlib.decompress(stream)
+
+
+def decByteOffset_numpy(stream, size=None, dtype="int64"):
+ """
+ Analyze a stream of char with any length of exception:
+ 2, 4, or 8 bytes integers
+
+ :param stream: string representing the compressed data
+ :param size: the size of the output array (of longInts)
+ :return: 1D-ndarray
+
+ """
+ logger.debug("CBF decompression using Numpy")
+ listnpa = []
+ key16 = b"\x80"
+ key32 = b"\x00\x80"
+ key64 = b"\x00\x00\x00\x80"
+ shift = 1
+ while True:
+ idx = stream.find(key16)
+ if idx == -1:
+ listnpa.append(numpy.fromstring(stream, dtype="int8"))
+ break
+ listnpa.append(numpy.fromstring(stream[:idx], dtype="int8"))
+
+ if stream[idx + 1:idx + 3] == key32:
+ if stream[idx + 3:idx + 7] == key64:
+ # 64 bits int
+ res = numpy.fromstring(stream[idx + 7:idx + 15], dtype="int64")
+ listnpa.append(res)
+ shift = 15
+ else:
+ # 32 bits int
+ res = numpy.fromstring(stream[idx + 3:idx + 7], dtype="int32")
+ listnpa.append(res)
+ shift = 7
+ else: # int16
+ res = numpy.fromstring(stream[idx + 1:idx + 3], dtype="int16")
+ listnpa.append(res)
+ shift = 3
+ stream = stream[idx + shift:]
+ if not numpy.little_endian:
+ for res in listnpa:
+ if res.dtype != numpy.int8:
+ res.byteswap(True)
+ return numpy.ascontiguousarray(numpy.hstack(listnpa), dtype).cumsum()
+
+
+def decByteOffset_cython(stream, size=None, dtype="int64"):
+ """
+ Analyze a stream of char with any length of exception:
+ 2, 4, or 8 bytes integers
+
+ :param stream: string representing the compressed data
+ :param size: the size of the output array (of longInts)
+ :return: 1D-ndarray
+
+ """
+ logger.debug("CBF decompression using cython")
+ try:
+ from .ext import byte_offset
+ except ImportError as error:
+ logger.error("Failed to import byte_offset cython module, falling back on numpy method: %s", error)
+ return decByteOffset_numpy(stream, size, dtype=dtype)
+ else:
+ if dtype == "int32":
+ return byte_offset.dec_cbf32(stream, size)
+ else:
+ return byte_offset.dec_cbf(stream, size)
+
+
+decByteOffset = decByteOffset_cython
+
+
+def compByteOffset_numpy(data):
+ """
+ Compress a dataset into a string using the byte_offet algorithm
+
+ :param data: ndarray
+ :return: string/bytes with compressed data
+
+ test = numpy.array([0,1,2,127,0,1,2,128,0,1,2,32767,0,1,2,32768,0,1,2,2147483647,0,1,2,2147483648,0,1,2,128,129,130,32767,32768,128,129,130,32768,2147483647,2147483648])
+
+ """
+ flat = numpy.ascontiguousarray(data.ravel(), numpy.int64)
+ delta = numpy.zeros_like(flat)
+ delta[0] = flat[0]
+ delta[1:] = flat[1:] - flat[:-1]
+ mask = abs(delta) > 127
+ exceptions = numpy.nonzero(mask)[0]
+ if numpy.little_endian:
+ byteswap = False
+ else:
+ byteswap = True
+ start = 0
+ binary_blob = b""
+ for stop in exceptions:
+ if stop - start > 0:
+ binary_blob += delta[start:stop].astype("int8").tostring()
+ exc = delta[stop]
+ absexc = abs(exc)
+ if absexc > 2147483647: # 2**31-1
+ binary_blob += b"\x80\x00\x80\x00\x00\x00\x80"
+ if byteswap:
+ binary_blob += delta[stop:stop + 1].byteswap().tostring()
+ else:
+ binary_blob += delta[stop:stop + 1].tostring()
+ elif absexc > 32767: # 2**15-1
+ binary_blob += b"\x80\x00\x80"
+ if byteswap:
+ binary_blob += delta[stop:stop + 1].astype(numpy.int32).byteswap().tostring()
+ else:
+ binary_blob += delta[stop:stop + 1].astype(numpy.int32).tostring()
+ else: # >127
+ binary_blob += b"\x80"
+ if byteswap:
+ binary_blob += delta[stop:stop + 1].astype(numpy.int16).byteswap().tostring()
+ else:
+ binary_blob += delta[stop:stop + 1].astype(numpy.int16).tostring()
+ start = stop + 1
+ if start < delta.size:
+ binary_blob += delta[start:].astype(numpy.int8).tostring()
+ return binary_blob
+
+
+def compByteOffset_cython(data):
+ """
+ Compress a dataset into a string using the byte_offet algorithm
+
+ :param data: ndarray
+ :return: string/bytes with compressed data
+
+ test = numpy.array([0,1,2,127,0,1,2,128,0,1,2,32767,0,1,2,32768,0,1,2,2147483647,0,1,2,2147483648,0,1,2,128,129,130,32767,32768,128,129,130,32768,2147483647,2147483648])
+
+ """
+ logger.debug("CBF compression using cython")
+ try:
+ from .ext import byte_offset
+ except ImportError as error:
+ logger.error("Failed to import byte_offset cython module, falling back on numpy method: %s", error)
+ return compByteOffset_numpy(data)
+ else:
+ if "int32" in str(data.dtype):
+ return byte_offset.comp_cbf32(data).tostring()
+ else:
+ return byte_offset.comp_cbf(data).tostring()
+
+
+compByteOffset = compByteOffset_cython
+
+
+def decTY1(raw_8, raw_16=None, raw_32=None):
+ """
+ Modified byte offset decompressor used in Oxford Diffraction images
+
+ Note: Always expect little endian data on the disk
+
+ :param raw_8: strings containing raw data with integer 8 bits
+ :param raw_16: strings containing raw data with integer 16 bits
+ :param raw_32: strings containing raw data with integer 32 bits
+ :return: numpy.ndarray
+
+ """
+ data = numpy.fromstring(raw_8, dtype="uint8").astype(int)
+ data -= 127
+ if raw_32 is not None:
+ int32 = numpy.fromstring(raw_32, dtype="int32")
+ if not numpy.little_endian:
+ int32.byteswap(True)
+ exception32 = numpy.nonzero(data == 128)
+ if raw_16 is not None:
+ int16 = numpy.fromstring(raw_16, dtype="int16")
+ if not numpy.little_endian:
+ int16.byteswap(True)
+ exception16 = numpy.nonzero(data == 127)
+ data[exception16] = int16
+ if raw_32:
+ data[exception32] = int32
+ summed = data.cumsum()
+ smax = summed.max()
+ if (smax > (2 ** 31 - 1)):
+ bytecode = "int64"
+ elif (smax > (2 ** 15 - 1)):
+ bytecode = "int32"
+ elif (smax > (2 ** 7 - 1)):
+ bytecode = "int16"
+ else:
+ bytecode = "int8"
+ return summed.astype(bytecode)
+
+
+decKM4CCD = decTY1
+
+
+def compTY1(data):
+ """
+ Modified byte offset compressor used in Oxford Diffraction images
+
+ :param data: numpy.ndarray with the input data (integers!)
+ :return: 3-tuple of strings: raw_8,raw_16,raw_32 containing raw data with integer of the given size
+
+ """
+ fdata = data.ravel()
+ diff = numpy.zeros_like(fdata)
+ diff[0] = fdata[0]
+ diff[1:] = fdata[1:] - fdata[:-1]
+ adiff = abs(diff)
+ exception32 = (adiff > (1 << 15) - 1)
+ exception16 = (adiff >= (1 << 7) - 1) ^ exception32
+ we16 = numpy.where(exception16)
+ we32 = numpy.where(exception32)
+ data_16 = diff[we16].astype(numpy.int16)
+ data_32 = diff[we32].astype(numpy.int32)
+ if not numpy.little_endian:
+ data_16.byteswap(True)
+ data_32.byteswap(True)
+ diff[we16] = 127
+ diff[we32] = 128
+ diff += 127
+ data_8 = diff.astype(numpy.uint8)
+ return data_8.tostring(), data_16.tostring(), data_32.tostring()
+
+
+def decPCK(stream, dim1=None, dim2=None, overflowPix=None, version=None, normal_start=None, swap_needed=None):
+ """
+ Modified CCP4 pck decompressor used in MAR345 images
+
+ :param raw: input string (bytes in python3)
+ :param dim1,dim2: optional parameters size
+ :param overflowPix: optional parameters: number of overflowed pixels
+ :param version: PCK version 1 or 2
+ :param normal_start: position of the normal value section (can be auto-guessed)
+ :param swap_needed: set to True when reading data from a foreign endianness (little on big or big on little)
+ :return: ndarray of 2D with the right size
+
+ """
+ try:
+ from .ext.mar345_IO import uncompress_pck
+ except ImportError as error:
+ raise RuntimeError("Unable to import mar345_IO to read compressed dataset: %s" % error)
+ if "seek" in dir(stream):
+ stream.seek(0)
+ raw = stream.read()
+ else:
+ raw = bytes(stream)
+
+ return uncompress_pck(raw, dim1, dim2, overflowPix, version, normal_start, swap_needed)
+
+
+def compPCK(data):
+ """
+ Modified CCP4 pck compressor used in MAR345 images
+
+ :param data: numpy.ndarray (square array)
+ :return: compressed stream
+
+ """
+ try:
+ from .ext.mar345_IO import compress_pck
+ except ImportError as error:
+ raise RuntimeError("Unable to import mar345_IO to write compressed dataset: %s" % error)
+ return compress_pck(data)
diff --git a/fabio/converters.py b/fabio/converters.py
new file mode 100644
index 0000000..cdca7d3
--- /dev/null
+++ b/fabio/converters.py
@@ -0,0 +1,95 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+"""Converter module.
+
+This is for the moment empty (populated only with almost pass through anonymous functions)
+but aims to be populated with more sofisticated translators...
+
+"""
+# get ready for python3
+from __future__ import with_statement, print_function
+
+__author__ = "Jérôme Kieffer"
+__contact__ = "jerome.kieffer@esrf.eu"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+
+
+import logging
+logger = logging.getLogger(__name__)
+
+
+def convert_data_integer(data):
+ """
+ convert data to integer
+ """
+ if data is not None:
+ return data.astype(int)
+ else:
+ return data
+
+
+CONVERSION_HEADER = {
+ ("edfimage", "edfimage"): lambda header: header,
+}
+
+CONVERSION_DATA = {
+ ("edfimage", "edfimage"): lambda data: data,
+ ("edfimage", "cbfimage"): convert_data_integer,
+ ("edfimage", "mar345image"): convert_data_integer,
+ ("edfimage", "fit2dmaskimage"): convert_data_integer,
+ ("edfimage", "kcdimage"): convert_data_integer,
+ ("edfimage", "OXDimage"): convert_data_integer,
+ ("edfimage", "pnmimage"): convert_data_integer,
+}
+
+
+def convert_data(inp, outp, data):
+ """
+ Return data converted to the output format ... over-simplistic
+ implementation for the moment...
+
+ :param str inp: input format (like "cbfimage")
+ :param str outp: output format (like "cbfimage")
+ :param numpy.ndarray data: the actual dataset to be transformed
+ """
+ return CONVERSION_DATA.get((inp, outp), lambda data: data)(data)
+
+
+def convert_header(inp, outp, header):
+ """
+ Return header converted to the output format
+
+ :param str inp: input format (like "cbfimage")
+ :param str outp: output format (like "cbfimage")
+ :param dict header: the actual set of headers to be transformed
+ """
+ return CONVERSION_HEADER.get((inp, outp), lambda header: header)(header)
diff --git a/fabio/datIO.py b/fabio/datIO.py
new file mode 100644
index 0000000..b2b4e7a
--- /dev/null
+++ b/fabio/datIO.py
@@ -0,0 +1,90 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+
+"""
+Authors: Henning O. Sorensen & Erik Knudsen
+ Center for Fundamental Research: Metal Structures in Four Dimensions
+ Risoe National Laboratory
+ Frederiksborgvej 399
+ DK-4000 Roskilde
+ email:erik.knudsen@risoe.dk
+
+ and Jon Wright, ESRF
+"""
+# get ready for python3
+from __future__ import with_statement, print_function
+
+
+class fabiodata(object):
+ """
+ A common class for dataIO in fable
+ Contains a 2d numpy array for keeping data, and two lists (clabels and rlabels)
+ containing labels for columns and rows respectively
+ """
+
+ def __init__(self, data=None, clabels=None, rlabels=None, fname=None):
+ """
+ set up initial values
+ """
+ if isinstance(data, str):
+ raise RuntimeError("fabioimage.__init__ bad argument - " +
+ "data should be numpy array")
+ self.data = data
+ if (self.data):
+ self.dims = self.data.shape
+ self.clabels = clabels
+ self.rlabels = rlabels
+ if (fname):
+ self.read(fname)
+
+ def read(self, fname=None, frame=None):
+ """
+ To be overridden by format specific subclasses
+ """
+ raise Exception("Class has not implemented read method yet")
+
+# import stuff from Jon's columnfile things
+
+
+class columnfile(fabiodata):
+ "Concrete fabiodata class"
+ def read(self, fname, frame=None):
+ from .ext import cf_io
+ try:
+ infile = open(fname, 'rb')
+ except:
+ raise Exception("columnfile: file" + str(fname) + "not found.")
+ try:
+ (self.data, self.clabels) = cf_io.read(infile)
+ except:
+ raise Exception("columnfile: read error, file " + str(fname) + " possibly corrupt")
+ self.dims = self.data.shape
+ infile.close()
diff --git a/fabio/directories.py b/fabio/directories.py
new file mode 100644
index 0000000..c02fb5d
--- /dev/null
+++ b/fabio/directories.py
@@ -0,0 +1,60 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION W
+
+"""FabIO module: Contains the directory with test-images"""
+
+__author__ = "Jérôme Kieffer"
+__contact__ = "Jerome.Kieffer@ESRF.eu"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "24/07/2017"
+__status__ = "stable"
+
+import os
+import getpass
+import tempfile
+import logging
+logger = logging.getLogger(__name__)
+
+SHARED_TESTIMAGES = "/usr/share/fabio/testimages"
+
+# testimages contains the directory name where test images are located
+testimages = None
+if "FABIO_TESTIMAGES" in os.environ:
+ testimages = os.environ.get("FABIO_TESTIMAGES")
+ if not os.path.exists(testimages):
+ logger.warning("testimage directory %s does not exist" % testimages)
+elif os.path.isdir(SHARED_TESTIMAGES):
+ testimages = SHARED_TESTIMAGES
+else:
+ # create a temporary folder
+ testimages = os.path.join(tempfile.gettempdir(), "fabio_testimages_%s" % (getpass.getuser()))
+
+if not os.path.exists(testimages):
+ os.makedirs(testimages)
diff --git a/fabio/dm3image.py b/fabio/dm3image.py
new file mode 100644
index 0000000..158a70a
--- /dev/null
+++ b/fabio/dm3image.py
@@ -0,0 +1,253 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION W
+
+"""
+Authors: Henning O. Sorensen & Erik Knudsen
+ Center for Fundamental Research: Metal Structures in Four Dimensions
+ Risoe National Laboratory
+ Frederiksborgvej 399
+ DK-4000 Roskilde
+ email:erik.knudsen@risoe.dk
+
+ + Jon Wright, ESRF
+"""
+# get ready for python3
+from __future__ import with_statement, print_function
+
+import logging
+import numpy
+from .fabioimage import FabioImage
+logger = logging.getLogger(__name__)
+
+DATA_TYPES = { 2 : numpy.int16,
+ 4 : numpy.uint16,
+ 3 : numpy.int32,
+ 5 : numpy.uint32,
+ 6 : numpy.float32,
+ 7 : numpy.float,
+ 8 : numpy.int8,
+ 9 : None,
+ 10 : None,
+ 15 : 'Struct',
+ 18 : None,
+ 20 : None
+ }
+
+DATA_BYTES = { 2 : 2,
+ 4 : 2,
+ 3 : 4,
+ 5 : 4,
+ 6 : 4,
+ 7 : 8,
+ 8 : 1,
+ 9 : None,
+ 10 : None,
+ 15 : 'Struct',
+ 18 : None,
+ 20 : None
+ }
+
+
+class Dm3Image(FabioImage):
+ """ Read and try to write the dm3 data format """
+
+ DESCRIPTION = "Digital Micrograph DM3 file format"
+
+ DEFAULT_EXTENTIONS = ["dm3"]
+
+ def __init__(self, *args, **kwargs):
+ FabioImage.__init__(self, *args, **kwargs)
+ self.encoded_datatype = None
+ self.no_data_elements = None
+ self.grouptag_is_sorted = None
+ self.grouptag_is_open = None
+ self.tag_encoded_type = None
+ self.tag_data_type = None
+ self.tag_is_data = None
+ self.grouptag_no_tags = None
+ self.bytes_in_file = None
+ self.tag_label_length = None
+ self.go_on = None
+
+ def _readheader(self):
+ self.infile.seek(0)
+ file_format = self.readbytes(4, numpy.uint32)[0] # should be 3
+ assert file_format == 3, 'Wrong file type '
+ self.bytes_in_file = self.readbytes(4, numpy.uint32)[0]
+ self.byte_order = self.readbytes(4, numpy.uint32)[0] # 0 = big, 1= little
+ logger.info('read dm3 file - file format %s' % file_format)
+ logger.info('Bytes in file: %s' % self.bytes_in_file)
+ logger.info('Byte order: %s - 0 = bigEndian , 1 = littleEndian' % self.byte_order)
+
+ if self.byte_order == 0:
+ self.swap = True
+ elif self.byte_order == 1:
+ self.swap = False
+ else:
+ raise ValueError
+
+ def read(self, fname, frame=None):
+ self.header = self.check_header()
+ self.resetvals()
+ self.infile = self._open(fname, "rb")
+ self._readheader()
+ self.go_on = True
+ while self.go_on:
+ self.read_tag_group()
+ self.read_tag_entry()
+ if self.infile.tell() > self.bytes_in_file:
+ break
+
+ while self.tag_is_data == 21:
+ self.read_tag_entry()
+ if self.infile.tell() > self.bytes_in_file:
+ self.go_on = False
+
+ (dim1_raw, dim2_raw) = self.header['Active Size (pixels)'].split()
+ (dim1_raw, dim2_raw) = (eval(dim1_raw), eval(dim2_raw))
+ (dim1_binning, dim2_binning) = self.header['Binning'].split()
+ (dim1_binning, dim2_binning) = (eval(dim1_binning), eval(dim2_binning))
+ self.dim1 = dim1_raw / dim1_binning
+ self.dim2 = dim2_raw / dim2_binning
+ # print dim1,dim2
+ if "Data" in self.header:
+ self.data = self.header['Data'].reshape(self.dim1, self.dim2)
+
+ def readbytes(self, bytes_to_read, format, swap=True):
+ raw = self.infile.read(bytes_to_read)
+ if format is not None:
+ data = numpy.fromstring(raw, format)
+ else:
+ data = raw
+ if swap:
+ data = data.byteswap()
+ return data
+
+ def read_tag_group(self):
+
+ self.grouptag_is_sorted = self.readbytes(1, numpy.uint8)[0]
+ self.grouptag_is_open = self.readbytes(1, numpy.uint8)[0]
+ self.grouptag_no_tags = self.readbytes(4, numpy.uint32)[0]
+ logger.debug('TagGroup is sorted? %s', self.grouptag_is_sorted)
+ logger.debug('TagGroup is open? %s', self.grouptag_is_open)
+ logger.debug('no of tags in TagGroup %s', self.grouptag_no_tags)
+
+ def read_tag_entry(self):
+
+ self.tag_is_data = self.readbytes(1, numpy.uint8)[0]
+ self.tag_label_length = self.readbytes(2, numpy.uint16)[0]
+ logger.debug('does Tag have data ? %s - 20 = Tag group , 21 = data ', self.tag_is_data)
+ logger.debug('length of tag_label %s', self.tag_label_length)
+ if self.tag_label_length != 0:
+ tag_label = self.infile.read(self.tag_label_length)
+ else:
+ tag_label = None
+
+ if self.tag_is_data == 21:
+ # This is data
+ self.header[tag_label] = self.read_tag_type()
+ logger.debug("%s: %s", tag_label, self.header[tag_label])
+
+ def read_tag_type(self):
+ if self.infile.read(4) != '%%%%':
+ raise IOError
+ self.tag_data_type = self.readbytes(4, numpy.uint32)[0]
+ logger.debug('data is of type : %s - 1 = simple, 2 = string, 3 = array, >3 structs', self.tag_data_type)
+ self.tag_encoded_type = self.readbytes(4, numpy.uint32)[0]
+ logger.debug('encode type: %s %s', self.tag_encoded_type, DATA_TYPES[self.tag_encoded_type])
+ if self.tag_data_type == 1:
+ # simple type
+ return self.readbytes(DATA_BYTES[self.tag_encoded_type],
+ DATA_TYPES[self.tag_encoded_type],
+ swap=self.swap)[0]
+ # are the data stored in a simple array?
+ if self.tag_encoded_type == 20 and self.tag_data_type == 3:
+ self.data_type = self.readbytes(4, numpy.uint32)[0]
+ self.no_data_elements = self.readbytes(4, numpy.uint32)[0]
+ if self.data_type == 10:
+ logger.debug('skip bytes %s', self.no_data_elements)
+ _dump = self.infile.read(self.no_data_elements)
+ return None
+
+ logger.debug('Data are stored as a simple a array -')
+ logger.debug('%s data elemets stored as %s', self.no_data_elements, self.data_type)
+ read_no_bytes = DATA_BYTES[self.data_type] * self.no_data_elements
+ fmt = DATA_TYPES[self.data_type]
+ return self.readbytes(read_no_bytes, fmt, swap=self.swap)
+
+ # are the data stored in a complex array ?
+ # print 'tag_type + data_type', self.tag_encoded_type,self.tag_data_type
+
+ # print self.tag_encoded_type , self.tag_data_type
+ if self.tag_encoded_type == 20 and self.tag_data_type > 3:
+ self.tag_encoded_type = self.readbytes(4, numpy.uint32)[0]
+ logger.debug('found array - new tag_encoded_type %s', self.tag_encoded_type)
+ if self.tag_encoded_type == 15: # struct type
+ # ##type = self.readbytes(4,numpy.int32)
+ _struct_name_length = self.readbytes(4, numpy.int32)[0]
+ struct_number_fields = self.readbytes(4, numpy.int32)[0]
+ # print 'struct - name_length, number_field', struct_name_length,struct_number_fields
+ # print self.infile.read(_struct_name_length)
+ field_info = []
+ for i in range(struct_number_fields):
+ field_info.append([self.readbytes(4, numpy.int32)[0], self.readbytes(4, numpy.int32)[0]])
+ # print field_info
+ self.no_data_elements = self.readbytes(4, numpy.int32)[0]
+ # print '%i data elemets stored as ' %self.no_data_elements
+ bytes_in_struct = 0
+ for i in range(struct_number_fields):
+ bytes_in_struct += DATA_BYTES[field_info[i][1]]
+ logger.debug('skip bytes %s', self.no_data_elements * bytes_in_struct)
+ _dump = self.infile.read(self.no_data_elements * bytes_in_struct)
+ return None
+
+ if self.tag_encoded_type == 15: # struct type
+ # ##type = self.readbytes(4,numpy.int32)
+ _struct_name_length = self.readbytes(4, numpy.int32)[0]
+ struct_number_fields = self.readbytes(4, numpy.int32)[0]
+ # print 'struct - name_length, number_field', _struct_name_length,struct_number_fields
+ # print self.infile.read(struct_name_length)
+ field_info = []
+ for i in range(struct_number_fields):
+ field_info.append([self.readbytes(4, numpy.int32)[0], self.readbytes(4, numpy.int32)[0]])
+ # print field_info
+ field_data = ''
+ for i in range(struct_number_fields):
+ # print type(i)
+ field_data = field_data + self.readbytes(field_info[i][0], None, swap=False) + ' '
+ field_data = field_data + '%i ' % self.readbytes(DATA_BYTES[field_info[i][1]],
+ DATA_TYPES[field_info[i][1]],
+ swap=self.swap)[0]
+ return field_data
+
+ def read_data(self):
+ self.encoded_datatype = numpy.fromstring(self.infile.read(4), numpy.uint32).byteswap()
+
+
+dm3image = Dm3Image
diff --git a/fabio/edfimage.py b/fabio/edfimage.py
new file mode 100644
index 0000000..a9f4ad0
--- /dev/null
+++ b/fabio/edfimage.py
@@ -0,0 +1,982 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION W
+
+"""
+
+License: MIT
+
+Authors:
+........
+* Henning O. Sorensen & Erik Knudsen:
+ Center for Fundamental Research: Metal Structures in Four Dimensions;
+ Risoe National Laboratory;
+ Frederiksborgvej 399;
+ DK-4000 Roskilde;
+ email:erik.knudsen@risoe.dk
+* Jon Wright & Jérôme Kieffer:
+ European Synchrotron Radiation Facility;
+ Grenoble (France)
+
+
+"""
+# get ready for python3
+from __future__ import with_statement, print_function, absolute_import, division
+import os
+import logging
+logger = logging.getLogger(__name__)
+import numpy
+from .fabioimage import FabioImage, OrderedDict
+from .fabioutils import isAscii, toAscii, nice_int
+from .compression import decBzip2, decGzip, decZlib
+
+
+BLOCKSIZE = 512
+DATA_TYPES = {"SignedByte": numpy.int8,
+ "Signed8": numpy.int8,
+ "UnsignedByte": numpy.uint8,
+ "Unsigned8": numpy.uint8,
+ "SignedShort": numpy.int16,
+ "Signed16": numpy.int16,
+ "UnsignedShort": numpy.uint16,
+ "Unsigned16": numpy.uint16,
+ "UnsignedShortInteger": numpy.uint16,
+ "SignedInteger": numpy.int32,
+ "Signed32": numpy.int32,
+ "UnsignedInteger": numpy.uint32,
+ "Unsigned32": numpy.uint32,
+ "SignedLong": numpy.int32,
+ "UnsignedLong": numpy.uint32,
+ "Signed64": numpy.int64,
+ "Unsigned64": numpy.uint64,
+ "FloatValue": numpy.float32,
+ "FLOATVALUE": numpy.float32,
+ "FLOAT": numpy.float32, # fit2d
+ "Float": numpy.float32, # fit2d
+ "FloatIEEE32": numpy.float32,
+ "Float32": numpy.float32,
+ "Double": numpy.float64,
+ "DoubleValue": numpy.float64,
+ "FloatIEEE64": numpy.float64,
+ "DoubleIEEE64": numpy.float64}
+try:
+ DATA_TYPES["FloatIEEE128"] = DATA_TYPES["DoubleIEEE128"] = DATA_TYPES["QuadrupleValue"] = numpy.float128
+
+except AttributeError:
+ # not in your numpy
+ logger.debug("No support for float128 in your code")
+
+NUMPY_EDF_DTYPE = {"int8": "SignedByte",
+ "int16": "SignedShort",
+ "int32": "SignedInteger",
+ "int64": "Signed64",
+ "uint8": "UnsignedByte",
+ "uint16": "UnsignedShort",
+ "uint32": "UnsignedInteger",
+ "uint64": "Unsigned64",
+ "float32": "FloatValue",
+ "float64": "DoubleValue",
+ "float128": "QuadrupleValue",
+ }
+
+MINIMUM_KEYS = ['HEADERID',
+ 'IMAGE',
+ 'BYTEORDER',
+ 'DATATYPE',
+ 'DIM_1',
+ 'DIM_2',
+ 'SIZE'] # Size is thought to be essential for writing at least
+
+DEFAULT_VALUES = {}
+# I do not define default values as they will be calculated at write time
+# JK20110415
+
+
+class Frame(object):
+ """
+ A class representing a single frame in an EDF file
+ """
+ def __init__(self, data=None, header=None, number=None):
+
+ self.header = EdfImage.check_header(header)
+
+ self.capsHeader = {}
+ for key in self.header:
+ self.capsHeader[key.upper()] = key
+ self._data = data
+ self.dims = []
+ self.dim1 = 0
+ self.dim2 = 0
+ self.start = None # Position of start of raw data in file
+ self.size = None # size of raw data in file
+ self.file = None # opened file object with locking capabilities !!!
+ self.bpp = None
+ self._bytecode = None
+ if (number is not None):
+ self.iFrame = int(number)
+ else:
+ self.iFrame = 0
+
+ def parseheader(self, block):
+ """
+ Parse the header in some EDF format from an already open file
+
+ :param block: string representing the header block.
+ :type block: string, should be full ascii
+ :return: size of the binary blob
+ """
+ # reset values ...
+ self.header = OrderedDict()
+ self.capsHeader = {}
+ self.size = None
+ calcsize = 1
+ self.dims = []
+
+ for line in block.split(';'):
+ if '=' in line:
+ key, val = line.split('=', 1)
+ # Why would someone put null bytes in a header?
+ key = key.replace("\x00", " ").strip()
+ self.header[key] = val.replace("\x00", " ").strip()
+ self.capsHeader[key.upper()] = key
+
+ # Compute image size
+ if "SIZE" in self.capsHeader:
+ try:
+ self.size = nice_int(self.header[self.capsHeader["SIZE"]])
+ except ValueError:
+ logger.warning("Unable to convert to integer : %s %s " % (self.capsHeader["SIZE"], self.header[self.capsHeader["SIZE"]]))
+ if "DIM_1" in self.capsHeader:
+ try:
+ dim1 = nice_int(self.header[self.capsHeader['DIM_1']])
+ except ValueError:
+ logger.error("Unable to convert to integer Dim_1: %s %s" % (self.capsHeader["DIM_1"], self.header[self.capsHeader["DIM_1"]]))
+ else:
+ calcsize *= dim1
+ self.dims.append(dim1)
+ else:
+ logger.error("No Dim_1 in headers !!!")
+ if "DIM_2" in self.capsHeader:
+ try:
+ dim2 = nice_int(self.header[self.capsHeader['DIM_2']])
+ except ValueError:
+ logger.error("Unable to convert to integer Dim_3: %s %s" % (self.capsHeader["DIM_2"], self.header[self.capsHeader["DIM_2"]]))
+ else:
+ calcsize *= dim2
+ self.dims.append(dim2)
+ else:
+ logger.error("No Dim_2 in headers !!!")
+ iDim = 3
+ # JON: this appears to be for nD images, but we don't treat those
+ while iDim is not None:
+ strDim = "DIM_%i" % iDim
+ if strDim in self.capsHeader:
+ try:
+ dim3 = nice_int(self.header[self.capsHeader[strDim]])
+ except ValueError:
+ logger.error("Unable to convert to integer %s: %s %s",
+ strDim, self.capsHeader[strDim], self.header[self.capsHeader[strDim]])
+ dim3 = None
+ iDim = None
+ else:
+ if dim3 > 1:
+ # Otherwise treat dim3==1 as a 2D image
+ calcsize *= dim3
+ self.dims.append(dim3)
+ iDim += 1
+
+ else:
+ logger.debug("No Dim_3 -> it is a 2D image")
+ iDim = None
+ if self._bytecode is None:
+ if "DATATYPE" in self.capsHeader:
+ self._bytecode = DATA_TYPES[self.header[self.capsHeader['DATATYPE']]]
+ else:
+ self._bytecode = numpy.uint16
+ logger.warning("Defaulting type to uint16")
+ self.bpp = len(numpy.array(0, self._bytecode).tostring())
+ calcsize *= self.bpp
+ if (self.size is None):
+ self.size = calcsize
+ elif (self.size != calcsize):
+ if ("COMPRESSION" in self.capsHeader) and (self.header[self.capsHeader['COMPRESSION']].upper().startswith("NO")):
+ logger.info("Mismatch between the expected size %s and the calculated one %s" % (self.size, calcsize))
+ self.size = calcsize
+
+ for i, n in enumerate(self.dims):
+ setattr(self, "dim%i" % (i + 1), n)
+
+ return self.size
+
+ def swap_needed(self):
+ """
+ Decide if we need to byteswap
+ """
+ if ('Low' in self.header[self.capsHeader['BYTEORDER']] and numpy.little_endian) or \
+ ('High' in self.header[self.capsHeader['BYTEORDER']] and not numpy.little_endian):
+ return False
+ if ('High' in self.header[self.capsHeader['BYTEORDER']] and numpy.little_endian) or \
+ ('Low' in self.header[self.capsHeader['BYTEORDER']] and not numpy.little_endian):
+ if self.bpp in [2, 4, 8]:
+ return True
+ else:
+ return False
+
+ def getData(self):
+ """
+ Unpack a binary blob according to the specification given in the header
+
+ :return: dataset as numpy.ndarray
+ """
+ data = None
+ if self._data is not None:
+ data = self._data
+ elif self.file is None:
+ data = self._data
+ else:
+ if self._bytecode is None:
+ if "DATATYPE" in self.capsHeader:
+ self._bytecode = DATA_TYPES[self.header[self.capsHeader["DATATYPE"]]]
+ else:
+ self._bytecode = numpy.uint16
+ dims = self.dims[:]
+ dims.reverse()
+ with self.file.lock:
+ if self.file.closed:
+ logger.error("file: %s from %s is closed. Cannot read data." % (self.file, self.file.filename))
+ return
+ else:
+ self.file.seek(self.start)
+ fileData = self.file.read(self.size)
+
+ if ("COMPRESSION" in self.capsHeader):
+ compression = self.header[self.capsHeader["COMPRESSION"]].upper()
+ uncompressed_size = self.bpp
+ for i in dims:
+ uncompressed_size *= i
+ if "OFFSET" in compression:
+ try:
+ import byte_offset # IGNORE:F0401
+ except ImportError as error:
+ logger.error("Unimplemented compression scheme: %s (%s)" % (compression, error))
+ else:
+ myData = byte_offset.analyseCython(fileData, size=uncompressed_size)
+ rawData = myData.astype(self._bytecode).tostring()
+ self.size = uncompressed_size
+ elif compression == "NONE":
+ rawData = fileData
+ elif "GZIP" in compression:
+ rawData = decGzip(fileData)
+ self.size = uncompressed_size
+ elif "BZ" in compression:
+ rawData = decBzip2(fileData)
+ self.size = uncompressed_size
+ elif "Z" in compression:
+ rawData = decZlib(fileData)
+ self.size = uncompressed_size
+ else:
+ logger.warning("Unknown compression scheme %s" % compression)
+ rawData = fileData
+
+ else:
+ rawData = fileData
+
+ expected = self.size
+ obtained = len(rawData)
+ if expected > obtained:
+ logger.error("Data stream is incomplete: %s < expected %s bytes" % (obtained, expected))
+ rawData += "\x00".encode("ascii") * (expected - obtained)
+ elif expected < len(rawData):
+ logger.info("Data stream contains trailing junk : %s > expected %s bytes" % (obtained, expected))
+ rawData = rawData[:expected]
+ data = numpy.fromstring(rawData, self._bytecode).reshape(tuple(dims))
+ if self.swap_needed():
+ data.byteswap(True)
+ self._data = data
+ self._bytecode = data.dtype.type
+ return data
+
+ def setData(self, npa=None):
+ """Setter for data in edf frame"""
+ self._data = npa
+ data = property(getData, setData, "property: (edf)frame.data, uncompress the datablock when needed")
+
+ def getByteCode(self):
+ if self._bytecode is None:
+ self._bytecode = self.data.dtype.type
+ return self._bytecode
+
+ def setByteCode(self, _iVal):
+ self._bytecode = _iVal
+
+ bytecode = property(getByteCode, setByteCode)
+
+ def getEdfBlock(self, force_type=None, fit2dMode=False):
+ """
+ :param force_type: type of the dataset to be enforced like "float64" or "uint16"
+ :type force_type: string or numpy.dtype
+ :param boolean fit2dMode: enforce compatibility with fit2d and starts counting number of images at 1
+ :return: ascii header block + binary data block
+ :rtype: python bytes with the concatenation of the ascii header and the binary data block
+ """
+ if force_type is not None:
+ data = self.data.astype(force_type)
+ else:
+ data = self.data
+ fit2dMode = bool(fit2dMode)
+ for key in self.header:
+ KEY = key.upper()
+ if KEY not in self.capsHeader:
+ self.capsHeader[KEY] = key
+
+ header = self.header.copy()
+ header_keys = list(self.header.keys())
+ capsHeader = self.capsHeader.copy()
+
+ listHeader = ["{\n"]
+# First of all clean up the headers:
+ for i in capsHeader:
+ if "DIM_" in i:
+ header.pop(capsHeader[i])
+ header_keys.remove(capsHeader[i])
+ for KEY in ["SIZE", "EDF_BINARYSIZE", "EDF_HEADERSIZE", "BYTEORDER", "DATATYPE", "HEADERID", "IMAGE"]:
+ if KEY in capsHeader:
+ header.pop(capsHeader[KEY])
+ header_keys.remove(capsHeader[KEY])
+ if "EDF_DATABLOCKID" in capsHeader:
+ header_keys.remove(capsHeader["EDF_DATABLOCKID"])
+ # but do not remove the value from dict, instead reset the key ...
+ if capsHeader["EDF_DATABLOCKID"] != "EDF_DataBlockID":
+ header["EDF_DataBlockID"] = header.pop(capsHeader["EDF_DATABLOCKID"])
+ capsHeader["EDF_DATABLOCKID"] = "EDF_DataBlockID"
+
+# Then update static headers freshly deleted
+ header_keys.insert(0, "Size")
+ header["Size"] = len(data.tostring())
+ header_keys.insert(0, "HeaderID")
+ header["HeaderID"] = "EH:%06d:000000:000000" % (self.iFrame + fit2dMode)
+ header_keys.insert(0, "Image")
+ header["Image"] = str(self.iFrame + fit2dMode)
+
+ dims = list(data.shape)
+ nbdim = len(dims)
+ for i in dims:
+ key = "Dim_%i" % nbdim
+ header[key] = i
+ header_keys.insert(0, key)
+ nbdim -= 1
+ header_keys.insert(0, "DataType")
+ header["DataType"] = NUMPY_EDF_DTYPE[str(numpy.dtype(data.dtype))]
+ header_keys.insert(0, "ByteOrder")
+ if numpy.little_endian:
+ header["ByteOrder"] = "LowByteFirst"
+ else:
+ header["ByteOrder"] = "HighByteFirst"
+ approxHeaderSize = 100
+ for key in header:
+ approxHeaderSize += 7 + len(key) + len(str(header[key]))
+ approxHeaderSize = BLOCKSIZE * (approxHeaderSize // BLOCKSIZE + 1)
+ header_keys.insert(0, "EDF_HeaderSize")
+ header["EDF_HeaderSize"] = "%5s" % (approxHeaderSize)
+ header_keys.insert(0, "EDF_BinarySize")
+ header["EDF_BinarySize"] = data.nbytes
+ header_keys.insert(0, "EDF_DataBlockID")
+ if "EDF_DataBlockID" not in header:
+ header["EDF_DataBlockID"] = "%i.Image.Psd" % (self.iFrame + fit2dMode)
+ preciseSize = 4 # 2 before {\n 2 after }\n
+ for key in header_keys:
+ # Escape keys or values that are no ascii
+ strKey = str(key)
+ if not isAscii(strKey, listExcluded=["}", "{"]):
+ logger.warning("Non ascii key %s, skipping" % strKey)
+ continue
+ strValue = str(header[key])
+ if not isAscii(strValue, listExcluded=["}", "{"]):
+ logger.warning("Non ascii value %s, skipping" % strValue)
+ continue
+ line = strKey + " = " + strValue + " ;\n"
+ preciseSize += len(line)
+ listHeader.append(line)
+ if preciseSize > approxHeaderSize:
+ logger.error("I expected the header block only at %s in fact it is %s" % (approxHeaderSize, preciseSize))
+ for idx, line in enumerate(listHeader[:]):
+ if line.startswith("EDF_HeaderSize"):
+ headerSize = BLOCKSIZE * (preciseSize // BLOCKSIZE + 1)
+ newline = "EDF_HeaderSize = %5s ;\n" % headerSize
+ delta = len(newline) - len(line)
+ if (preciseSize // BLOCKSIZE) != ((preciseSize + delta) // BLOCKSIZE):
+ headerSize = BLOCKSIZE * ((preciseSize + delta) // BLOCKSIZE + 1)
+ newline = "EDF_HeaderSize = %5s ;\n" % headerSize
+ preciseSize = preciseSize + delta
+ listHeader[idx] = newline
+ break
+ else:
+ headerSize = approxHeaderSize
+ listHeader.append(" " * (headerSize - preciseSize) + "}\n")
+ return ("".join(listHeader)).encode("ASCII") + data.tostring()
+
+
+class EdfImage(FabioImage):
+ """ Read and try to write the ESRF edf data format """
+
+ DESCRIPTION = "European Synchrotron Radiation Facility data format"
+
+ DEFAULT_EXTENTIONS = ["edf", "cor"]
+
+ RESERVED_HEADER_KEYS = ['HEADERID', 'IMAGE', 'BYTEORDER', 'DATATYPE',
+ 'DIM_1', 'DIM_2', 'DIM_3', 'SIZE']
+
+ def __init__(self, data=None, header=None, frames=None):
+ self.currentframe = 0
+ self.filesize = None
+
+ if data is None:
+ # In case of creation of an empty instance
+ stored_data = None
+ else:
+ try:
+ dim = len(data.shape)
+ except Exception as error: # IGNORE:W0703
+ logger.debug("Data don't look like a numpy array (%s), resetting all!!" % error)
+ dim = 0
+
+ if dim == 0:
+ raise Exception("Data with empty shape is unsupported")
+ elif dim == 1:
+ logger.warning("Data in 1d dimension will be stored as a 2d dimension array")
+ # make sure we do not change the shape of the input data
+ stored_data = numpy.array(data, copy=False)
+ stored_data.shape = (1, len(data))
+ elif dim == 2:
+ stored_data = data
+ elif dim >= 3:
+ raise Exception("Data dimension too big. Only 1d or 2d arrays are supported.")
+
+ FabioImage.__init__(self, stored_data, header)
+
+ if frames is None:
+ frame = Frame(data=self.data, header=self.header,
+ number=self.currentframe)
+ self._frames = [frame]
+ else:
+ self._frames = frames
+
+ @staticmethod
+ def check_header(header=None):
+ """
+ Empty for FabioImage but may be populated by others classes
+ """
+ if not isinstance(header, dict):
+ return OrderedDict()
+ new = OrderedDict()
+ for key, value in header.items():
+ new[toAscii(key, ";{}")] = toAscii(value, ";{}")
+ return new
+
+ @staticmethod
+ def _readHeaderBlock(infile):
+ """
+ Read in a header in some EDF format from an already open file
+
+ :param infile: file object open in read mode
+ :return: string (or None if no header was found.
+ """
+ MAX_HEADER_SIZE = BLOCKSIZE * 20
+ block = infile.read(BLOCKSIZE)
+ if len(block) < BLOCKSIZE:
+ logger.debug("Under-short header: only %i bytes in %s" % (len(block), infile.name))
+ return
+ if (block.find(b"{") < 0):
+ # This does not look like an edf file
+ logger.warning("no opening {. Corrupt header of EDF file %s" % infile.name)
+ return
+ if b"EDF_HeaderSize" in block:
+ start = block.index(b"EDF_HeaderSize")
+ chunk = block[start:].split(b"=")[1].strip()
+ try:
+ new_max_header_size = int(chunk.split(b";")[0].strip())
+ except Exception:
+ logger.warning("Unable to read header size, got: %s" % chunk)
+ else:
+ if new_max_header_size > MAX_HEADER_SIZE:
+ logger.info("Redefining MAX_HEADER_SIZE to %s" % new_max_header_size)
+ MAX_HEADER_SIZE = new_max_header_size
+ while (b'}\r' not in block) and (b'}\n' not in block):
+ block = block + infile.read(BLOCKSIZE)
+ if len(block) > MAX_HEADER_SIZE:
+ logger.warning("Runaway header in EDF file MAX_HEADER_SIZE: %s \n%s" % (MAX_HEADER_SIZE, block))
+ return
+ start = block.find(b"{") + 1
+ end = block.find(b"}")
+
+ # Now it is essential to go to the start of the binary part
+ if block[end: end + 3] == b"}\r\n":
+ offset = end + 3 - len(block)
+ elif block[end: end + 2] == b"}\n":
+ offset = end + 2 - len(block)
+ else:
+ logger.error("Unable to locate start of the binary section")
+ offset = None
+ if offset is not None:
+ infile.seek(offset, os.SEEK_CUR)
+ return block[start:end].decode("ASCII")
+
+ def _readheader(self, infile):
+ """
+ Read all headers in a file and populate self.header
+ data is not yet populated
+ :type infile: file object open in read mode
+ """
+ self._frames = []
+ bContinue = True
+ attrs = dir(infile)
+ if "measure_size" in attrs:
+ # Handle bug #18 (https://github.com/silx-kit/fabio/issues/18)
+ stream_size = infile.measure_size()
+ elif "size" in attrs:
+ stream_size = infile.size
+ elif "len" in attrs:
+ stream_size = infile.len
+ else:
+ # Poor-men's size measurement
+ pos = infile.tell()
+ self.seek(0, os.SEEK_END)
+ stream_size = infile.tell()
+ infile.seek(pos)
+
+ while bContinue:
+ block = self._readHeaderBlock(infile)
+ if block is None:
+ bContinue = False
+ break
+ frame = Frame(number=self.nframes)
+ size = frame.parseheader(block)
+ frame.file = infile
+ frame.start = infile.tell()
+ frame.size = size
+ self._frames += [frame]
+ try:
+ infile.seek(size, os.SEEK_CUR)
+ except Exception as error:
+ logger.warning("infile is %s" % infile)
+ logger.warning("Position is %s" % infile.tell())
+ logger.warning("size is %s" % size)
+ logger.error("It seams this error occurs under windows when reading a (large-) file over network: %s ", error)
+ raise Exception(error)
+
+ if frame.start + size > stream_size:
+ logger.warning("Non complete datablock: got %s, expected %s" % (stream_size - frame.start, size))
+ bContinue = False
+ break
+
+ for i, frame in enumerate(self._frames):
+ missing = []
+ for item in MINIMUM_KEYS:
+ if item not in frame.capsHeader:
+ missing.append(item)
+ if len(missing) > 0:
+ logger.info("EDF file %s frame %i misses mandatory keys: %s " % (self.filename, i, " ".join(missing)))
+ self.currentframe = 0
+
+ def read(self, fname, frame=None):
+ """
+ Read in header into self.header and
+ the data into self.data
+ """
+ self.resetvals()
+ self.filename = fname
+
+ infile = self._open(fname, "rb")
+ self._readheader(infile)
+ if frame is None:
+ pass
+ elif frame < self.nframes:
+ self = self.getframe(frame)
+ else:
+ logger.error("Reading file %s You requested frame %s but only %s frames are available", fname, frame, self.nframes)
+ self.resetvals()
+ # ensure the PIL image is reset
+ self.pilimage = None
+ return self
+
+ def swap_needed(self):
+ """
+ Decide if we need to byteswap
+
+ :return: True if needed, False else and None if not understood
+ """
+ if self.bpp == 1:
+ return False
+ if ('Low' in self.header[self.capsHeader['BYTEORDER']] and numpy.little_endian) or \
+ ('High' in self.header[self.capsHeader['BYTEORDER']] and not numpy.little_endian):
+ return False
+ if ('High' in self.header[self.capsHeader['BYTEORDER']] and numpy.little_endian) or \
+ ('Low' in self.header[self.capsHeader['BYTEORDER']] and not numpy.little_endian):
+ return True
+
+ def unpack(self):
+ """
+ Unpack a binary blob according to the specification given in the header and return the dataset
+
+ :return: dataset as numpy.ndarray
+ """
+ return self._frames[self.currentframe].getData()
+
+ def getframe(self, num):
+ """ returns the file numbered 'num' in the series as a FabioImage """
+ newImage = None
+ if self.nframes == 1:
+ logger.debug("Single frame EDF; having FabioImage default behavior: %s" % num)
+ newImage = FabioImage.getframe(self, num)
+ newImage._file = self._file
+ elif num < self.nframes:
+ logger.debug("Multi frame EDF; having EdfImage specific behavior: %s/%s" % (num, self.nframes))
+ newImage = EdfImage(frames=self._frames)
+ newImage.currentframe = num
+ newImage.filename = self.filename
+ newImage._file = self._file
+ else:
+ raise IOError("EdfImage.getframe: Cannot access frame: %s/%s" %
+ (num, self.nframes))
+ return newImage
+
+ def previous(self):
+ """ returns the previous file in the series as a FabioImage """
+ newImage = None
+ if self.nframes == 1:
+ newImage = FabioImage.previous(self)
+ else:
+ newFrameId = self.currentframe - 1
+ newImage = self.getframe(newFrameId)
+ return newImage
+
+ def next(self):
+ """Returns the next file in the series as a fabioimage
+
+ :raise IOError: When there is no next file or image in the series.
+ """
+ newImage = None
+ if self.nframes == 1:
+ newImage = FabioImage.next(self)
+ else:
+ newFrameId = self.currentframe + 1
+ newImage = self.getframe(newFrameId)
+ return newImage
+
+ def write(self, fname, force_type=None, fit2dMode=False):
+ """
+ Try to write a file
+ check we can write zipped also
+ mimics that fabian was writing uint16 (we sometimes want floats)
+
+ :param force_type: can be numpy.uint16 or simply "float"
+ """
+ # correct for bug #27: read all data before opening the file in write mode
+ if fname == self.filename:
+ [(frame.header, frame.data) for frame in self._frames]
+ # this is thrown away
+ with self._open(fname, mode="wb") as outfile:
+ for i, frame in enumerate(self._frames):
+ frame.iFrame = i
+ outfile.write(frame.getEdfBlock(force_type=force_type, fit2dMode=fit2dMode))
+
+ def appendFrame(self, frame=None, data=None, header=None):
+ """
+ Method used add a frame to an EDF file
+ :param frame: frame to append to edf image
+ :type frame: instance of Frame
+ """
+ if isinstance(frame, Frame):
+ self._frames.append(frame)
+ elif ("header" in dir(frame)) and ("data" in dir(frame)):
+ self._frames.append(Frame(frame.data, frame.header))
+ else:
+ self._frames.append(Frame(data, header))
+
+ def deleteFrame(self, frameNb=None):
+ """
+ Method used to remove a frame from an EDF image. by default the last one is removed.
+ :param int frameNb: frame number to remove, by default the last.
+ """
+ if frameNb is None:
+ self._frames.pop()
+ else:
+ self._frames.pop(frameNb)
+
+ def fastReadData(self, filename=None):
+ """
+ This is a special method that will read and return the data from another file ...
+ The aim is performances, ... but only supports uncompressed files.
+
+ :return: data from another file using positions from current EdfImage
+ """
+ if (filename is None) or not os.path.isfile(filename):
+ raise RuntimeError("EdfImage.fastReadData is only valid with another file: %s does not exist" % (filename))
+ data = None
+ frame = self._frames[self.currentframe]
+ with open(filename, "rb")as f:
+ f.seek(frame.start)
+ raw = f.read(frame.size)
+ try:
+ data = numpy.fromstring(raw, dtype=self.bytecode)
+ data.shape = self.data.shape
+ except Exception as error:
+ logger.error("unable to convert file content to numpy array: %s", error)
+ if self.swap_needed():
+ data.byteswap(True)
+ return data
+
+ def fastReadROI(self, filename, coords=None):
+ """
+ Method reading Region of Interest of another file based on metadata available in current EdfImage.
+ The aim is performances, ... but only supports uncompressed files.
+
+ :return: ROI-data from another file using positions from current EdfImage
+ :rtype: numpy 2darray
+ """
+ if (filename is None) or not os.path.isfile(filename):
+ raise RuntimeError("EdfImage.fastReadData is only valid with another file: %s does not exist" % (filename))
+ data = None
+ frame = self._frames[self.currentframe]
+
+ if len(coords) == 4:
+ slice1 = self.make_slice(coords)
+ elif (len(coords) == 2 and isinstance(coords[0], slice) and
+ isinstance(coords[1], slice)):
+ slice1 = coords
+ else:
+ logger.warning('readROI: Unable to understand Region Of Interest: got %s', coords)
+ return
+ d1 = self.data.shape[-1]
+ start0 = slice1[0].start
+ start1 = slice1[1].start
+ slice2 = (slice(0, slice1[0].stop - start0, slice1[0].step),
+ slice(0, slice1[1].stop - start1, slice1[1].step))
+ start = frame.start + self.bpp * (d1 * start0 + start1)
+ size = self.bpp * ((slice2[0].stop) * d1)
+ with open(filename, "rb")as f:
+ f.seek(start)
+ raw = f.read(size)
+ try:
+ data = numpy.fromstring(raw, dtype=self.bytecode)
+ data.shape = -1, d1
+ except Exception as error:
+ logger.error("unable to convert file content to numpy array: %s", error)
+ if self.swap_needed():
+ data.byteswap(True)
+ return data[slice2]
+
+################################################################################
+# Properties definition for header, data, header_keys and capsHeader
+################################################################################
+ def getNbFrames(self):
+ """
+ Getter for number of frames
+ """
+ return len(self._frames)
+
+ def setNbFrames(self, val):
+ """
+ Setter for number of frames ... should do nothing. Here just to avoid bugs
+ """
+ if val != len(self._frames):
+ logger.warning("trying to set the number of frames ")
+ nframes = property(getNbFrames, setNbFrames, "property: number of frames in EDF file")
+
+ def getHeader(self):
+ """
+ Getter for the headers. used by the property header,
+ """
+ return self._frames[self.currentframe].header
+
+ def setHeader(self, _dictHeader):
+ """
+ Enforces the propagation of the header to the list of frames
+ """
+ try:
+ self._frames[self.currentframe].header = _dictHeader
+ except AttributeError:
+ self._frames = [Frame(header=_dictHeader)]
+ except IndexError:
+ if self.currentframe < len(self._frames):
+ self._frames.append(Frame(header=_dictHeader))
+
+ def delHeader(self):
+ """
+ Deleter for edf header
+ """
+ self._frames[self.currentframe].header = {}
+ header = property(getHeader, setHeader, delHeader, "property: header of EDF file")
+
+# def getHeaderKeys(self):
+# """
+# Getter for edf header_keys
+# """
+# return self._frames[self.currentframe].header_keys
+# def setHeaderKeys(self, _listtHeader):
+# """
+# Enforces the propagation of the header_keys to the list of frames
+# :param _listtHeader: list of the (ordered) keys in the header
+# :type _listtHeader: python list
+# """
+# try:
+# self._frames[self.currentframe].header_keys = _listtHeader
+# except AttributeError:
+# self._frames = [Frame(header_keys=_listtHeader)]
+# except IndexError:
+# if self.currentframe < len(self._frames):
+# self._frames.append(Frame(header_keys=_listtHeader))
+# def delHeaderKeys(self):
+# """
+# Deleter for edf header_keys
+# """
+# self._frames[self.currentframe].header_keys = []
+# header_keys = property(getHeaderKeys, setHeaderKeys, delHeaderKeys, "property: header_keys of EDF file")
+
+ def getData(self):
+ """
+ getter for edf Data
+ :return: data for current frame
+ :rtype: numpy.ndarray
+ """
+ npaData = None
+ try:
+ npaData = self._frames[self.currentframe].data
+ except AttributeError:
+ self._frames = [Frame()]
+ npaData = self._frames[self.currentframe].data
+ except IndexError:
+ if self.currentframe < len(self._frames):
+ self._frames.append(Frame())
+ npaData = self._frames[self.currentframe].data
+ return npaData
+
+ def setData(self, _data):
+ """
+ Enforces the propagation of the data to the list of frames
+ :param _data: numpy array representing data
+ """
+ try:
+ self._frames[self.currentframe].data = _data
+ except AttributeError:
+ self._frames = [Frame(data=_data)]
+ except IndexError:
+ if self.currentframe < len(self._frames):
+ self._frames.append(Frame(data=_data))
+
+ def delData(self):
+ """
+ deleter for edf Data
+ """
+ self._frames[self.currentframe].data = None
+ data = property(getData, setData, delData, "property: data of EDF file")
+
+ def getCapsHeader(self):
+ """
+ getter for edf headers keys in upper case
+ :return: data for current frame
+ :rtype: dict
+ """
+ return self._frames[self.currentframe].capsHeader
+
+ def setCapsHeader(self, _data):
+ """
+ Enforces the propagation of the header_keys to the list of frames
+ :param _data: numpy array representing data
+ """
+ self._frames[self.currentframe].capsHeader = _data
+
+ def delCapsHeader(self):
+ """
+ deleter for edf capsHeader
+ """
+ self._frames[self.currentframe].capsHeader = {}
+ capsHeader = property(getCapsHeader, setCapsHeader, delCapsHeader, "property: capsHeader of EDF file, i.e. the keys of the header in UPPER case.")
+
+ def getDim1(self):
+ return self._frames[self.currentframe].dim1
+
+ def setDim1(self, _iVal):
+ try:
+ self._frames[self.currentframe].dim1 = _iVal
+ except AttributeError:
+ self._frames = [Frame()]
+ except IndexError:
+ if self.currentframe < len(self._frames):
+ self._frames.append(Frame())
+ self._frames[self.currentframe].dim1 = _iVal
+ dim1 = property(getDim1, setDim1)
+
+ def getDim2(self):
+ return self._frames[self.currentframe].dim2
+
+ def setDim2(self, _iVal):
+ try:
+ self._frames[self.currentframe].dim2 = _iVal
+ except AttributeError:
+ self._frames = [Frame()]
+ except IndexError:
+ if self.currentframe < len(self._frames):
+ self._frames.append(Frame())
+ self._frames[self.currentframe].dim2 = _iVal
+ dim2 = property(getDim2, setDim2)
+
+ def getDims(self):
+ return self._frames[self.currentframe].dims
+ dims = property(getDims)
+
+ def getByteCode(self):
+ return self._frames[self.currentframe].bytecode
+
+ def setByteCode(self, _iVal):
+ try:
+ self._frames[self.currentframe].bytecode = _iVal
+ except AttributeError:
+ self._frames = [Frame()]
+ except IndexError:
+ if self.currentframe < len(self._frames):
+ self._frames.append(Frame())
+ self._frames[self.currentframe].bytecode = _iVal
+ bytecode = property(getByteCode, setByteCode)
+
+ def getBpp(self):
+ return self._frames[self.currentframe].bpp
+
+ def setBpp(self, _iVal):
+ try:
+ self._frames[self.currentframe].bpp = _iVal
+ except AttributeError:
+ self._frames = [Frame()]
+ except IndexError:
+ if self.currentframe < len(self._frames):
+ self._frames.append(Frame())
+ self._frames[self.currentframe].bpp = _iVal
+ bpp = property(getBpp, setBpp)
+
+
+edfimage = EdfImage
diff --git a/fabio/eigerimage.py b/fabio/eigerimage.py
new file mode 100644
index 0000000..588d6a1
--- /dev/null
+++ b/fabio/eigerimage.py
@@ -0,0 +1,206 @@
+# coding: utf-8
+#
+# Project: FabIO X-ray image reader
+#
+# Copyright (C) 2010-2016 European Synchrotron Radiation Facility
+# Grenoble, France
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+
+"""Eiger data/master file reader for FabIO
+
+Eiger data files are HDF5 files with one group called "entry" and a dataset
+called "data" in it (now in a data group).
+
+Those dataset are usually compressed using LZ4 and/or bitshuffle compression:
+
+* https://github.com/nexusformat/HDF5-External-Filter-Plugins/tree/master/LZ4
+* https://github.com/kiyo-masui/bitshuffle
+
+H5py (>2.5) and libhdf5 (>1.8.10) with the corresponding compression plugin are needed to
+actually read the data.
+Under windows, those plugins can easily be installed via this repository:
+https://github.com/silx-kit/hdf5plugin
+
+"""
+# Get ready for python3:
+from __future__ import with_statement, print_function, division
+
+__authors__ = ["Jérôme Kieffer"]
+__contact__ = "jerome.kieffer@esrf.fr"
+__license__ = "MIT"
+__copyright__ = "ESRF"
+__date__ = "25/07/2017"
+
+import logging
+logger = logging.getLogger(__name__)
+
+try:
+ import h5py
+except ImportError:
+ h5py = None
+
+from .fabioimage import FabioImage
+from .fabioutils import NotGoodReader
+
+
+class EigerImage(FabioImage):
+ """
+ FabIO image class for Images from Eiger data files (HDF5)
+ """
+
+ DESCRIPTION = "Eiger data files based on HDF5"
+
+ DEFAULT_EXTENTIONS = ["h5"]
+
+ def __init__(self, data=None, header=None):
+ """
+ Set up initial values
+ """
+ if not h5py:
+ raise RuntimeError("fabio.EigerImage cannot be used without h5py. Please install h5py and restart")
+
+ FabioImage.__init__(self, data, header)
+ self.dataset = [data]
+ self.h5 = None
+
+ def __repr__(self):
+ if self.h5 is not None:
+ return "Eiger dataset with %i frames from %s" % (self.nframes, self.h5.filename)
+ else:
+ return "%s object at %s" % (self.__class__.__name__, hex(id(self)))
+
+ def _readheader(self, infile):
+ """
+ Read and decode the header of an image:
+
+ :param infile: Opened python file (can be stringIO or bzipped file)
+ """
+ # list of header key to keep the order (when writing)
+ self.header = self.check_header()
+ infile.seek(0)
+
+ def read(self, fname, frame=None):
+ """
+ try to read image
+ :param fname: name of the file
+ """
+
+ self.resetvals()
+ with self._open(fname) as infile:
+ self._readheader(infile)
+
+ self.dataset = None
+ lstds = []
+ # read the image data
+ self.h5 = h5py.File(fname, mode="r")
+ if "entry" in self.h5:
+ entry = self.h5["entry"]
+ if "data" in entry:
+ data = entry["data"]
+ if isinstance(data, h5py.Group):
+ "Newer format /entry/data/data_1"
+ datasets = [i for i in data.keys() if i.startswith("data")]
+ datasets.sort()
+ try:
+ for i in datasets:
+ lstds.append(data[i])
+ except KeyError:
+ pass
+
+ else:
+ lstds = [data]
+ else:
+ "elder format entry/data_01"
+ datasets = [i for i in entry.keys() if i.startswith("data")]
+ datasets.sort()
+ try:
+ for i in datasets:
+ lstds.append(entry[i])
+ except KeyError:
+ pass
+
+ if not lstds:
+ raise NotGoodReader("HDF5 file does not contain an Eiger-like structure.")
+
+ self.dataset = lstds
+ self.nframes = sum(i.shape[0] for i in lstds)
+ self._dim1 = self.dataset[0].shape[-1]
+ self._dim2 = self.dataset[0].shape[-2]
+
+ if frame is not None:
+ return self.getframe(int(frame))
+ else:
+ self.currentframe = 0
+ self.data = self.dataset[0][self.currentframe, :, :]
+ return self
+
+ def write(self, fname):
+ """
+ try to write image
+ :param fname: name of the file
+ """
+ if len(self.dataset.shape) == 2:
+ self.dataset.shape = (1,) + self.dataset.shape
+ with h5py.File(fname) as h5file:
+ grp = h5file.require_group("entry/data")
+ if len(self.dataset) > 1:
+ for i, ds in enumerate(self.dataset):
+ grp["data_%06i" % i] = ds
+ else:
+ grp["data"] = self.dataset
+
+ def getframe(self, num):
+ """ returns the frame numbered 'num' in the stack if applicable"""
+ if self.nframes > 1:
+ new_img = None
+ if (num >= 0) and num < self.nframes:
+ if isinstance(self.dataset, list):
+ nfr = num
+ for ds in self.dataset:
+ if nfr < ds.shape[0]:
+ data = ds[nfr]
+ break
+ else:
+ nfr -= ds.shape[0]
+ else:
+ data = self.dataset[num]
+ new_img = self.__class__(data=data, header=self.header)
+ new_img.dataset = self.dataset
+ new_img.h5 = self.h5
+ new_img.nframes = self.nframes
+ new_img.currentframe = num
+ else:
+ raise IOError("getframe %s out of range [%s %s[" % (num, 0, self.nframes))
+ else:
+ new_img = FabioImage.getframe(self, num)
+ return new_img
+
+ def previous(self):
+ """ returns the previous frame in the series as a fabioimage """
+ return self.getframe(self.currentframe - 1)
+
+ def next(self):
+ """ returns the next frame in the series as a fabioimage """
+ return self.getframe(self.currentframe + 1)
+
+
+eigerimage = EigerImage
diff --git a/fabio/ext/__init__.py b/fabio/ext/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/fabio/ext/__init__.py
diff --git a/fabio/ext/_cif.c b/fabio/ext/_cif.c
new file mode 100644
index 0000000..c4b969e
--- /dev/null
+++ b/fabio/ext/_cif.c
@@ -0,0 +1,20245 @@
+/* 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 < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+ #error Cython requires Python 2.6+ or Python 3.2+.
+#else
+#define CYTHON_ABI "0_21_1"
+#include <stddef.h>
+#ifndef offsetof
+#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+#define CYTHON_COMPILING_IN_PYPY 1
+#define CYTHON_COMPILING_IN_CPYTHON 0
+#else
+#define CYTHON_COMPILING_IN_PYPY 0
+#define CYTHON_COMPILING_IN_CPYTHON 1
+#endif
+#if 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+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define Py_TPFLAGS_CHECKTYPES 0
+ #define Py_TPFLAGS_HAVE_INDEX 0
+ #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_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
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t PyInt_AsLong
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#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_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
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+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
+
+
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+#define _USE_MATH_DEFINES
+#endif
+#include <math.h>
+#define __PYX_HAVE__fabio__ext___cif
+#define __PYX_HAVE_API__fabio__ext___cif
+#include "string.h"
+#include "stdio.h"
+#include "stdlib.h"
+#include "numpy/arrayobject.h"
+#include "numpy/ufuncobject.h"
+#include "pythread.h"
+#include "pystate.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#ifdef PYREX_WITHOUT_ASSERTIONS
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+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);
+#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
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+#if !defined(CYTHON_CCOMPLEX)
+ #if defined(__cplusplus)
+ #define CYTHON_CCOMPLEX 1
+ #elif defined(_Complex_I)
+ #define CYTHON_CCOMPLEX 1
+ #else
+ #define CYTHON_CCOMPLEX 0
+ #endif
+#endif
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ #include <complex>
+ #else
+ #include <complex.h>
+ #endif
+#endif
+#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
+ #undef _Complex_I
+ #define _Complex_I 1.0fj
+#endif
+
+
+static const char *__pyx_f[] = {
+ "fabio/ext/_cif.pyx",
+ "__init__.pxd",
+ "stringsource",
+ "type.pxd",
+};
+struct __pyx_memoryview_obj;
+typedef struct {
+ struct __pyx_memoryview_obj *memview;
+ char *data;
+ Py_ssize_t shape[8];
+ Py_ssize_t strides[8];
+ Py_ssize_t suboffsets[8];
+} __Pyx_memviewslice;
+
+#define IS_UNSIGNED(type) (((type) -1) > 0)
+struct __Pyx_StructField_;
+#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
+typedef struct {
+ const char* name;
+ struct __Pyx_StructField_* fields;
+ size_t size;
+ size_t arraysize[8];
+ int ndim;
+ char typegroup;
+ char is_unsigned;
+ int flags;
+} __Pyx_TypeInfo;
+typedef struct __Pyx_StructField_ {
+ __Pyx_TypeInfo* type;
+ const char* name;
+ size_t offset;
+} __Pyx_StructField;
+typedef struct {
+ __Pyx_StructField* field;
+ size_t parent_offset;
+} __Pyx_BufFmt_StackElem;
+typedef struct {
+ __Pyx_StructField root;
+ __Pyx_BufFmt_StackElem* head;
+ size_t fmt_offset;
+ size_t new_count, enc_count;
+ size_t struct_alignment;
+ int is_complex;
+ char enc_type;
+ char new_packmode;
+ char enc_packmode;
+ char is_valid_array;
+} __Pyx_BufFmt_Context;
+
+#include <pythread.h>
+#ifndef CYTHON_ATOMICS
+ #define CYTHON_ATOMICS 1
+#endif
+#define __pyx_atomic_int_type int
+#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 || \
+ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) && \
+ !defined(__i386__)
+ #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
+ #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Using GNU atomics"
+ #endif
+#elif CYTHON_ATOMICS && MSC_VER
+ #include <Windows.h>
+ #define __pyx_atomic_int_type LONG
+ #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
+ #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Using MSVC atomics"
+ #endif
+#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
+ #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
+ #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Using Intel atomics"
+ #endif
+#else
+ #undef CYTHON_ATOMICS
+ #define CYTHON_ATOMICS 0
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Not using atomics"
+ #endif
+#endif
+typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
+#if CYTHON_ATOMICS
+ #define __pyx_add_acquisition_count(memview) \
+ __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
+ #define __pyx_sub_acquisition_count(memview) \
+ __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
+#else
+ #define __pyx_add_acquisition_count(memview) \
+ __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
+ #define __pyx_sub_acquisition_count(memview) \
+ __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
+#endif
+
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":723
+ * # in Cython to enable them only on the right systems.
+ *
+ * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t
+ */
+typedef npy_int8 __pyx_t_5numpy_int8_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724
+ *
+ * ctypedef npy_int8 int8_t
+ * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int32 int32_t
+ * ctypedef npy_int64 int64_t
+ */
+typedef npy_int16 __pyx_t_5numpy_int16_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
+ * ctypedef npy_int8 int8_t
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int64 int64_t
+ * #ctypedef npy_int96 int96_t
+ */
+typedef npy_int32 __pyx_t_5numpy_int32_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t
+ * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_int96 int96_t
+ * #ctypedef npy_int128 int128_t
+ */
+typedef npy_int64 __pyx_t_5numpy_int64_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730
+ * #ctypedef npy_int128 int128_t
+ *
+ * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t
+ */
+typedef npy_uint8 __pyx_t_5numpy_uint8_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731
+ *
+ * ctypedef npy_uint8 uint8_t
+ * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint32 uint32_t
+ * ctypedef npy_uint64 uint64_t
+ */
+typedef npy_uint16 __pyx_t_5numpy_uint16_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
+ * ctypedef npy_uint8 uint8_t
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint64 uint64_t
+ * #ctypedef npy_uint96 uint96_t
+ */
+typedef npy_uint32 __pyx_t_5numpy_uint32_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t
+ * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_uint96 uint96_t
+ * #ctypedef npy_uint128 uint128_t
+ */
+typedef npy_uint64 __pyx_t_5numpy_uint64_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737
+ * #ctypedef npy_uint128 uint128_t
+ *
+ * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_float64 float64_t
+ * #ctypedef npy_float80 float80_t
+ */
+typedef npy_float32 __pyx_t_5numpy_float32_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738
+ *
+ * ctypedef npy_float32 float32_t
+ * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_float80 float80_t
+ * #ctypedef npy_float128 float128_t
+ */
+typedef npy_float64 __pyx_t_5numpy_float64_t;
+
+/* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * ctypedef npy_longlong long_t
+ * ctypedef npy_longlong longlong_t
+ */
+typedef npy_long __pyx_t_5numpy_int_t;
+
+/* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * ctypedef npy_longlong longlong_t
+ *
+ */
+typedef npy_longlong __pyx_t_5numpy_long_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
+ * ctypedef npy_long int_t
+ * ctypedef npy_longlong long_t
+ * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_ulong uint_t
+ */
+typedef npy_longlong __pyx_t_5numpy_longlong_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
+ * ctypedef npy_longlong longlong_t
+ *
+ * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
+ * ctypedef npy_ulonglong ulong_t
+ * ctypedef npy_ulonglong ulonglong_t
+ */
+typedef npy_ulong __pyx_t_5numpy_uint_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752
+ *
+ * ctypedef npy_ulong uint_t
+ * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
+ * ctypedef npy_ulonglong ulonglong_t
+ *
+ */
+typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
+ * ctypedef npy_ulong uint_t
+ * ctypedef npy_ulonglong ulong_t
+ * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_intp intp_t
+ */
+typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
+ * ctypedef npy_ulonglong ulonglong_t
+ *
+ * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uintp uintp_t
+ *
+ */
+typedef npy_intp __pyx_t_5numpy_intp_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756
+ *
+ * ctypedef npy_intp intp_t
+ * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_double float_t
+ */
+typedef npy_uintp __pyx_t_5numpy_uintp_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
+ * ctypedef npy_uintp uintp_t
+ *
+ * ctypedef npy_double float_t # <<<<<<<<<<<<<<
+ * ctypedef npy_double double_t
+ * ctypedef npy_longdouble longdouble_t
+ */
+typedef npy_double __pyx_t_5numpy_float_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759
+ *
+ * ctypedef npy_double float_t
+ * ctypedef npy_double double_t # <<<<<<<<<<<<<<
+ * ctypedef npy_longdouble longdouble_t
+ *
+ */
+typedef npy_double __pyx_t_5numpy_double_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
+ * ctypedef npy_double float_t
+ * ctypedef npy_double double_t
+ * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_cfloat cfloat_t
+ */
+typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ typedef ::std::complex< float > __pyx_t_float_complex;
+ #else
+ typedef float _Complex __pyx_t_float_complex;
+ #endif
+#else
+ typedef struct { float real, imag; } __pyx_t_float_complex;
+#endif
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ typedef ::std::complex< double > __pyx_t_double_complex;
+ #else
+ typedef double _Complex __pyx_t_double_complex;
+ #endif
+#else
+ typedef struct { double real, imag; } __pyx_t_double_complex;
+#endif
+
+
+/*--- Type declarations ---*/
+struct __pyx_array_obj;
+struct __pyx_MemviewEnum_obj;
+struct __pyx_memoryview_obj;
+struct __pyx_memoryviewslice_obj;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762
+ * ctypedef npy_longdouble longdouble_t
+ *
+ * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
+ * ctypedef npy_cdouble cdouble_t
+ * ctypedef npy_clongdouble clongdouble_t
+ */
+typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763
+ *
+ * ctypedef npy_cfloat cfloat_t
+ * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
+ * ctypedef npy_clongdouble clongdouble_t
+ *
+ */
+typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
+ * ctypedef npy_cfloat cfloat_t
+ * ctypedef npy_cdouble cdouble_t
+ * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_cdouble complex_t
+ */
+typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
+ * ctypedef npy_clongdouble clongdouble_t
+ *
+ * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew1(a):
+ */
+typedef npy_cdouble __pyx_t_5numpy_complex_t;
+
+/* "View.MemoryView":99
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+struct __pyx_array_obj {
+ PyObject_HEAD
+ char *data;
+ Py_ssize_t len;
+ char *format;
+ int ndim;
+ Py_ssize_t *_shape;
+ Py_ssize_t *_strides;
+ Py_ssize_t itemsize;
+ PyObject *mode;
+ PyObject *_format;
+ void (*callback_free_data)(void *);
+ int free_data;
+ int dtype_is_object;
+};
+
+
+/* "View.MemoryView":269
+ *
+ * @cname('__pyx_MemviewEnum')
+ * cdef class Enum(object): # <<<<<<<<<<<<<<
+ * cdef object name
+ * def __init__(self, name):
+ */
+struct __pyx_MemviewEnum_obj {
+ PyObject_HEAD
+ PyObject *name;
+};
+
+
+/* "View.MemoryView":302
+ *
+ * @cname('__pyx_memoryview')
+ * cdef class memoryview(object): # <<<<<<<<<<<<<<
+ *
+ * cdef object obj
+ */
+struct __pyx_memoryview_obj {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_memoryview *__pyx_vtab;
+ PyObject *obj;
+ PyObject *_size;
+ PyObject *_array_interface;
+ PyThread_type_lock lock;
+ __pyx_atomic_int acquisition_count[2];
+ __pyx_atomic_int *acquisition_count_aligned_p;
+ Py_buffer view;
+ int flags;
+ int dtype_is_object;
+ __Pyx_TypeInfo *typeinfo;
+};
+
+
+/* "View.MemoryView":922
+ *
+ * @cname('__pyx_memoryviewslice')
+ * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
+ * "Internal class for passing memoryview slices to Python"
+ *
+ */
+struct __pyx_memoryviewslice_obj {
+ struct __pyx_memoryview_obj __pyx_base;
+ __Pyx_memviewslice from_slice;
+ PyObject *from_object;
+ PyObject *(*to_object_func)(char *);
+ int (*to_dtype_func)(char *, PyObject *);
+};
+
+
+
+/* "View.MemoryView":302
+ *
+ * @cname('__pyx_memoryview')
+ * cdef class memoryview(object): # <<<<<<<<<<<<<<
+ *
+ * cdef object obj
+ */
+
+struct __pyx_vtabstruct_memoryview {
+ char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
+ PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
+ PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
+ PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
+};
+static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
+
+
+/* "View.MemoryView":922
+ *
+ * @cname('__pyx_memoryviewslice')
+ * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
+ * "Internal class for passing memoryview slices to Python"
+ *
+ */
+
+struct __pyx_vtabstruct__memoryviewslice {
+ struct __pyx_vtabstruct_memoryview __pyx_base;
+};
+static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ if (acquire_gil) { \
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ PyGILState_Release(__pyx_gilstate_save); \
+ } else { \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext() \
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_XDECREF(tmp); \
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_DECREF(tmp); \
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
+ PyListObject* L = (PyListObject*) list;
+ Py_ssize_t len = Py_SIZE(list);
+ if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
+ Py_INCREF(x);
+ PyList_SET_ITEM(list, len, x);
+ Py_SIZE(list) = len+1;
+ return 0;
+ }
+ return PyList_Append(list, x);
+}
+#else
+#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
+ PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
+ PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
+ int has_cstart, int has_cstop, int wraparound);
+
+#if 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
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
+#else
+#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
+#endif
+
+#include <string.h>
+
+static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
+
+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_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
+#define __Pyx_MEMVIEW_DIRECT 1
+#define __Pyx_MEMVIEW_PTR 2
+#define __Pyx_MEMVIEW_FULL 4
+#define __Pyx_MEMVIEW_CONTIG 8
+#define __Pyx_MEMVIEW_STRIDED 16
+#define __Pyx_MEMVIEW_FOLLOW 32
+#define __Pyx_IS_C_CONTIG 1
+#define __Pyx_IS_F_CONTIG 2
+static int __Pyx_init_memviewslice(
+ struct __pyx_memoryview_obj *memview,
+ int ndim,
+ __Pyx_memviewslice *memviewslice,
+ int memview_is_new_reference);
+static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
+ __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
+static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
+ __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
+#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
+#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
+#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
+#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
+static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
+static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+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);
+
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+
+static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+ const char* function_name);
+
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+ const char *name, int exact);
+
+static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
+#else
+#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
+#endif
+
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */
+
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
+
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+
+static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+ const char* cstring, Py_ssize_t start, Py_ssize_t stop,
+ const char* encoding, const char* errors,
+ PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
+
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
+static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+
+#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_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
+ PyListObject* L = (PyListObject*) list;
+ Py_ssize_t len = Py_SIZE(list);
+ if (likely(L->allocated > len)) {
+ Py_INCREF(x);
+ PyList_SET_ITEM(list, len, x);
+ Py_SIZE(list) = len+1;
+ return 0;
+ }
+ return PyList_Append(list, x);
+}
+#else
+#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
+#endif
+
+static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/
+static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject* none = _PyList_Extend((PyListObject*)L, v);
+ if (unlikely(!none))
+ return -1;
+ Py_DECREF(none);
+ return 0;
+#else
+ return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
+#endif
+}
+
+static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
+
+static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
+
+static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
+static void __Pyx_WriteUnraisable(const char *name, int clineno,
+ int lineno, const char *filename,
+ int full_traceback);
+
+static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+
+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);
+
+typedef struct {
+ Py_ssize_t shape, strides, suboffsets;
+} __Pyx_Buf_DimInfo;
+typedef struct {
+ size_t refcount;
+ Py_buffer pybuffer;
+} __Pyx_Buffer;
+typedef struct {
+ __Pyx_Buffer *rcbuffer;
+ char *data;
+ __Pyx_Buf_DimInfo diminfo[8];
+} __Pyx_LocalBuf_ND;
+
+#if PY_MAJOR_VERSION < 3
+ static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
+ static void __Pyx_ReleaseBuffer(Py_buffer *view);
+#else
+ #define __Pyx_GetBuffer PyObject_GetBuffer
+ #define __Pyx_ReleaseBuffer PyBuffer_Release
+#endif
+
+
+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);
+
+static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ #define __Pyx_CREAL(z) ((z).real())
+ #define __Pyx_CIMAG(z) ((z).imag())
+ #else
+ #define __Pyx_CREAL(z) (__real__(z))
+ #define __Pyx_CIMAG(z) (__imag__(z))
+ #endif
+#else
+ #define __Pyx_CREAL(z) ((z).real)
+ #define __Pyx_CIMAG(z) ((z).imag)
+#endif
+#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
+ #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
+ #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
+#endif
+
+static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
+
+#if CYTHON_CCOMPLEX
+ #define __Pyx_c_eqf(a, b) ((a)==(b))
+ #define __Pyx_c_sumf(a, b) ((a)+(b))
+ #define __Pyx_c_difff(a, b) ((a)-(b))
+ #define __Pyx_c_prodf(a, b) ((a)*(b))
+ #define __Pyx_c_quotf(a, b) ((a)/(b))
+ #define __Pyx_c_negf(a) (-(a))
+ #ifdef __cplusplus
+ #define __Pyx_c_is_zerof(z) ((z)==(float)0)
+ #define __Pyx_c_conjf(z) (::std::conj(z))
+ #if 1
+ #define __Pyx_c_absf(z) (::std::abs(z))
+ #define __Pyx_c_powf(a, b) (::std::pow(a, b))
+ #endif
+ #else
+ #define __Pyx_c_is_zerof(z) ((z)==0)
+ #define __Pyx_c_conjf(z) (conjf(z))
+ #if 1
+ #define __Pyx_c_absf(z) (cabsf(z))
+ #define __Pyx_c_powf(a, b) (cpowf(a, b))
+ #endif
+ #endif
+#else
+ static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
+ #if 1
+ static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
+ #endif
+#endif
+
+static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
+
+#if CYTHON_CCOMPLEX
+ #define __Pyx_c_eq(a, b) ((a)==(b))
+ #define __Pyx_c_sum(a, b) ((a)+(b))
+ #define __Pyx_c_diff(a, b) ((a)-(b))
+ #define __Pyx_c_prod(a, b) ((a)*(b))
+ #define __Pyx_c_quot(a, b) ((a)/(b))
+ #define __Pyx_c_neg(a) (-(a))
+ #ifdef __cplusplus
+ #define __Pyx_c_is_zero(z) ((z)==(double)0)
+ #define __Pyx_c_conj(z) (::std::conj(z))
+ #if 1
+ #define __Pyx_c_abs(z) (::std::abs(z))
+ #define __Pyx_c_pow(a, b) (::std::pow(a, b))
+ #endif
+ #else
+ #define __Pyx_c_is_zero(z) ((z)==0)
+ #define __Pyx_c_conj(z) (conj(z))
+ #if 1
+ #define __Pyx_c_abs(z) (cabs(z))
+ #define __Pyx_c_pow(a, b) (cpow(a, b))
+ #endif
+ #endif
+#else
+ static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
+ #if 1
+ static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
+ #endif
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
+ char order, int ndim);
+
+static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize);
+
+static __Pyx_memviewslice
+__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
+ const char *mode, int ndim,
+ size_t sizeof_dtype, int contig_flag,
+ int dtype_is_object);
+
+static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
+
+static int __Pyx_ValidateAndInit_memviewslice(
+ int *axes_specs,
+ int c_or_f_flag,
+ int buf_flags,
+ int ndim,
+ __Pyx_TypeInfo *dtype,
+ __Pyx_BufFmt_StackElem stack[],
+ __Pyx_memviewslice *memviewslice,
+ PyObject *original_obj);
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(PyObject *);
+
+static int __Pyx_check_binary_version(void);
+
+#if !defined(__Pyx_PyIdentifier_FromString)
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
+#else
+ #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
+#endif
+#endif
+
+static PyObject *__Pyx_ImportModule(const char *name);
+
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
+static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
+static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
+static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
+static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
+static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
+static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
+static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
+static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
+
+/* Module declarations from 'cpython.buffer' */
+
+/* Module declarations from 'cpython.ref' */
+
+/* Module declarations from 'libc.string' */
+
+/* Module declarations from 'libc.stdio' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.type' */
+static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
+
+/* Module declarations from 'libc.stdlib' */
+
+/* Module declarations from 'numpy' */
+
+/* Module declarations from 'numpy' */
+static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
+static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
+static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
+static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
+static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
+static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
+
+/* Module declarations from 'cython.view' */
+
+/* Module declarations from 'cython' */
+
+/* Module declarations from 'fabio.ext._cif' */
+static PyTypeObject *__pyx_array_type = 0;
+static PyTypeObject *__pyx_MemviewEnum_type = 0;
+static PyTypeObject *__pyx_memoryview_type = 0;
+static PyTypeObject *__pyx_memoryviewslice_type = 0;
+static PyObject *generic = 0;
+static PyObject *strided = 0;
+static PyObject *indirect = 0;
+static PyObject *contiguous = 0;
+static PyObject *indirect_contiguous = 0;
+static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
+static void *__pyx_align_pointer(void *, size_t); /*proto*/
+static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
+static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
+static PyObject *_unellipsify(PyObject *, int); /*proto*/
+static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
+static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
+static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
+static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
+static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
+static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
+static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
+static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
+static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
+static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
+static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
+static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
+static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
+static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
+static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
+static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
+static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
+static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
+static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
+static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
+static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
+static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
+static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
+static __Pyx_TypeInfo __Pyx_TypeInfo_unsigned_char = { "unsigned char", NULL, sizeof(unsigned char), { 0 }, 0, IS_UNSIGNED(unsigned char) ? 'U' : 'I', IS_UNSIGNED(unsigned char), 0 };
+#define __Pyx_MODULE_NAME "fabio.ext._cif"
+int __pyx_module_is_main_fabio__ext___cif = 0;
+
+/* Implementation of 'fabio.ext._cif' */
+static PyObject *__pyx_builtin_ValueError;
+static PyObject *__pyx_builtin_range;
+static PyObject *__pyx_builtin_RuntimeError;
+static PyObject *__pyx_builtin_MemoryError;
+static PyObject *__pyx_builtin_enumerate;
+static PyObject *__pyx_builtin_Ellipsis;
+static PyObject *__pyx_builtin_TypeError;
+static PyObject *__pyx_builtin_xrange;
+static PyObject *__pyx_builtin_id;
+static PyObject *__pyx_builtin_IndexError;
+static PyObject *__pyx_pf_5fabio_3ext_4_cif_split_tokens(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bytes_text); /* 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 int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
+static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
+static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
+static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
+static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
+static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
+static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
+static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static char __pyx_k_[] = "\r\n";
+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_c[] = "c";
+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__2[] = " \t\r\n";
+static char __pyx_k_id[] = "id";
+static char __pyx_k_EOL[] = "EOL";
+static char __pyx_k_MIT[] = "MIT";
+static char __pyx_k_ary[] = "ary";
+static char __pyx_k_cur[] = "cur";
+static char __pyx_k_end[] = "end";
+static char __pyx_k_obj[] = "obj";
+static char __pyx_k_DASH[] = "DASH";
+static char __pyx_k_HASH[] = "HASH";
+static char __pyx_k_base[] = "base";
+static char __pyx_k_date[] = "__date__";
+static char __pyx_k_find[] = "find";
+static char __pyx_k_imax[] = "imax";
+static char __pyx_k_lbms[] = "lbms";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_mode[] = "mode";
+static char __pyx_k_name[] = "name";
+static char __pyx_k_ndim[] = "ndim";
+static char __pyx_k_next[] = "next";
+static char __pyx_k_pack[] = "pack";
+static char __pyx_k_prev[] = "prev";
+static char __pyx_k_size[] = "size";
+static char __pyx_k_step[] = "step";
+static char __pyx_k_stop[] = "stop";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_BLANK[] = "BLANK";
+static char __pyx_k_class[] = "__class__";
+static char __pyx_k_error[] = "error";
+static char __pyx_k_flags[] = "flags";
+static char __pyx_k_go_on[] = "go_on";
+static char __pyx_k_numpy[] = "numpy";
+static char __pyx_k_range[] = "range";
+static char __pyx_k_shape[] = "shape";
+static char __pyx_k_start[] = "start";
+static char __pyx_k_strip[] = "strip";
+static char __pyx_k_author[] = "__author__";
+static char __pyx_k_fields[] = "fields";
+static char __pyx_k_format[] = "format";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_name_2[] = "__name__";
+static char __pyx_k_struct[] = "struct";
+static char __pyx_k_unpack[] = "unpack";
+static char __pyx_k_xrange[] = "xrange";
+static char __pyx_k_contact[] = "__contact__";
+static char __pyx_k_fortran[] = "fortran";
+static char __pyx_k_license[] = "__license__";
+static char __pyx_k_memview[] = "memview";
+static char __pyx_k_Ellipsis[] = "Ellipsis";
+static char __pyx_k_itemsize[] = "itemsize";
+static char __pyx_k_TypeError[] = "TypeError";
+static char __pyx_k_copyright[] = "__copyright__";
+static char __pyx_k_enumerate[] = "enumerate";
+static char __pyx_k_multiline[] = "multiline";
+static char __pyx_k_25_07_2017[] = "25/07/2017";
+static char __pyx_k_IndexError[] = "IndexError";
+static char __pyx_k_SEMICOLUMN[] = "SEMICOLUMN";
+static char __pyx_k_UNDERSCORE[] = "UNDERSCORE";
+static char __pyx_k_ValueError[] = "ValueError";
+static char __pyx_k_bytes_text[] = "bytes_text";
+static char __pyx_k_in_comment[] = "in_comment";
+static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static char __pyx_k_MemoryError[] = "MemoryError";
+static char __pyx_k_DOUBLE_QUOTE[] = "DOUBLE_QUOTE";
+static char __pyx_k_QUESTIONMARK[] = "QUESTIONMARK";
+static char __pyx_k_RuntimeError[] = "RuntimeError";
+static char __pyx_k_SINGLE_QUOTE[] = "SINGLE_QUOTE";
+static char __pyx_k_split_tokens[] = "split_tokens";
+static char __pyx_k_BINARY_MARKER[] = "BINARY_MARKER";
+static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
+static char __pyx_k_Jerome_Kieffer[] = "Jerome Kieffer";
+static char __pyx_k_fabio_ext__cif[] = "fabio.ext._cif";
+static char __pyx_k_allocate_buffer[] = "allocate_buffer";
+static char __pyx_k_dtype_is_object[] = "dtype_is_object";
+static char __pyx_k_in_double_quote[] = "in_double_quote";
+static char __pyx_k_in_single_quote[] = "in_single_quote";
+static char __pyx_k_strided_and_direct[] = "<strided and direct>";
+static char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
+static char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
+static char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
+static char __pyx_k_jerome_kieffer_esrf_eu[] = "jerome.kieffer@esrf.eu";
+static char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
+static char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
+static char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
+static char __pyx_k_getbuffer_obj_view_flags[] = "getbuffer(obj, view, flags)";
+static char __pyx_k_CIF_BINARY_FORMAT_SECTION[] = "--CIF-BINARY-FORMAT-SECTION--";
+static char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
+static char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
+static char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)";
+static char __pyx_k_Cif_parser_helper_functions[] = "Cif parser helper functions";
+static char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)";
+static char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
+static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
+static char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
+static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static char __pyx_k_workspace_valls_fabio_git_fabio[] = "/workspace/valls/fabio.git/fabio/ext/_cif.pyx";
+static char __pyx_k_2014_European_Synchrotron_Radiat[] = "2014, European Synchrotron Radiation Facility, Grenoble, France";
+static char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
+static char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
+static char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
+static char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
+static char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
+static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
+static char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
+static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
+static char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
+static char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
+static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
+static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static PyObject *__pyx_kp_b_;
+static PyObject *__pyx_kp_s_2014_European_Synchrotron_Radiat;
+static PyObject *__pyx_kp_s_25_07_2017;
+static PyObject *__pyx_n_s_BINARY_MARKER;
+static PyObject *__pyx_n_s_BLANK;
+static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
+static PyObject *__pyx_kp_b_CIF_BINARY_FORMAT_SECTION;
+static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
+static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
+static PyObject *__pyx_n_s_DASH;
+static PyObject *__pyx_n_s_DOUBLE_QUOTE;
+static PyObject *__pyx_n_s_EOL;
+static PyObject *__pyx_n_s_Ellipsis;
+static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
+static PyObject *__pyx_n_s_HASH;
+static PyObject *__pyx_n_s_IndexError;
+static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
+static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
+static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
+static PyObject *__pyx_kp_s_Jerome_Kieffer;
+static PyObject *__pyx_n_s_MIT;
+static PyObject *__pyx_n_s_MemoryError;
+static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
+static PyObject *__pyx_kp_s_MemoryView_of_r_object;
+static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
+static PyObject *__pyx_n_b_O;
+static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
+static PyObject *__pyx_n_s_QUESTIONMARK;
+static PyObject *__pyx_n_s_RuntimeError;
+static PyObject *__pyx_n_s_SEMICOLUMN;
+static PyObject *__pyx_n_s_SINGLE_QUOTE;
+static PyObject *__pyx_n_s_TypeError;
+static PyObject *__pyx_n_s_UNDERSCORE;
+static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_kp_b__2;
+static PyObject *__pyx_n_s_allocate_buffer;
+static PyObject *__pyx_n_s_ary;
+static PyObject *__pyx_n_s_author;
+static PyObject *__pyx_n_s_base;
+static PyObject *__pyx_n_s_bytes_text;
+static PyObject *__pyx_n_s_c;
+static PyObject *__pyx_n_u_c;
+static PyObject *__pyx_n_s_class;
+static PyObject *__pyx_n_s_contact;
+static PyObject *__pyx_kp_s_contiguous_and_direct;
+static PyObject *__pyx_kp_s_contiguous_and_indirect;
+static PyObject *__pyx_n_s_copyright;
+static PyObject *__pyx_n_s_cur;
+static PyObject *__pyx_n_s_date;
+static PyObject *__pyx_n_s_dtype_is_object;
+static PyObject *__pyx_n_s_end;
+static PyObject *__pyx_n_s_enumerate;
+static PyObject *__pyx_n_s_error;
+static PyObject *__pyx_n_s_fabio_ext__cif;
+static PyObject *__pyx_n_s_fields;
+static PyObject *__pyx_n_s_find;
+static PyObject *__pyx_n_s_flags;
+static PyObject *__pyx_n_s_format;
+static PyObject *__pyx_n_s_fortran;
+static PyObject *__pyx_n_u_fortran;
+static PyObject *__pyx_n_s_go_on;
+static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
+static PyObject *__pyx_n_s_i;
+static PyObject *__pyx_n_s_id;
+static PyObject *__pyx_n_s_imax;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_in_comment;
+static PyObject *__pyx_n_s_in_double_quote;
+static PyObject *__pyx_n_s_in_single_quote;
+static PyObject *__pyx_n_s_itemsize;
+static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
+static PyObject *__pyx_kp_s_jerome_kieffer_esrf_eu;
+static PyObject *__pyx_n_s_lbms;
+static PyObject *__pyx_n_s_license;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_memview;
+static PyObject *__pyx_n_s_mode;
+static PyObject *__pyx_n_s_multiline;
+static PyObject *__pyx_n_s_name;
+static PyObject *__pyx_n_s_name_2;
+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_ndim;
+static PyObject *__pyx_n_s_next;
+static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_n_s_obj;
+static PyObject *__pyx_n_s_pack;
+static PyObject *__pyx_n_s_prev;
+static PyObject *__pyx_n_s_pyx_getbuffer;
+static PyObject *__pyx_n_s_pyx_vtable;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_shape;
+static PyObject *__pyx_n_s_size;
+static PyObject *__pyx_n_s_split_tokens;
+static PyObject *__pyx_n_s_start;
+static PyObject *__pyx_n_s_step;
+static PyObject *__pyx_n_s_stop;
+static PyObject *__pyx_kp_s_strided_and_direct;
+static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
+static PyObject *__pyx_kp_s_strided_and_indirect;
+static PyObject *__pyx_n_s_strip;
+static PyObject *__pyx_n_s_struct;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
+static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
+static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
+static PyObject *__pyx_n_s_unpack;
+static PyObject *__pyx_kp_s_workspace_valls_fabio_git_fabio;
+static PyObject *__pyx_n_s_xrange;
+static PyObject *__pyx_int_0;
+static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_neg_1;
+static PyObject *__pyx_tuple__3;
+static PyObject *__pyx_tuple__4;
+static PyObject *__pyx_tuple__5;
+static PyObject *__pyx_tuple__6;
+static PyObject *__pyx_tuple__7;
+static PyObject *__pyx_tuple__8;
+static PyObject *__pyx_tuple__9;
+static PyObject *__pyx_slice__16;
+static PyObject *__pyx_slice__17;
+static PyObject *__pyx_slice__18;
+static PyObject *__pyx_tuple__10;
+static PyObject *__pyx_tuple__11;
+static PyObject *__pyx_tuple__12;
+static PyObject *__pyx_tuple__13;
+static PyObject *__pyx_tuple__14;
+static PyObject *__pyx_tuple__15;
+static PyObject *__pyx_tuple__19;
+static PyObject *__pyx_tuple__20;
+static PyObject *__pyx_tuple__22;
+static PyObject *__pyx_tuple__23;
+static PyObject *__pyx_tuple__24;
+static PyObject *__pyx_tuple__25;
+static PyObject *__pyx_tuple__26;
+static PyObject *__pyx_codeobj__21;
+
+/* "fabio/ext/_cif.pyx":42
+ *
+ * @cython.boundscheck(False)
+ * def split_tokens(bytes_text): # <<<<<<<<<<<<<<
+ * """
+ * Separate the text representing a CIF file into a list of tokens.
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_4_cif_1split_tokens(PyObject *__pyx_self, PyObject *__pyx_v_bytes_text); /*proto*/
+static char __pyx_doc_5fabio_3ext_4_cif_split_tokens[] = "\n Separate the text representing a CIF file into a list of tokens.\n\n @param bytes_text: the content of the CIF - file\n @type bytes_text: 8-bit string (str in python2 or bytes in python3)\n @return: list of all the fields of the CIF\n @rtype: list\n ";
+static PyMethodDef __pyx_mdef_5fabio_3ext_4_cif_1split_tokens = {"split_tokens", (PyCFunction)__pyx_pw_5fabio_3ext_4_cif_1split_tokens, METH_O, __pyx_doc_5fabio_3ext_4_cif_split_tokens};
+static PyObject *__pyx_pw_5fabio_3ext_4_cif_1split_tokens(PyObject *__pyx_self, PyObject *__pyx_v_bytes_text) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("split_tokens (wrapper)", 0);
+ __pyx_r = __pyx_pf_5fabio_3ext_4_cif_split_tokens(__pyx_self, ((PyObject *)__pyx_v_bytes_text));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_4_cif_split_tokens(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bytes_text) {
+ __Pyx_memviewslice __pyx_v_ary = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_in_comment;
+ int __pyx_v_in_single_quote;
+ int __pyx_v_in_double_quote;
+ int __pyx_v_multiline;
+ int __pyx_v_go_on;
+ int __pyx_v_i;
+ int __pyx_v_start;
+ int __pyx_v_end;
+ int __pyx_v_imax;
+ char __pyx_v_prev;
+ char __pyx_v_next;
+ char __pyx_v_cur;
+ PyObject *__pyx_v_EOL = 0;
+ PyObject *__pyx_v_BLANK = 0;
+ unsigned char __pyx_v_SINGLE_QUOTE;
+ unsigned char __pyx_v_DOUBLE_QUOTE;
+ unsigned char __pyx_v_SEMICOLUMN;
+ unsigned char __pyx_v_HASH;
+ CYTHON_UNUSED unsigned char __pyx_v_UNDERSCORE;
+ unsigned char __pyx_v_DASH;
+ CYTHON_UNUSED unsigned char __pyx_v_QUESTIONMARK;
+ PyObject *__pyx_v_BINARY_MARKER = 0;
+ int __pyx_v_lbms;
+ PyObject *__pyx_v_fields = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ Py_ssize_t __pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+ int __pyx_t_6;
+ long __pyx_t_7;
+ PyObject *__pyx_t_8 = NULL;
+ int __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
+ int __pyx_t_11;
+ long __pyx_t_12;
+ int __pyx_t_13;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("split_tokens", 0);
+
+ /* "fabio/ext/_cif.pyx":52
+ * """
+ * cdef:
+ * unsigned char[:] ary = bytearray(bytes_text) # <<<<<<<<<<<<<<
+ * bint in_comment = False, in_single_quote = False
+ * bint in_double_quote = False, multiline = False, go_on = True
+ */
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_bytes_text);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_bytes_text);
+ __Pyx_GIVEREF(__pyx_v_bytes_text);
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyByteArray_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(__pyx_t_2);
+ if (unlikely(!__pyx_t_3.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_ary = __pyx_t_3;
+ __pyx_t_3.memview = NULL;
+ __pyx_t_3.data = NULL;
+
+ /* "fabio/ext/_cif.pyx":53
+ * cdef:
+ * unsigned char[:] ary = bytearray(bytes_text)
+ * bint in_comment = False, in_single_quote = False # <<<<<<<<<<<<<<
+ * bint in_double_quote = False, multiline = False, go_on = True
+ * int i = -1, start = -1, end = -1, imax
+ */
+ __pyx_v_in_comment = 0;
+ __pyx_v_in_single_quote = 0;
+
+ /* "fabio/ext/_cif.pyx":54
+ * unsigned char[:] ary = bytearray(bytes_text)
+ * bint in_comment = False, in_single_quote = False
+ * bint in_double_quote = False, multiline = False, go_on = True # <<<<<<<<<<<<<<
+ * int i = -1, start = -1, end = -1, imax
+ * char prev, next, cur = b"\n"
+ */
+ __pyx_v_in_double_quote = 0;
+ __pyx_v_multiline = 0;
+ __pyx_v_go_on = 1;
+
+ /* "fabio/ext/_cif.pyx":55
+ * bint in_comment = False, in_single_quote = False
+ * bint in_double_quote = False, multiline = False, go_on = True
+ * int i = -1, start = -1, end = -1, imax # <<<<<<<<<<<<<<
+ * char prev, next, cur = b"\n"
+ * bytes EOL = b'\r\n'
+ */
+ __pyx_v_i = -1;
+ __pyx_v_start = -1;
+ __pyx_v_end = -1;
+
+ /* "fabio/ext/_cif.pyx":56
+ * bint in_double_quote = False, multiline = False, go_on = True
+ * int i = -1, start = -1, end = -1, imax
+ * char prev, next, cur = b"\n" # <<<<<<<<<<<<<<
+ * bytes EOL = b'\r\n'
+ * bytes BLANK = b" \t\r\n"
+ */
+ __pyx_v_cur = '\n';
+
+ /* "fabio/ext/_cif.pyx":57
+ * int i = -1, start = -1, end = -1, imax
+ * char prev, next, cur = b"\n"
+ * bytes EOL = b'\r\n' # <<<<<<<<<<<<<<
+ * bytes BLANK = b" \t\r\n"
+ * unsigned char SINGLE_QUOTE = b"'"
+ */
+ __Pyx_INCREF(__pyx_kp_b_);
+ __pyx_v_EOL = __pyx_kp_b_;
+
+ /* "fabio/ext/_cif.pyx":58
+ * char prev, next, cur = b"\n"
+ * bytes EOL = b'\r\n'
+ * bytes BLANK = b" \t\r\n" # <<<<<<<<<<<<<<
+ * unsigned char SINGLE_QUOTE = b"'"
+ * unsigned char DOUBLE_QUOTE = b'"'
+ */
+ __Pyx_INCREF(__pyx_kp_b__2);
+ __pyx_v_BLANK = __pyx_kp_b__2;
+
+ /* "fabio/ext/_cif.pyx":59
+ * bytes EOL = b'\r\n'
+ * bytes BLANK = b" \t\r\n"
+ * unsigned char SINGLE_QUOTE = b"'" # <<<<<<<<<<<<<<
+ * unsigned char DOUBLE_QUOTE = b'"'
+ * unsigned char SEMICOLUMN = b';'
+ */
+ __pyx_v_SINGLE_QUOTE = '\'';
+
+ /* "fabio/ext/_cif.pyx":60
+ * bytes BLANK = b" \t\r\n"
+ * unsigned char SINGLE_QUOTE = b"'"
+ * unsigned char DOUBLE_QUOTE = b'"' # <<<<<<<<<<<<<<
+ * unsigned char SEMICOLUMN = b';'
+ * unsigned char HASH = b"#"
+ */
+ __pyx_v_DOUBLE_QUOTE = '"';
+
+ /* "fabio/ext/_cif.pyx":61
+ * unsigned char SINGLE_QUOTE = b"'"
+ * unsigned char DOUBLE_QUOTE = b'"'
+ * unsigned char SEMICOLUMN = b';' # <<<<<<<<<<<<<<
+ * unsigned char HASH = b"#"
+ * unsigned char UNDERSCORE = b"_"
+ */
+ __pyx_v_SEMICOLUMN = ';';
+
+ /* "fabio/ext/_cif.pyx":62
+ * unsigned char DOUBLE_QUOTE = b'"'
+ * unsigned char SEMICOLUMN = b';'
+ * unsigned char HASH = b"#" # <<<<<<<<<<<<<<
+ * unsigned char UNDERSCORE = b"_"
+ * unsigned char DASH = b"-"
+ */
+ __pyx_v_HASH = '#';
+
+ /* "fabio/ext/_cif.pyx":63
+ * unsigned char SEMICOLUMN = b';'
+ * unsigned char HASH = b"#"
+ * unsigned char UNDERSCORE = b"_" # <<<<<<<<<<<<<<
+ * unsigned char DASH = b"-"
+ * unsigned char QUESTIONMARK = b"?"
+ */
+ __pyx_v_UNDERSCORE = '_';
+
+ /* "fabio/ext/_cif.pyx":64
+ * unsigned char HASH = b"#"
+ * unsigned char UNDERSCORE = b"_"
+ * unsigned char DASH = b"-" # <<<<<<<<<<<<<<
+ * unsigned char QUESTIONMARK = b"?"
+ * bytes BINARY_MARKER = b"--CIF-BINARY-FORMAT-SECTION--"
+ */
+ __pyx_v_DASH = '-';
+
+ /* "fabio/ext/_cif.pyx":65
+ * unsigned char UNDERSCORE = b"_"
+ * unsigned char DASH = b"-"
+ * unsigned char QUESTIONMARK = b"?" # <<<<<<<<<<<<<<
+ * bytes BINARY_MARKER = b"--CIF-BINARY-FORMAT-SECTION--"
+ * int lbms = len(BINARY_MARKER)
+ */
+ __pyx_v_QUESTIONMARK = '?';
+
+ /* "fabio/ext/_cif.pyx":66
+ * unsigned char DASH = b"-"
+ * unsigned char QUESTIONMARK = b"?"
+ * bytes BINARY_MARKER = b"--CIF-BINARY-FORMAT-SECTION--" # <<<<<<<<<<<<<<
+ * int lbms = len(BINARY_MARKER)
+ * next = ary[0]
+ */
+ __Pyx_INCREF(__pyx_kp_b_CIF_BINARY_FORMAT_SECTION);
+ __pyx_v_BINARY_MARKER = __pyx_kp_b_CIF_BINARY_FORMAT_SECTION;
+
+ /* "fabio/ext/_cif.pyx":67
+ * unsigned char QUESTIONMARK = b"?"
+ * bytes BINARY_MARKER = b"--CIF-BINARY-FORMAT-SECTION--"
+ * int lbms = len(BINARY_MARKER) # <<<<<<<<<<<<<<
+ * next = ary[0]
+ * imax = len(bytes_text) - 1
+ */
+ __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_BINARY_MARKER); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_lbms = __pyx_t_4;
+
+ /* "fabio/ext/_cif.pyx":68
+ * bytes BINARY_MARKER = b"--CIF-BINARY-FORMAT-SECTION--"
+ * int lbms = len(BINARY_MARKER)
+ * next = ary[0] # <<<<<<<<<<<<<<
+ * imax = len(bytes_text) - 1
+ * fields = []
+ */
+ __pyx_t_4 = 0;
+ if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_ary.shape[0];
+ __pyx_v_next = (*((unsigned char *) ( /* dim=0 */ (__pyx_v_ary.data + __pyx_t_4 * __pyx_v_ary.strides[0]) )));
+
+ /* "fabio/ext/_cif.pyx":69
+ * int lbms = len(BINARY_MARKER)
+ * next = ary[0]
+ * imax = len(bytes_text) - 1 # <<<<<<<<<<<<<<
+ * fields = []
+ * while go_on:
+ */
+ __pyx_t_5 = PyObject_Length(__pyx_v_bytes_text); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_imax = (__pyx_t_5 - 1);
+
+ /* "fabio/ext/_cif.pyx":70
+ * next = ary[0]
+ * imax = len(bytes_text) - 1
+ * fields = [] # <<<<<<<<<<<<<<
+ * while go_on:
+ * i += 1
+ */
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v_fields = ((PyObject*)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "fabio/ext/_cif.pyx":71
+ * imax = len(bytes_text) - 1
+ * fields = []
+ * while go_on: # <<<<<<<<<<<<<<
+ * i += 1
+ * prev = cur
+ */
+ while (1) {
+ __pyx_t_6 = (__pyx_v_go_on != 0);
+ if (!__pyx_t_6) break;
+
+ /* "fabio/ext/_cif.pyx":72
+ * fields = []
+ * while go_on:
+ * i += 1 # <<<<<<<<<<<<<<
+ * prev = cur
+ * cur = next
+ */
+ __pyx_v_i = (__pyx_v_i + 1);
+
+ /* "fabio/ext/_cif.pyx":73
+ * while go_on:
+ * i += 1
+ * prev = cur # <<<<<<<<<<<<<<
+ * cur = next
+ * if i < imax:
+ */
+ __pyx_v_prev = __pyx_v_cur;
+
+ /* "fabio/ext/_cif.pyx":74
+ * i += 1
+ * prev = cur
+ * cur = next # <<<<<<<<<<<<<<
+ * if i < imax:
+ * next = ary[i + 1]
+ */
+ __pyx_v_cur = __pyx_v_next;
+
+ /* "fabio/ext/_cif.pyx":75
+ * prev = cur
+ * cur = next
+ * if i < imax: # <<<<<<<<<<<<<<
+ * next = ary[i + 1]
+ * else:
+ */
+ __pyx_t_6 = ((__pyx_v_i < __pyx_v_imax) != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":76
+ * cur = next
+ * if i < imax:
+ * next = ary[i + 1] # <<<<<<<<<<<<<<
+ * else:
+ * next = b"\n"
+ */
+ __pyx_t_7 = (__pyx_v_i + 1);
+ if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_ary.shape[0];
+ __pyx_v_next = (*((unsigned char *) ( /* dim=0 */ (__pyx_v_ary.data + __pyx_t_7 * __pyx_v_ary.strides[0]) )));
+ goto __pyx_L5;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/_cif.pyx":78
+ * next = ary[i + 1]
+ * else:
+ * next = b"\n" # <<<<<<<<<<<<<<
+ * go_on = False
+ * # print(i,chr(prev),chr(cur),chr(next),in_comment,in_single_quote,in_double_quote,multiline, start, cur ==SINGLE_QUOTE)
+ */
+ __pyx_v_next = '\n';
+
+ /* "fabio/ext/_cif.pyx":79
+ * else:
+ * next = b"\n"
+ * go_on = False # <<<<<<<<<<<<<<
+ * # print(i,chr(prev),chr(cur),chr(next),in_comment,in_single_quote,in_double_quote,multiline, start, cur ==SINGLE_QUOTE)
+ * # Skip comments
+ */
+ __pyx_v_go_on = 0;
+ }
+ __pyx_L5:;
+
+ /* "fabio/ext/_cif.pyx":82
+ * # print(i,chr(prev),chr(cur),chr(next),in_comment,in_single_quote,in_double_quote,multiline, start, cur ==SINGLE_QUOTE)
+ * # Skip comments
+ * if in_comment: # <<<<<<<<<<<<<<
+ * if cur in EOL:
+ * in_comment = False
+ */
+ __pyx_t_6 = (__pyx_v_in_comment != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":83
+ * # Skip comments
+ * if in_comment:
+ * if cur in EOL: # <<<<<<<<<<<<<<
+ * in_comment = False
+ * continue
+ */
+ __pyx_t_6 = ((__Pyx_BytesContains(__pyx_v_EOL, __pyx_v_cur)) != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":84
+ * if in_comment:
+ * if cur in EOL:
+ * in_comment = False # <<<<<<<<<<<<<<
+ * continue
+ *
+ */
+ __pyx_v_in_comment = 0;
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
+
+ /* "fabio/ext/_cif.pyx":85
+ * if cur in EOL:
+ * in_comment = False
+ * continue # <<<<<<<<<<<<<<
+ *
+ * if prev in EOL:
+ */
+ goto __pyx_L3_continue;
+ }
+
+ /* "fabio/ext/_cif.pyx":87
+ * continue
+ *
+ * if prev in EOL: # <<<<<<<<<<<<<<
+ * if cur == HASH:
+ * in_comment = True
+ */
+ __pyx_t_6 = ((__Pyx_BytesContains(__pyx_v_EOL, __pyx_v_prev)) != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":88
+ *
+ * if prev in EOL:
+ * if cur == HASH: # <<<<<<<<<<<<<<
+ * in_comment = True
+ * continue
+ */
+ __pyx_t_6 = ((__pyx_v_cur == __pyx_v_HASH) != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":89
+ * if prev in EOL:
+ * if cur == HASH:
+ * in_comment = True # <<<<<<<<<<<<<<
+ * continue
+ * if cur == SEMICOLUMN:
+ */
+ __pyx_v_in_comment = 1;
+
+ /* "fabio/ext/_cif.pyx":90
+ * if cur == HASH:
+ * in_comment = True
+ * continue # <<<<<<<<<<<<<<
+ * if cur == SEMICOLUMN:
+ * if multiline:
+ */
+ goto __pyx_L3_continue;
+ }
+
+ /* "fabio/ext/_cif.pyx":91
+ * in_comment = True
+ * continue
+ * if cur == SEMICOLUMN: # <<<<<<<<<<<<<<
+ * if multiline:
+ * fields.append(bytes_text[start:i].strip())
+ */
+ __pyx_t_6 = ((__pyx_v_cur == __pyx_v_SEMICOLUMN) != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":92
+ * continue
+ * if cur == SEMICOLUMN:
+ * if multiline: # <<<<<<<<<<<<<<
+ * fields.append(bytes_text[start:i].strip())
+ * start = -1
+ */
+ __pyx_t_6 = (__pyx_v_multiline != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":93
+ * if cur == SEMICOLUMN:
+ * if multiline:
+ * fields.append(bytes_text[start:i].strip()) # <<<<<<<<<<<<<<
+ * start = -1
+ * multiline = False
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_bytes_text, __pyx_v_start, __pyx_v_i, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
+ __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
+ if (likely(__pyx_t_1)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+ __Pyx_INCREF(__pyx_t_1);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_8, function);
+ }
+ }
+ if (__pyx_t_1) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else {
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_fields, __pyx_t_2); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "fabio/ext/_cif.pyx":94
+ * if multiline:
+ * fields.append(bytes_text[start:i].strip())
+ * start = -1 # <<<<<<<<<<<<<<
+ * multiline = False
+ * else:
+ */
+ __pyx_v_start = -1;
+
+ /* "fabio/ext/_cif.pyx":95
+ * fields.append(bytes_text[start:i].strip())
+ * start = -1
+ * multiline = False # <<<<<<<<<<<<<<
+ * else:
+ * multiline = True
+ */
+ __pyx_v_multiline = 0;
+ goto __pyx_L11;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/_cif.pyx":97
+ * multiline = False
+ * else:
+ * multiline = True # <<<<<<<<<<<<<<
+ * start = i + 1
+ * continue
+ */
+ __pyx_v_multiline = 1;
+
+ /* "fabio/ext/_cif.pyx":98
+ * else:
+ * multiline = True
+ * start = i + 1 # <<<<<<<<<<<<<<
+ * continue
+ *
+ */
+ __pyx_v_start = (__pyx_v_i + 1);
+ }
+ __pyx_L11:;
+
+ /* "fabio/ext/_cif.pyx":99
+ * multiline = True
+ * start = i + 1
+ * continue # <<<<<<<<<<<<<<
+ *
+ * if multiline:
+ */
+ goto __pyx_L3_continue;
+ }
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+
+ /* "fabio/ext/_cif.pyx":101
+ * continue
+ *
+ * if multiline: # <<<<<<<<<<<<<<
+ * # Handle CBF
+ * if cur == DASH:
+ */
+ __pyx_t_6 = (__pyx_v_multiline != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":103
+ * if multiline:
+ * # Handle CBF
+ * if cur == DASH: # <<<<<<<<<<<<<<
+ * if bytes_text[i:i + lbms] == BINARY_MARKER:
+ * end = bytes_text[i + lbms:].find(BINARY_MARKER)
+ */
+ __pyx_t_6 = ((__pyx_v_cur == __pyx_v_DASH) != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":104
+ * # Handle CBF
+ * if cur == DASH:
+ * if bytes_text[i:i + lbms] == BINARY_MARKER: # <<<<<<<<<<<<<<
+ * end = bytes_text[i + lbms:].find(BINARY_MARKER)
+ * i += end + 2 * lbms
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_bytes_text, __pyx_v_i, (__pyx_v_i + __pyx_v_lbms), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_v_BINARY_MARKER, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":105
+ * if cur == DASH:
+ * if bytes_text[i:i + lbms] == BINARY_MARKER:
+ * end = bytes_text[i + lbms:].find(BINARY_MARKER) # <<<<<<<<<<<<<<
+ * i += end + 2 * lbms
+ * cur = ary[i]
+ */
+ __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_bytes_text, (__pyx_v_i + __pyx_v_lbms), 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_find); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_8 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_8)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_8);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ }
+ }
+ if (!__pyx_t_8) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_BINARY_MARKER); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ } else {
+ __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
+ __Pyx_INCREF(__pyx_v_BINARY_MARKER);
+ PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_BINARY_MARKER);
+ __Pyx_GIVEREF(__pyx_v_BINARY_MARKER);
+ __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 = 105; __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_t_11 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_end = __pyx_t_11;
+
+ /* "fabio/ext/_cif.pyx":106
+ * if bytes_text[i:i + lbms] == BINARY_MARKER:
+ * end = bytes_text[i + lbms:].find(BINARY_MARKER)
+ * i += end + 2 * lbms # <<<<<<<<<<<<<<
+ * cur = ary[i]
+ * next = ary[i + 1]
+ */
+ __pyx_v_i = (__pyx_v_i + (__pyx_v_end + (2 * __pyx_v_lbms)));
+
+ /* "fabio/ext/_cif.pyx":107
+ * end = bytes_text[i + lbms:].find(BINARY_MARKER)
+ * i += end + 2 * lbms
+ * cur = ary[i] # <<<<<<<<<<<<<<
+ * next = ary[i + 1]
+ * continue
+ */
+ __pyx_t_11 = __pyx_v_i;
+ if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_v_ary.shape[0];
+ __pyx_v_cur = (*((unsigned char *) ( /* dim=0 */ (__pyx_v_ary.data + __pyx_t_11 * __pyx_v_ary.strides[0]) )));
+
+ /* "fabio/ext/_cif.pyx":108
+ * i += end + 2 * lbms
+ * cur = ary[i]
+ * next = ary[i + 1] # <<<<<<<<<<<<<<
+ * continue
+ *
+ */
+ __pyx_t_12 = (__pyx_v_i + 1);
+ if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_ary.shape[0];
+ __pyx_v_next = (*((unsigned char *) ( /* dim=0 */ (__pyx_v_ary.data + __pyx_t_12 * __pyx_v_ary.strides[0]) )));
+ goto __pyx_L14;
+ }
+ __pyx_L14:;
+ goto __pyx_L13;
+ }
+ __pyx_L13:;
+
+ /* "fabio/ext/_cif.pyx":109
+ * cur = ary[i]
+ * next = ary[i + 1]
+ * continue # <<<<<<<<<<<<<<
+ *
+ * # Handle single quote
+ */
+ goto __pyx_L3_continue;
+ }
+
+ /* "fabio/ext/_cif.pyx":112
+ *
+ * # Handle single quote
+ * if cur == SINGLE_QUOTE: # <<<<<<<<<<<<<<
+ * if (not in_single_quote) and (not in_double_quote) and (start < 0) and (prev in BLANK):
+ * start = i + 1
+ */
+ __pyx_t_6 = ((__pyx_v_cur == __pyx_v_SINGLE_QUOTE) != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":113
+ * # Handle single quote
+ * if cur == SINGLE_QUOTE:
+ * if (not in_single_quote) and (not in_double_quote) and (start < 0) and (prev in BLANK): # <<<<<<<<<<<<<<
+ * start = i + 1
+ * in_single_quote = True
+ */
+ __pyx_t_13 = ((!(__pyx_v_in_single_quote != 0)) != 0);
+ if (__pyx_t_13) {
+ } else {
+ __pyx_t_6 = __pyx_t_13;
+ goto __pyx_L17_bool_binop_done;
+ }
+ __pyx_t_13 = ((!(__pyx_v_in_double_quote != 0)) != 0);
+ if (__pyx_t_13) {
+ } else {
+ __pyx_t_6 = __pyx_t_13;
+ goto __pyx_L17_bool_binop_done;
+ }
+ __pyx_t_13 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_13) {
+ } else {
+ __pyx_t_6 = __pyx_t_13;
+ goto __pyx_L17_bool_binop_done;
+ }
+ __pyx_t_13 = ((__Pyx_BytesContains(__pyx_v_BLANK, __pyx_v_prev)) != 0);
+ __pyx_t_6 = __pyx_t_13;
+ __pyx_L17_bool_binop_done:;
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":114
+ * if cur == SINGLE_QUOTE:
+ * if (not in_single_quote) and (not in_double_quote) and (start < 0) and (prev in BLANK):
+ * start = i + 1 # <<<<<<<<<<<<<<
+ * in_single_quote = True
+ * continue
+ */
+ __pyx_v_start = (__pyx_v_i + 1);
+
+ /* "fabio/ext/_cif.pyx":115
+ * if (not in_single_quote) and (not in_double_quote) and (start < 0) and (prev in BLANK):
+ * start = i + 1
+ * in_single_quote = True # <<<<<<<<<<<<<<
+ * continue
+ * if (in_single_quote) and (not in_double_quote) and (start >= 0) and (next in BLANK):
+ */
+ __pyx_v_in_single_quote = 1;
+
+ /* "fabio/ext/_cif.pyx":116
+ * start = i + 1
+ * in_single_quote = True
+ * continue # <<<<<<<<<<<<<<
+ * if (in_single_quote) and (not in_double_quote) and (start >= 0) and (next in BLANK):
+ * fields.append(bytes_text[start:i].strip())
+ */
+ goto __pyx_L3_continue;
+ }
+
+ /* "fabio/ext/_cif.pyx":117
+ * in_single_quote = True
+ * continue
+ * if (in_single_quote) and (not in_double_quote) and (start >= 0) and (next in BLANK): # <<<<<<<<<<<<<<
+ * fields.append(bytes_text[start:i].strip())
+ * start = -1
+ */
+ __pyx_t_13 = (__pyx_v_in_single_quote != 0);
+ if (__pyx_t_13) {
+ } else {
+ __pyx_t_6 = __pyx_t_13;
+ goto __pyx_L22_bool_binop_done;
+ }
+ __pyx_t_13 = ((!(__pyx_v_in_double_quote != 0)) != 0);
+ if (__pyx_t_13) {
+ } else {
+ __pyx_t_6 = __pyx_t_13;
+ goto __pyx_L22_bool_binop_done;
+ }
+ __pyx_t_13 = ((__pyx_v_start >= 0) != 0);
+ if (__pyx_t_13) {
+ } else {
+ __pyx_t_6 = __pyx_t_13;
+ goto __pyx_L22_bool_binop_done;
+ }
+ __pyx_t_13 = ((__Pyx_BytesContains(__pyx_v_BLANK, __pyx_v_next)) != 0);
+ __pyx_t_6 = __pyx_t_13;
+ __pyx_L22_bool_binop_done:;
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":118
+ * continue
+ * if (in_single_quote) and (not in_double_quote) and (start >= 0) and (next in BLANK):
+ * fields.append(bytes_text[start:i].strip()) # <<<<<<<<<<<<<<
+ * start = -1
+ * in_single_quote = False
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_bytes_text, __pyx_v_start, __pyx_v_i, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_strip); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
+ __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
+ if (likely(__pyx_t_1)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
+ __Pyx_INCREF(__pyx_t_1);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_10, function);
+ }
+ }
+ if (__pyx_t_1) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else {
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_fields, __pyx_t_2); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "fabio/ext/_cif.pyx":119
+ * if (in_single_quote) and (not in_double_quote) and (start >= 0) and (next in BLANK):
+ * fields.append(bytes_text[start:i].strip())
+ * start = -1 # <<<<<<<<<<<<<<
+ * in_single_quote = False
+ * continue
+ */
+ __pyx_v_start = -1;
+
+ /* "fabio/ext/_cif.pyx":120
+ * fields.append(bytes_text[start:i].strip())
+ * start = -1
+ * in_single_quote = False # <<<<<<<<<<<<<<
+ * continue
+ * if in_single_quote:
+ */
+ __pyx_v_in_single_quote = 0;
+
+ /* "fabio/ext/_cif.pyx":121
+ * start = -1
+ * in_single_quote = False
+ * continue # <<<<<<<<<<<<<<
+ * if in_single_quote:
+ * continue
+ */
+ goto __pyx_L3_continue;
+ }
+ goto __pyx_L15;
+ }
+ __pyx_L15:;
+
+ /* "fabio/ext/_cif.pyx":122
+ * in_single_quote = False
+ * continue
+ * if in_single_quote: # <<<<<<<<<<<<<<
+ * continue
+ *
+ */
+ __pyx_t_6 = (__pyx_v_in_single_quote != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":123
+ * continue
+ * if in_single_quote:
+ * continue # <<<<<<<<<<<<<<
+ *
+ * # Handle double quote
+ */
+ goto __pyx_L3_continue;
+ }
+
+ /* "fabio/ext/_cif.pyx":126
+ *
+ * # Handle double quote
+ * if cur == DOUBLE_QUOTE: # <<<<<<<<<<<<<<
+ * if (not in_single_quote) and (not in_double_quote) and (start < 0) and (prev in BLANK):
+ * start = i + 1
+ */
+ __pyx_t_6 = ((__pyx_v_cur == __pyx_v_DOUBLE_QUOTE) != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":127
+ * # Handle double quote
+ * if cur == DOUBLE_QUOTE:
+ * if (not in_single_quote) and (not in_double_quote) and (start < 0) and (prev in BLANK): # <<<<<<<<<<<<<<
+ * start = i + 1
+ * in_double_quote = True
+ */
+ __pyx_t_13 = ((!(__pyx_v_in_single_quote != 0)) != 0);
+ if (__pyx_t_13) {
+ } else {
+ __pyx_t_6 = __pyx_t_13;
+ goto __pyx_L29_bool_binop_done;
+ }
+ __pyx_t_13 = ((!(__pyx_v_in_double_quote != 0)) != 0);
+ if (__pyx_t_13) {
+ } else {
+ __pyx_t_6 = __pyx_t_13;
+ goto __pyx_L29_bool_binop_done;
+ }
+ __pyx_t_13 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_13) {
+ } else {
+ __pyx_t_6 = __pyx_t_13;
+ goto __pyx_L29_bool_binop_done;
+ }
+ __pyx_t_13 = ((__Pyx_BytesContains(__pyx_v_BLANK, __pyx_v_prev)) != 0);
+ __pyx_t_6 = __pyx_t_13;
+ __pyx_L29_bool_binop_done:;
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":128
+ * if cur == DOUBLE_QUOTE:
+ * if (not in_single_quote) and (not in_double_quote) and (start < 0) and (prev in BLANK):
+ * start = i + 1 # <<<<<<<<<<<<<<
+ * in_double_quote = True
+ * continue
+ */
+ __pyx_v_start = (__pyx_v_i + 1);
+
+ /* "fabio/ext/_cif.pyx":129
+ * if (not in_single_quote) and (not in_double_quote) and (start < 0) and (prev in BLANK):
+ * start = i + 1
+ * in_double_quote = True # <<<<<<<<<<<<<<
+ * continue
+ * if (not in_single_quote) and (in_double_quote) and (start >= 0) and (next in BLANK):
+ */
+ __pyx_v_in_double_quote = 1;
+
+ /* "fabio/ext/_cif.pyx":130
+ * start = i + 1
+ * in_double_quote = True
+ * continue # <<<<<<<<<<<<<<
+ * if (not in_single_quote) and (in_double_quote) and (start >= 0) and (next in BLANK):
+ * fields.append(bytes_text[start:i].strip())
+ */
+ goto __pyx_L3_continue;
+ }
+
+ /* "fabio/ext/_cif.pyx":131
+ * in_double_quote = True
+ * continue
+ * if (not in_single_quote) and (in_double_quote) and (start >= 0) and (next in BLANK): # <<<<<<<<<<<<<<
+ * fields.append(bytes_text[start:i].strip())
+ * start = -1
+ */
+ __pyx_t_13 = ((!(__pyx_v_in_single_quote != 0)) != 0);
+ if (__pyx_t_13) {
+ } else {
+ __pyx_t_6 = __pyx_t_13;
+ goto __pyx_L34_bool_binop_done;
+ }
+ __pyx_t_13 = (__pyx_v_in_double_quote != 0);
+ if (__pyx_t_13) {
+ } else {
+ __pyx_t_6 = __pyx_t_13;
+ goto __pyx_L34_bool_binop_done;
+ }
+ __pyx_t_13 = ((__pyx_v_start >= 0) != 0);
+ if (__pyx_t_13) {
+ } else {
+ __pyx_t_6 = __pyx_t_13;
+ goto __pyx_L34_bool_binop_done;
+ }
+ __pyx_t_13 = ((__Pyx_BytesContains(__pyx_v_BLANK, __pyx_v_next)) != 0);
+ __pyx_t_6 = __pyx_t_13;
+ __pyx_L34_bool_binop_done:;
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":132
+ * continue
+ * if (not in_single_quote) and (in_double_quote) and (start >= 0) and (next in BLANK):
+ * fields.append(bytes_text[start:i].strip()) # <<<<<<<<<<<<<<
+ * start = -1
+ * in_double_quote = False
+ */
+ __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_v_bytes_text, __pyx_v_start, __pyx_v_i, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_strip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_10)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_10);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ }
+ }
+ if (__pyx_t_10) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ } else {
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_fields, __pyx_t_2); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "fabio/ext/_cif.pyx":133
+ * if (not in_single_quote) and (in_double_quote) and (start >= 0) and (next in BLANK):
+ * fields.append(bytes_text[start:i].strip())
+ * start = -1 # <<<<<<<<<<<<<<
+ * in_double_quote = False
+ * continue
+ */
+ __pyx_v_start = -1;
+
+ /* "fabio/ext/_cif.pyx":134
+ * fields.append(bytes_text[start:i].strip())
+ * start = -1
+ * in_double_quote = False # <<<<<<<<<<<<<<
+ * continue
+ * if in_double_quote:
+ */
+ __pyx_v_in_double_quote = 0;
+
+ /* "fabio/ext/_cif.pyx":135
+ * start = -1
+ * in_double_quote = False
+ * continue # <<<<<<<<<<<<<<
+ * if in_double_quote:
+ * continue
+ */
+ goto __pyx_L3_continue;
+ }
+ goto __pyx_L27;
+ }
+ __pyx_L27:;
+
+ /* "fabio/ext/_cif.pyx":136
+ * in_double_quote = False
+ * continue
+ * if in_double_quote: # <<<<<<<<<<<<<<
+ * continue
+ *
+ */
+ __pyx_t_6 = (__pyx_v_in_double_quote != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":137
+ * continue
+ * if in_double_quote:
+ * continue # <<<<<<<<<<<<<<
+ *
+ * # Normal fields
+ */
+ goto __pyx_L3_continue;
+ }
+
+ /* "fabio/ext/_cif.pyx":140
+ *
+ * # Normal fields
+ * if cur in BLANK: # <<<<<<<<<<<<<<
+ * if start >= 0:
+ * fields.append(bytes_text[start:i].strip())
+ */
+ __pyx_t_6 = ((__Pyx_BytesContains(__pyx_v_BLANK, __pyx_v_cur)) != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":141
+ * # Normal fields
+ * if cur in BLANK:
+ * if start >= 0: # <<<<<<<<<<<<<<
+ * fields.append(bytes_text[start:i].strip())
+ * start = -1
+ */
+ __pyx_t_6 = ((__pyx_v_start >= 0) != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":142
+ * if cur in BLANK:
+ * if start >= 0:
+ * fields.append(bytes_text[start:i].strip()) # <<<<<<<<<<<<<<
+ * start = -1
+ * else:
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_bytes_text, __pyx_v_start, __pyx_v_i, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_strip); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
+ __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
+ if (likely(__pyx_t_1)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
+ __Pyx_INCREF(__pyx_t_1);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_10, function);
+ }
+ }
+ if (__pyx_t_1) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else {
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_fields, __pyx_t_2); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "fabio/ext/_cif.pyx":143
+ * if start >= 0:
+ * fields.append(bytes_text[start:i].strip())
+ * start = -1 # <<<<<<<<<<<<<<
+ * else:
+ * if start < 0:
+ */
+ __pyx_v_start = -1;
+ goto __pyx_L40;
+ }
+ __pyx_L40:;
+ goto __pyx_L39;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/_cif.pyx":145
+ * start = -1
+ * else:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = i
+ * if start >= 0:
+ */
+ __pyx_t_6 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":146
+ * else:
+ * if start < 0:
+ * start = i # <<<<<<<<<<<<<<
+ * if start >= 0:
+ * fields.append(bytes_text[start:].strip())
+ */
+ __pyx_v_start = __pyx_v_i;
+ goto __pyx_L41;
+ }
+ __pyx_L41:;
+ }
+ __pyx_L39:;
+ __pyx_L3_continue:;
+ }
+
+ /* "fabio/ext/_cif.pyx":147
+ * if start < 0:
+ * start = i
+ * if start >= 0: # <<<<<<<<<<<<<<
+ * fields.append(bytes_text[start:].strip())
+ * return fields
+ */
+ __pyx_t_6 = ((__pyx_v_start >= 0) != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/_cif.pyx":148
+ * start = i
+ * if start >= 0:
+ * fields.append(bytes_text[start:].strip()) # <<<<<<<<<<<<<<
+ * return fields
+ */
+ __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_v_bytes_text, __pyx_v_start, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_strip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_10)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_10);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ }
+ }
+ if (__pyx_t_10) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ } else {
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_fields, __pyx_t_2); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ goto __pyx_L42;
+ }
+ __pyx_L42:;
+
+ /* "fabio/ext/_cif.pyx":149
+ * if start >= 0:
+ * fields.append(bytes_text[start:].strip())
+ * return fields # <<<<<<<<<<<<<<
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_fields);
+ __pyx_r = __pyx_v_fields;
+ goto __pyx_L0;
+
+ /* "fabio/ext/_cif.pyx":42
+ *
+ * @cython.boundscheck(False)
+ * def split_tokens(bytes_text): # <<<<<<<<<<<<<<
+ * """
+ * Separate the text representing a CIF file into a list of tokens.
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_AddTraceback("fabio.ext._cif.split_tokens", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_ary, 1);
+ __Pyx_XDECREF(__pyx_v_EOL);
+ __Pyx_XDECREF(__pyx_v_BLANK);
+ __Pyx_XDECREF(__pyx_v_BINARY_MARKER);
+ __Pyx_XDECREF(__pyx_v_fields);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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) {
+ int __pyx_r;
+ __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;
+}
+
+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;
+ int __pyx_v_ndim;
+ int __pyx_v_endian_detector;
+ int __pyx_v_little_endian;
+ int __pyx_v_t;
+ char *__pyx_v_f;
+ PyArray_Descr *__pyx_v_descr = 0;
+ int __pyx_v_offset;
+ int __pyx_v_hasfields;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ char *__pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ if (__pyx_v_info != NULL) {
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_info->obj);
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
+ *
+ * cdef int copy_shape, i, ndim
+ * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ *
+ */
+ __pyx_v_endian_detector = 1;
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ *
+ * ndim = PyArray_NDIM(self)
+ */
+ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ *
+ * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
+ *
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
+ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
+
+ /* "../../../usr/lib/python2.7/dist-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))) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209
+ *
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * copy_shape = 1 # <<<<<<<<<<<<<<
+ * else:
+ * copy_shape = 0
+ */
+ __pyx_v_copy_shape = 1;
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
+ * copy_shape = 1
+ * else:
+ * copy_shape = 0 # <<<<<<<<<<<<<<
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ */
+ __pyx_v_copy_shape = 0;
+ }
+ __pyx_L4:;
+
+ /* "../../../usr/lib/python2.7/dist-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_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/lib/python2.7/dist-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) != 0)) != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L6_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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) {
+
+ /* "../../../usr/lib/python2.7/dist-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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
+ * raise ValueError(u"ndarray is not Fortran contiguous")
+ *
+ * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
+ * info.ndim = ndim
+ * if copy_shape:
+ */
+ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
+ *
+ * info.buf = PyArray_DATA(self)
+ * info.ndim = ndim # <<<<<<<<<<<<<<
+ * if copy_shape:
+ * # Allocate new buffer for strides and shape info.
+ */
+ __pyx_v_info->ndim = __pyx_v_ndim;
+
+ /* "../../../usr/lib/python2.7/dist-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.
+ */
+ __pyx_t_1 = (__pyx_v_copy_shape != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ * info.shape = info.strides + ndim
+ * for i in range(ndim):
+ */
+ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
+
+ /* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i]
+ */
+ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229
+ * info.shape = info.strides + ndim
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ * else:
+ */
+ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
+
+ /* "../../../usr/lib/python2.7/dist-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] # <<<<<<<<<<<<<<
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ */
+ (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
+ }
+ goto __pyx_L11;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ * info.suboffsets = NULL
+ */
+ __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ */
+ __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
+ }
+ __pyx_L11:;
+
+ /* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ * info.readonly = not PyArray_ISWRITEABLE(self)
+ */
+ __pyx_v_info->suboffsets = NULL;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
+ * info.readonly = not PyArray_ISWRITEABLE(self)
+ *
+ */
+ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
+
+ /* "../../../usr/lib/python2.7/dist-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) != 0));
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
+ *
+ * cdef int t
+ * cdef char* f = NULL # <<<<<<<<<<<<<<
+ * cdef dtype descr = self.descr
+ * cdef list stack
+ */
+ __pyx_v_f = NULL;
+
+ /* "../../../usr/lib/python2.7/dist-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_3 = ((PyObject *)__pyx_v_self->descr);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":244
+ * cdef int offset
+ *
+ * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
+ *
+ * if not hasfields and not copy_shape:
+ */
+ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
+
+ /* "../../../usr/lib/python2.7/dist-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 != 0)) != 0);
+ if (__pyx_t_2) {
+ } 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) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
+ * if not hasfields and not copy_shape:
+ * # do not call releasebuffer
+ * info.obj = None # <<<<<<<<<<<<<<
+ * else:
+ * # need to call releasebuffer
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = Py_None;
+ goto __pyx_L14;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251
+ * else:
+ * # need to call releasebuffer
+ * info.obj = self # <<<<<<<<<<<<<<
+ *
+ * if not hasfields:
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
+ }
+ __pyx_L14:;
+
+ /* "../../../usr/lib/python2.7/dist-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 != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-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_4 = __pyx_v_descr->type_num;
+ __pyx_v_t = __pyx_t_4;
+
+ /* "../../../usr/lib/python2.7/dist-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_2 = ((__pyx_v_descr->byteorder == '>') != 0);
+ if (!__pyx_t_2) {
+ goto __pyx_L20_next_or;
+ } else {
+ }
+ __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:;
+
+ /* "../../../usr/lib/python2.7/dist-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_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) {
+
+ /* "../../../usr/lib/python2.7/dist-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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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/lib/python2.7/dist-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"
+ */
+ case NPY_BYTE:
+ __pyx_v_f = __pyx_k_b;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_UBYTE:
+ __pyx_v_f = __pyx_k_B;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_SHORT:
+ __pyx_v_f = __pyx_k_h;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_USHORT:
+ __pyx_v_f = __pyx_k_H;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_INT:
+ __pyx_v_f = __pyx_k_i;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_UINT:
+ __pyx_v_f = __pyx_k_I;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_LONG:
+ __pyx_v_f = __pyx_k_l;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_ULONG:
+ __pyx_v_f = __pyx_k_L;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_LONGLONG:
+ __pyx_v_f = __pyx_k_q;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_ULONGLONG:
+ __pyx_v_f = __pyx_k_Q;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_FLOAT:
+ __pyx_v_f = __pyx_k_f;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_DOUBLE:
+ __pyx_v_f = __pyx_k_d;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_LONGDOUBLE:
+ __pyx_v_f = __pyx_k_g;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_CFLOAT:
+ __pyx_v_f = __pyx_k_Zf;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_CDOUBLE:
+ __pyx_v_f = __pyx_k_Zd;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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:
+ */
+ case NPY_CLONGDOUBLE:
+ __pyx_v_f = __pyx_k_Zg;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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)
+ */
+ case NPY_OBJECT:
+ __pyx_v_f = __pyx_k_O;
+ break;
+ default:
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * info.format = f # <<<<<<<<<<<<<<
+ * return
+ * else:
+ */
+ __pyx_v_info->format = __pyx_v_f;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * info.format = f
+ * return # <<<<<<<<<<<<<<
+ * else:
+ * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
+ * return
+ * else:
+ * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
+ * info.format[0] = c'^' # Native data types, manual alignment
+ * offset = 0
+ */
+ __pyx_v_info->format = ((char *)malloc(255));
+
+ /* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * offset = 0
+ * f = _util_dtypestring(descr, info.format + 1,
+ */
+ (__pyx_v_info->format[0]) = '^';
+
+ /* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * f = _util_dtypestring(descr, info.format + 1,
+ * info.format + _buffer_format_string_len,
+ */
+ __pyx_v_offset = 0;
+
+ /* "../../../usr/lib/python2.7/dist-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)
+ */
+ __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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286
+ * info.format + _buffer_format_string_len,
+ * &offset)
+ * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ */
+ (__pyx_v_f[0]) = '\x00';
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
+ }
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
+ __Pyx_GOTREF(Py_None);
+ __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
+ }
+ __pyx_L2:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_descr);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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();
+}
+
+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);
+
+ /* "../../../usr/lib/python2.7/dist-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) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self):
+ * stdlib.free(info.format) # <<<<<<<<<<<<<<
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * stdlib.free(info.strides)
+ */
+ free(__pyx_v_info->format);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "../../../usr/lib/python2.7/dist-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))) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292
+ * 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
+ *
+ */
+ free(__pyx_v_info->strides);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "../../../usr/lib/python2.7/dist-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();
+}
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
+ * ctypedef npy_cdouble complex_t
+ *
+ * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(1, <void*>a)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":769
+ *
+ * cdef inline object PyArray_MultiIterNew1(a):
+ * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":772
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b):
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ *
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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.
+ */
+
+static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
+ PyArray_Descr *__pyx_v_child = 0;
+ int __pyx_v_endian_detector;
+ int __pyx_v_little_endian;
+ PyObject *__pyx_v_fields = 0;
+ PyObject *__pyx_v_childname = NULL;
+ PyObject *__pyx_v_new_offset = NULL;
+ PyObject *__pyx_v_t = NULL;
+ char *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ 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);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790
+ * cdef int delta_offset
+ * cdef tuple i
+ * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ * cdef tuple fields
+ */
+ __pyx_v_endian_detector = 1;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791
+ * cdef tuple i
+ * cdef int endian_detector = 1
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
+ * cdef tuple fields
+ *
+ */
+ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
+
+ /* "../../../usr/lib/python2.7/dist-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(__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 = __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
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #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_SET(__pyx_v_childname, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "../../../usr/lib/python2.7/dist-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 (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 %.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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":796
+ * for childname in descr.names:
+ * fields = descr.fields[childname]
+ * child, new_offset = fields # <<<<<<<<<<<<<<
+ *
+ * if (end - f) - <int>(new_offset - offset[0]) < 15:
+ */
+ 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
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ #else
+ __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __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 {
+ __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ 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_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
+ __pyx_t_3 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":798
+ * child, new_offset = fields
+ *
+ * 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 = __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 = 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_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_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
+ if (__pyx_t_6) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
+ *
+ * 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_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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 == '>') != 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_6 = __pyx_t_7;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_L8_next_or:;
+
+ /* "../../../usr/lib/python2.7/dist-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 == '<') != 0);
+ if (__pyx_t_7) {
+ } else {
+ __pyx_t_6 = __pyx_t_7;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
+ __pyx_t_6 = __pyx_t_7;
+ __pyx_L7_bool_binop_done:;
+ if (__pyx_t_6) {
+
+ /* "../../../usr/lib/python2.7/dist-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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
+ *
+ * # Output padding bytes
+ * while offset[0] < new_offset: # <<<<<<<<<<<<<<
+ * f[0] = 120 # "x"; pad byte
+ * f += 1
+ */
+ while (1) {
+ __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;
+ __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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":814
+ * # Output padding bytes
+ * while offset[0] < new_offset:
+ * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
+ * f += 1
+ * offset[0] += 1
+ */
+ (__pyx_v_f[0]) = 120;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815
+ * while offset[0] < new_offset:
+ * f[0] = 120 # "x"; pad byte
+ * f += 1 # <<<<<<<<<<<<<<
+ * offset[0] += 1
+ *
+ */
+ __pyx_v_f = (__pyx_v_f + 1);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
+ * f[0] = 120 # "x"; pad byte
+ * f += 1
+ * offset[0] += 1 # <<<<<<<<<<<<<<
+ *
+ * offset[0] += child.itemsize
+ */
+ __pyx_t_8 = 0;
+ (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818
+ * offset[0] += 1
+ *
+ * offset[0] += child.itemsize # <<<<<<<<<<<<<<
+ *
+ * if not PyDataType_HASFIELDS(child):
+ */
+ __pyx_t_8 = 0;
+ (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
+
+ /* "../../../usr/lib/python2.7/dist-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_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
+ if (__pyx_t_6) {
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+
+ /* "../../../usr/lib/python2.7/dist-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_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
+ if (__pyx_t_6) {
+
+ /* "../../../usr/lib/python2.7/dist-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_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 98;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 104;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 105;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 108;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 113;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 102;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 103;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 90;
+ (__pyx_v_f[1]) = 100;
+ __pyx_v_f = (__pyx_v_f + 1);
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 79;
+ goto __pyx_L15;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-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_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);
+ __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_L15:;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * f += 1 # <<<<<<<<<<<<<<
+ * else:
+ * # Cython ignores struct boundary information ("T{...}"),
+ */
+ __pyx_v_f = (__pyx_v_f + 1);
+ goto __pyx_L13;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-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_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_L13:;
+
+ /* "../../../usr/lib/python2.7/dist-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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850
+ * # so don't output it
+ * f = _util_dtypestring(child, f, end, offset)
+ * return f # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_f;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_child);
+ __Pyx_XDECREF(__pyx_v_fields);
+ __Pyx_XDECREF(__pyx_v_childname);
+ __Pyx_XDECREF(__pyx_v_new_offset);
+ __Pyx_XDECREF(__pyx_v_t);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
+ *
+ *
+ * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
+ * cdef PyObject* baseptr
+ * if base is None:
+ */
+
+static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
+ PyObject *__pyx_v_baseptr;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ __Pyx_RefNannySetupContext("set_array_base", 0);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968
+ * cdef inline void set_array_base(ndarray arr, object base):
+ * cdef PyObject* baseptr
+ * if base is None: # <<<<<<<<<<<<<<
+ * baseptr = NULL
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_base == Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
+ * cdef PyObject* baseptr
+ * if base is None:
+ * baseptr = NULL # <<<<<<<<<<<<<<
+ * else:
+ * Py_INCREF(base) # important to do this before decref below!
+ */
+ __pyx_v_baseptr = NULL;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971
+ * baseptr = NULL
+ * else:
+ * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base)
+ */
+ Py_INCREF(__pyx_v_base);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972
+ * else:
+ * Py_INCREF(base) # important to do this before decref below!
+ * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
+ * Py_XDECREF(arr.base)
+ * arr.base = baseptr
+ */
+ __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
+ }
+ __pyx_L3:;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973
+ * Py_INCREF(base) # important to do this before decref below!
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
+ * arr.base = baseptr
+ *
+ */
+ Py_XDECREF(__pyx_v_arr->base);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base)
+ * arr.base = baseptr # <<<<<<<<<<<<<<
+ *
+ * cdef inline object get_array_base(ndarray arr):
+ */
+ __pyx_v_arr->base = __pyx_v_baseptr;
+
+ /* "../../../usr/lib/python2.7/dist-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();
+}
+
+/* "../../../usr/lib/python2.7/dist-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
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("get_array_base", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":978
+ * cdef inline object get_array_base(ndarray arr):
+ * if arr.base is NULL:
+ * return None # <<<<<<<<<<<<<<
+ * else:
+ * return <object>arr.base
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(Py_None);
+ __pyx_r = Py_None;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
+ * return None
+ * else:
+ * return <object>arr.base # <<<<<<<<<<<<<<
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
+ __pyx_r = ((PyObject *)__pyx_v_arr->base);
+ goto __pyx_L0;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":116
+ * cdef bint dtype_is_object
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
+ * mode="c", bint allocate_buffer=True):
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_shape = 0;
+ Py_ssize_t __pyx_v_itemsize;
+ PyObject *__pyx_v_format = 0;
+ PyObject *__pyx_v_mode = 0;
+ int __pyx_v_allocate_buffer;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
+ PyObject* values[5] = {0,0,0,0,0};
+ values[3] = ((PyObject *)__pyx_n_s_c);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 3:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode);
+ if (value) { values[3] = value; kw_args--; }
+ }
+ case 4:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer);
+ if (value) { values[4] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_shape = ((PyObject*)values[0]);
+ __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_format = values[2];
+ __pyx_v_mode = values[3];
+ if (values[4]) {
+ __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+
+ /* "View.MemoryView":117
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
+ * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
+ *
+ * cdef int idx
+ */
+ __pyx_v_allocate_buffer = ((int)1);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_r = __pyx_array_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
+
+ /* "View.MemoryView":116
+ * cdef bint dtype_is_object
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
+ * mode="c", bint allocate_buffer=True):
+ *
+ */
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
+ int __pyx_v_idx;
+ Py_ssize_t __pyx_v_i;
+ Py_ssize_t __pyx_v_dim;
+ PyObject **__pyx_v_p;
+ char __pyx_v_order;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ char *__pyx_t_5;
+ int __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ Py_ssize_t __pyx_t_8;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__cinit__", 0);
+ __Pyx_INCREF(__pyx_v_format);
+
+ /* "View.MemoryView":123
+ * cdef PyObject **p
+ *
+ * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
+ * self.itemsize = itemsize
+ *
+ */
+ if (unlikely(__pyx_v_shape == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_self->ndim = ((int)__pyx_t_1);
+
+ /* "View.MemoryView":124
+ *
+ * self.ndim = <int> len(shape)
+ * self.itemsize = itemsize # <<<<<<<<<<<<<<
+ *
+ * if not self.ndim:
+ */
+ __pyx_v_self->itemsize = __pyx_v_itemsize;
+
+ /* "View.MemoryView":126
+ * self.itemsize = itemsize
+ *
+ * if not self.ndim: # <<<<<<<<<<<<<<
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":127
+ *
+ * if not self.ndim:
+ * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if itemsize <= 0:
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __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[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":129
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":130
+ *
+ * if itemsize <= 0:
+ * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if isinstance(format, unicode):
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __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[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":132
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ * if isinstance(format, unicode): # <<<<<<<<<<<<<<
+ * format = (<unicode>format).encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ */
+ __pyx_t_2 = PyUnicode_Check(__pyx_v_format);
+ __pyx_t_4 = (__pyx_t_2 != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":133
+ *
+ * if isinstance(format, unicode):
+ * format = (<unicode>format).encode('ASCII') # <<<<<<<<<<<<<<
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format
+ */
+ if (unlikely(__pyx_v_format == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "encode");
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_3 = PyUnicode_AsASCIIString(((PyObject*)__pyx_v_format)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
+ __pyx_t_3 = 0;
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":134
+ * if isinstance(format, unicode):
+ * format = (<unicode>format).encode('ASCII')
+ * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
+ * self.format = self._format
+ *
+ */
+ if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_v_format;
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_v_self->_format);
+ __Pyx_DECREF(__pyx_v_self->_format);
+ __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":135
+ * format = (<unicode>format).encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_self->format = __pyx_t_5;
+
+ /* "View.MemoryView":138
+ *
+ *
+ * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
+ * self._strides = self._shape + self.ndim
+ *
+ */
+ __pyx_v_self->_shape = ((Py_ssize_t *)PyMem_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
+
+ /* "View.MemoryView":139
+ *
+ * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
+ * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
+ *
+ * if not self._shape:
+ */
+ __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
+
+ /* "View.MemoryView":141
+ * self._strides = self._shape + self.ndim
+ *
+ * if not self._shape: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate shape and strides.")
+ *
+ */
+ __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":142
+ *
+ * if not self._shape:
+ * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __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[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":145
+ *
+ *
+ * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ */
+ __pyx_t_6 = 0;
+ __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
+ for (;;) {
+ if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_v_dim = __pyx_t_8;
+ __pyx_v_idx = __pyx_t_6;
+ __pyx_t_6 = (__pyx_t_6 + 1);
+
+ /* "View.MemoryView":146
+ *
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim
+ */
+ __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":147
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
+ * self._shape[idx] = dim
+ *
+ */
+ __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_9);
+ __pyx_t_7 = 0;
+ __pyx_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __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_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_Raise(__pyx_t_9, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":148
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim # <<<<<<<<<<<<<<
+ *
+ * cdef char order
+ */
+ (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
+
+ /* "View.MemoryView":145
+ *
+ *
+ * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ */
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "View.MemoryView":151
+ *
+ * cdef char order
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
+ * order = b'F'
+ * self.mode = u'fortran'
+ */
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":152
+ * cdef char order
+ * if mode == 'fortran':
+ * order = b'F' # <<<<<<<<<<<<<<
+ * self.mode = u'fortran'
+ * elif mode == 'c':
+ */
+ __pyx_v_order = 'F';
+
+ /* "View.MemoryView":153
+ * if mode == 'fortran':
+ * order = b'F'
+ * self.mode = u'fortran' # <<<<<<<<<<<<<<
+ * elif mode == 'c':
+ * order = b'C'
+ */
+ __Pyx_INCREF(__pyx_n_u_fortran);
+ __Pyx_GIVEREF(__pyx_n_u_fortran);
+ __Pyx_GOTREF(__pyx_v_self->mode);
+ __Pyx_DECREF(__pyx_v_self->mode);
+ __pyx_v_self->mode = __pyx_n_u_fortran;
+ goto __pyx_L10;
+ }
+
+ /* "View.MemoryView":154
+ * order = b'F'
+ * self.mode = u'fortran'
+ * elif mode == 'c': # <<<<<<<<<<<<<<
+ * order = b'C'
+ * self.mode = u'c'
+ */
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":155
+ * self.mode = u'fortran'
+ * elif mode == 'c':
+ * order = b'C' # <<<<<<<<<<<<<<
+ * self.mode = u'c'
+ * else:
+ */
+ __pyx_v_order = 'C';
+
+ /* "View.MemoryView":156
+ * elif mode == 'c':
+ * order = b'C'
+ * self.mode = u'c' # <<<<<<<<<<<<<<
+ * else:
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
+ */
+ __Pyx_INCREF(__pyx_n_u_c);
+ __Pyx_GIVEREF(__pyx_n_u_c);
+ __Pyx_GOTREF(__pyx_v_self->mode);
+ __Pyx_DECREF(__pyx_v_self->mode);
+ __pyx_v_self->mode = __pyx_n_u_c;
+ goto __pyx_L10;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":158
+ * self.mode = u'c'
+ * else:
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
+ *
+ * self.len = fill_contig_strides_array(self._shape, self._strides,
+ */
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L10:;
+
+ /* "View.MemoryView":160
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
+ *
+ * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
+ * itemsize, self.ndim, order)
+ *
+ */
+ __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
+
+ /* "View.MemoryView":163
+ * itemsize, self.ndim, order)
+ *
+ * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer:
+ */
+ __pyx_v_self->free_data = __pyx_v_allocate_buffer;
+
+ /* "View.MemoryView":164
+ *
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
+ * if allocate_buffer:
+ *
+ */
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_self->dtype_is_object = __pyx_t_4;
+
+ /* "View.MemoryView":165
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer: # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":168
+ *
+ *
+ * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
+ * if not self.data:
+ * raise MemoryError("unable to allocate array data.")
+ */
+ __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
+
+ /* "View.MemoryView":169
+ *
+ * self.data = <char *>malloc(self.len)
+ * if not self.data: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate array data.")
+ *
+ */
+ __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":170
+ * self.data = <char *>malloc(self.len)
+ * if not self.data:
+ * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
+ *
+ * if self.dtype_is_object:
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __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[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":172
+ * raise MemoryError("unable to allocate array data.")
+ *
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ */
+ __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":173
+ *
+ * if self.dtype_is_object:
+ * p = <PyObject **> self.data # <<<<<<<<<<<<<<
+ * for i in range(self.len / itemsize):
+ * p[i] = Py_None
+ */
+ __pyx_v_p = ((PyObject **)__pyx_v_self->data);
+
+ /* "View.MemoryView":174
+ * if self.dtype_is_object:
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
+ * p[i] = Py_None
+ * Py_INCREF(Py_None)
+ */
+ if (unlikely(__pyx_v_itemsize == 0)) {
+ #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[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
+ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
+ __pyx_v_i = __pyx_t_8;
+
+ /* "View.MemoryView":175
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ * p[i] = Py_None # <<<<<<<<<<<<<<
+ * Py_INCREF(Py_None)
+ *
+ */
+ (__pyx_v_p[__pyx_v_i]) = Py_None;
+
+ /* "View.MemoryView":176
+ * for i in range(self.len / itemsize):
+ * p[i] = Py_None
+ * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
+ *
+ * @cname('getbuffer')
+ */
+ Py_INCREF(Py_None);
+ }
+ goto __pyx_L13;
+ }
+ __pyx_L13:;
+ goto __pyx_L11;
+ }
+ __pyx_L11:;
+
+ /* "View.MemoryView":116
+ * cdef bint dtype_is_object
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
+ * mode="c", bint allocate_buffer=True):
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_format);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":179
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * cdef int bufmode = -1
+ * if self.mode == u"c":
+ */
+
+/* Python wrapper */
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
+ __pyx_r = __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_v_bufmode;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ char *__pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+ int __pyx_t_6;
+ Py_ssize_t *__pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ if (__pyx_v_info != NULL) {
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_info->obj);
+ }
+
+ /* "View.MemoryView":180
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * cdef int bufmode = -1 # <<<<<<<<<<<<<<
+ * if self.mode == u"c":
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ */
+ __pyx_v_bufmode = -1;
+
+ /* "View.MemoryView":181
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * cdef int bufmode = -1
+ * if self.mode == u"c": # <<<<<<<<<<<<<<
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran":
+ */
+ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":182
+ * cdef int bufmode = -1
+ * if self.mode == u"c":
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
+ * elif self.mode == u"fortran":
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ */
+ __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":183
+ * if self.mode == u"c":
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode):
+ */
+ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":184
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran":
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ */
+ __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":185
+ * elif self.mode == u"fortran":
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode): # <<<<<<<<<<<<<<
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ * info.buf = self.data
+ */
+ __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":186
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
+ * info.buf = self.data
+ * info.len = self.len
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __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[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":187
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ * info.buf = self.data # <<<<<<<<<<<<<<
+ * info.len = self.len
+ * info.ndim = self.ndim
+ */
+ __pyx_t_4 = __pyx_v_self->data;
+ __pyx_v_info->buf = __pyx_t_4;
+
+ /* "View.MemoryView":188
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ * info.buf = self.data
+ * info.len = self.len # <<<<<<<<<<<<<<
+ * info.ndim = self.ndim
+ * info.shape = self._shape
+ */
+ __pyx_t_5 = __pyx_v_self->len;
+ __pyx_v_info->len = __pyx_t_5;
+
+ /* "View.MemoryView":189
+ * info.buf = self.data
+ * info.len = self.len
+ * info.ndim = self.ndim # <<<<<<<<<<<<<<
+ * info.shape = self._shape
+ * info.strides = self._strides
+ */
+ __pyx_t_6 = __pyx_v_self->ndim;
+ __pyx_v_info->ndim = __pyx_t_6;
+
+ /* "View.MemoryView":190
+ * info.len = self.len
+ * info.ndim = self.ndim
+ * info.shape = self._shape # <<<<<<<<<<<<<<
+ * info.strides = self._strides
+ * info.suboffsets = NULL
+ */
+ __pyx_t_7 = __pyx_v_self->_shape;
+ __pyx_v_info->shape = __pyx_t_7;
+
+ /* "View.MemoryView":191
+ * info.ndim = self.ndim
+ * info.shape = self._shape
+ * info.strides = self._strides # <<<<<<<<<<<<<<
+ * info.suboffsets = NULL
+ * info.itemsize = self.itemsize
+ */
+ __pyx_t_7 = __pyx_v_self->_strides;
+ __pyx_v_info->strides = __pyx_t_7;
+
+ /* "View.MemoryView":192
+ * info.shape = self._shape
+ * info.strides = self._strides
+ * info.suboffsets = NULL # <<<<<<<<<<<<<<
+ * info.itemsize = self.itemsize
+ * info.readonly = 0
+ */
+ __pyx_v_info->suboffsets = NULL;
+
+ /* "View.MemoryView":193
+ * info.strides = self._strides
+ * info.suboffsets = NULL
+ * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
+ * info.readonly = 0
+ *
+ */
+ __pyx_t_5 = __pyx_v_self->itemsize;
+ __pyx_v_info->itemsize = __pyx_t_5;
+
+ /* "View.MemoryView":194
+ * info.suboffsets = NULL
+ * info.itemsize = self.itemsize
+ * info.readonly = 0 # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_FORMAT:
+ */
+ __pyx_v_info->readonly = 0;
+
+ /* "View.MemoryView":196
+ * info.readonly = 0
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.format
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":197
+ *
+ * if flags & PyBUF_FORMAT:
+ * info.format = self.format # <<<<<<<<<<<<<<
+ * else:
+ * info.format = NULL
+ */
+ __pyx_t_4 = __pyx_v_self->format;
+ __pyx_v_info->format = __pyx_t_4;
+ goto __pyx_L5;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":199
+ * info.format = self.format
+ * else:
+ * info.format = NULL # <<<<<<<<<<<<<<
+ *
+ * info.obj = self
+ */
+ __pyx_v_info->format = NULL;
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":201
+ * info.format = NULL
+ *
+ * info.obj = self # <<<<<<<<<<<<<<
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
+
+ /* "View.MemoryView":179
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * cdef int bufmode = -1
+ * if self.mode == u"c":
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
+ }
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
+ __Pyx_GOTREF(Py_None);
+ __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
+ }
+ __pyx_L2:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":205
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
+ *
+ * def __dealloc__(array self): # <<<<<<<<<<<<<<
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data)
+ */
+
+/* Python wrapper */
+static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_array_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "View.MemoryView":206
+ *
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ */
+ __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":207
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
+ * elif self.free_data:
+ * if self.dtype_is_object:
+ */
+ __pyx_v_self->callback_free_data(__pyx_v_self->data);
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":208
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data)
+ * elif self.free_data: # <<<<<<<<<<<<<<
+ * if self.dtype_is_object:
+ * refcount_objects_in_slice(self.data, self._shape,
+ */
+ __pyx_t_1 = (__pyx_v_self->free_data != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":209
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice(self.data, self._shape,
+ * self._strides, self.ndim, False)
+ */
+ __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":210
+ * elif self.free_data:
+ * if self.dtype_is_object:
+ * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
+ * self._strides, self.ndim, False)
+ * free(self.data)
+ */
+ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":212
+ * refcount_objects_in_slice(self.data, self._shape,
+ * self._strides, self.ndim, False)
+ * free(self.data) # <<<<<<<<<<<<<<
+ * PyMem_Free(self._shape)
+ *
+ */
+ free(__pyx_v_self->data);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":213
+ * self._strides, self.ndim, False)
+ * free(self.data)
+ * PyMem_Free(self._shape) # <<<<<<<<<<<<<<
+ *
+ * property memview:
+ */
+ PyMem_Free(__pyx_v_self->_shape);
+
+ /* "View.MemoryView":205
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
+ *
+ * def __dealloc__(array self): # <<<<<<<<<<<<<<
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data)
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":217
+ * property memview:
+ * @cname('get_memview')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ *
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ */
+
+/* Python wrapper */
+static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/
+static PyObject *get_memview(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = get_memview_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+ int __pyx_v_flags;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":219
+ * def __get__(self):
+ *
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
+ * return memoryview(self, flags, self.dtype_is_object)
+ *
+ */
+ __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
+
+ /* "View.MemoryView":220
+ *
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":217
+ * property memview:
+ * @cname('get_memview')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ *
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":223
+ *
+ *
+ * def __getattr__(self, attr): # <<<<<<<<<<<<<<
+ * return getattr(self.memview, attr)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
+static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
+ __pyx_r = __pyx_array_MemoryView_5array_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getattr__", 0);
+
+ /* "View.MemoryView":224
+ *
+ * def __getattr__(self, attr):
+ * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
+ *
+ * def __getitem__(self, item):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":223
+ *
+ *
+ * def __getattr__(self, attr): # <<<<<<<<<<<<<<
+ * return getattr(self.memview, attr)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":226
+ * return getattr(self.memview, attr)
+ *
+ * def __getitem__(self, item): # <<<<<<<<<<<<<<
+ * return self.memview[item]
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
+ __pyx_r = __pyx_array_MemoryView_5array_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getitem__", 0);
+
+ /* "View.MemoryView":227
+ *
+ * def __getitem__(self, item):
+ * return self.memview[item] # <<<<<<<<<<<<<<
+ *
+ * def __setitem__(self, item, value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":226
+ * return getattr(self.memview, attr)
+ *
+ * def __getitem__(self, item): # <<<<<<<<<<<<<<
+ * return self.memview[item]
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":229
+ * return self.memview[item]
+ *
+ * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
+ * self.memview[item] = value
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
+ __pyx_r = __pyx_array_MemoryView_5array_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__setitem__", 0);
+
+ /* "View.MemoryView":230
+ *
+ * def __setitem__(self, item, value):
+ * self.memview[item] = value # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "View.MemoryView":229
+ * return self.memview[item]
+ *
+ * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
+ * self.memview[item] = value
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":234
+ *
+ * @cname("__pyx_array_new")
+ * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
+ * char *mode, char *buf):
+ * cdef array result
+ */
+
+static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
+ struct __pyx_array_obj *__pyx_v_result = 0;
+ struct __pyx_array_obj *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("array_cwrapper", 0);
+
+ /* "View.MemoryView":238
+ * cdef array result
+ *
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":239
+ *
+ * if buf == NULL:
+ * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
+ */
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
+ __Pyx_GIVEREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 0;
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
+ __pyx_t_4 = 0;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":241
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
+ * allocate_buffer=False)
+ * result.data = buf
+ */
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __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[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
+ __Pyx_GIVEREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_4 = 0;
+ __pyx_t_5 = 0;
+ __pyx_t_3 = 0;
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+
+ /* "View.MemoryView":242
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
+ * allocate_buffer=False) # <<<<<<<<<<<<<<
+ * result.data = buf
+ *
+ */
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":241
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
+ * allocate_buffer=False)
+ * result.data = buf
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":243
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
+ * allocate_buffer=False)
+ * result.data = buf # <<<<<<<<<<<<<<
+ *
+ * return result
+ */
+ __pyx_v_result->data = __pyx_v_buf;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":245
+ * result.data = buf
+ *
+ * return result # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":234
+ *
+ * @cname("__pyx_array_new")
+ * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
+ * char *mode, char *buf):
+ * cdef array result
+ */
+
+ /* 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);
+ __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF((PyObject *)__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":271
+ * cdef class Enum(object):
+ * cdef object name
+ * def __init__(self, name): # <<<<<<<<<<<<<<
+ * self.name = name
+ * def __repr__(self):
+ */
+
+/* Python wrapper */
+static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_name = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
+ PyObject* values[1] = {0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ }
+ __pyx_v_name = values[0];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__", 0);
+
+ /* "View.MemoryView":272
+ * cdef object name
+ * def __init__(self, name):
+ * self.name = name # <<<<<<<<<<<<<<
+ * def __repr__(self):
+ * return self.name
+ */
+ __Pyx_INCREF(__pyx_v_name);
+ __Pyx_GIVEREF(__pyx_v_name);
+ __Pyx_GOTREF(__pyx_v_self->name);
+ __Pyx_DECREF(__pyx_v_self->name);
+ __pyx_v_self->name = __pyx_v_name;
+
+ /* "View.MemoryView":271
+ * cdef class Enum(object):
+ * cdef object name
+ * def __init__(self, name): # <<<<<<<<<<<<<<
+ * self.name = name
+ * def __repr__(self):
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":273
+ * def __init__(self, name):
+ * self.name = name
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return self.name
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+ __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__repr__", 0);
+
+ /* "View.MemoryView":274
+ * self.name = name
+ * def __repr__(self):
+ * return self.name # <<<<<<<<<<<<<<
+ *
+ * cdef generic = Enum("<strided and direct or indirect>")
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->name);
+ __pyx_r = __pyx_v_self->name;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":273
+ * def __init__(self, name):
+ * self.name = name
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return self.name
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":288
+ *
+ * @cname('__pyx_align_pointer')
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
+ * "Align pointer memory on a given boundary"
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
+ */
+
+static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
+ Py_intptr_t __pyx_v_aligned_p;
+ size_t __pyx_v_offset;
+ void *__pyx_r;
+ int __pyx_t_1;
+
+ /* "View.MemoryView":290
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil:
+ * "Align pointer memory on a given boundary"
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
+ * cdef size_t offset
+ *
+ */
+ __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
+
+ /* "View.MemoryView":294
+ *
+ * with cython.cdivision(True):
+ * offset = aligned_p % alignment # <<<<<<<<<<<<<<
+ *
+ * if offset > 0:
+ */
+ __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
+
+ /* "View.MemoryView":296
+ * offset = aligned_p % alignment
+ *
+ * if offset > 0: # <<<<<<<<<<<<<<
+ * aligned_p += alignment - offset
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":297
+ *
+ * if offset > 0:
+ * aligned_p += alignment - offset # <<<<<<<<<<<<<<
+ *
+ * return <void *> aligned_p
+ */
+ __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":299
+ * aligned_p += alignment - offset
+ *
+ * return <void *> aligned_p # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview')
+ */
+ __pyx_r = ((void *)__pyx_v_aligned_p);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":288
+ *
+ * @cname('__pyx_align_pointer')
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
+ * "Align pointer memory on a given boundary"
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":317
+ * cdef __Pyx_TypeInfo *typeinfo
+ *
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
+ * self.obj = obj
+ * self.flags = flags
+ */
+
+/* Python wrapper */
+static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_obj = 0;
+ int __pyx_v_flags;
+ int __pyx_v_dtype_is_object;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object);
+ if (value) { values[2] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_obj = values[0];
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (values[2]) {
+ __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+ __pyx_v_dtype_is_object = ((int)0);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__cinit__", 0);
+
+ /* "View.MemoryView":318
+ *
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
+ * self.obj = obj # <<<<<<<<<<<<<<
+ * self.flags = flags
+ * if type(self) is memoryview or obj is not None:
+ */
+ __Pyx_INCREF(__pyx_v_obj);
+ __Pyx_GIVEREF(__pyx_v_obj);
+ __Pyx_GOTREF(__pyx_v_self->obj);
+ __Pyx_DECREF(__pyx_v_self->obj);
+ __pyx_v_self->obj = __pyx_v_obj;
+
+ /* "View.MemoryView":319
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
+ * self.obj = obj
+ * self.flags = flags # <<<<<<<<<<<<<<
+ * if type(self) is memoryview or obj is not None:
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ */
+ __pyx_v_self->flags = __pyx_v_flags;
+
+ /* "View.MemoryView":320
+ * self.obj = obj
+ * self.flags = flags
+ * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL:
+ */
+ __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)((PyObject *)__pyx_memoryview_type)));
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (!__pyx_t_3) {
+ } else {
+ __pyx_t_1 = __pyx_t_3;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_3 = (__pyx_v_obj != Py_None);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L4_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":321
+ * self.flags = flags
+ * if type(self) is memoryview or obj is not None:
+ * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
+ * if <PyObject *> self.view.obj == NULL:
+ * (<__pyx_buffer *> &self.view).obj = Py_None
+ */
+ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":322
+ * if type(self) is memoryview or obj is not None:
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
+ * (<__pyx_buffer *> &self.view).obj = Py_None
+ * Py_INCREF(Py_None)
+ */
+ __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":323
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL:
+ * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
+ * Py_INCREF(Py_None)
+ *
+ */
+ ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
+
+ /* "View.MemoryView":324
+ * if <PyObject *> self.view.obj == NULL:
+ * (<__pyx_buffer *> &self.view).obj = Py_None
+ * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
+ *
+ * self.lock = PyThread_allocate_lock()
+ */
+ Py_INCREF(Py_None);
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":326
+ * Py_INCREF(Py_None)
+ *
+ * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
+ * if self.lock == NULL:
+ * raise MemoryError
+ */
+ __pyx_v_self->lock = PyThread_allocate_lock();
+
+ /* "View.MemoryView":327
+ *
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":328
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock == NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_FORMAT:
+ */
+ PyErr_NoMemory(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":330
+ * raise MemoryError
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * self.dtype_is_object = self.view.format == b'O'
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":331
+ *
+ * if flags & PyBUF_FORMAT:
+ * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<<
+ * else:
+ * self.dtype_is_object = dtype_is_object
+ */
+ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_v_self->dtype_is_object = __pyx_t_1;
+ goto __pyx_L8;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":333
+ * self.dtype_is_object = self.view.format == b'O'
+ * else:
+ * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
+ *
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
+ */
+ __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
+ }
+ __pyx_L8:;
+
+ /* "View.MemoryView":335
+ * self.dtype_is_object = dtype_is_object
+ *
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
+ * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
+ * self.typeinfo = NULL
+ */
+ __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
+
+ /* "View.MemoryView":337
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
+ * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
+ * self.typeinfo = NULL # <<<<<<<<<<<<<<
+ *
+ * def __dealloc__(memoryview self):
+ */
+ __pyx_v_self->typeinfo = NULL;
+
+ /* "View.MemoryView":317
+ * cdef __Pyx_TypeInfo *typeinfo
+ *
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
+ * self.obj = obj
+ * self.flags = flags
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":339
+ * self.typeinfo = NULL
+ *
+ * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
+ * if self.obj is not None:
+ * __Pyx_ReleaseBuffer(&self.view)
+ */
+
+/* Python wrapper */
+static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "View.MemoryView":340
+ *
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None: # <<<<<<<<<<<<<<
+ * __Pyx_ReleaseBuffer(&self.view)
+ *
+ */
+ __pyx_t_1 = (__pyx_v_self->obj != Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":341
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None:
+ * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
+ *
+ * if self.lock != NULL:
+ */
+ __Pyx_ReleaseBuffer((&__pyx_v_self->view));
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":343
+ * __Pyx_ReleaseBuffer(&self.view)
+ *
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
+ * PyThread_free_lock(self.lock)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":344
+ *
+ * if self.lock != NULL:
+ * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
+ *
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL:
+ */
+ PyThread_free_lock(__pyx_v_self->lock);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":339
+ * self.typeinfo = NULL
+ *
+ * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
+ * if self.obj is not None:
+ * __Pyx_ReleaseBuffer(&self.view)
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":346
+ * PyThread_free_lock(self.lock)
+ *
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dim
+ * cdef char *itemp = <char *> self.view.buf
+ */
+
+static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
+ Py_ssize_t __pyx_v_dim;
+ char *__pyx_v_itemp;
+ PyObject *__pyx_v_idx = NULL;
+ char *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ Py_ssize_t __pyx_t_3;
+ PyObject *(*__pyx_t_4)(PyObject *);
+ PyObject *__pyx_t_5 = NULL;
+ Py_ssize_t __pyx_t_6;
+ char *__pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("get_item_pointer", 0);
+
+ /* "View.MemoryView":348
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL:
+ * cdef Py_ssize_t dim
+ * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
+ *
+ * for dim, idx in enumerate(index):
+ */
+ __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
+
+ /* "View.MemoryView":350
+ * cdef char *itemp = <char *> self.view.buf
+ *
+ * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
+ *
+ */
+ __pyx_t_1 = 0;
+ if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
+ __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
+ __pyx_t_4 = NULL;
+ } else {
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ for (;;) {
+ if (likely(!__pyx_t_4)) {
+ if (likely(PyList_CheckExact(__pyx_t_2))) {
+ if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else {
+ if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ }
+ } else {
+ __pyx_t_5 = __pyx_t_4(__pyx_t_2);
+ if (unlikely(!__pyx_t_5)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_5);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_v_dim = __pyx_t_1;
+ __pyx_t_1 = (__pyx_t_1 + 1);
+
+ /* "View.MemoryView":351
+ *
+ * for dim, idx in enumerate(index):
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
+ *
+ * return itemp
+ */
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_itemp = __pyx_t_7;
+
+ /* "View.MemoryView":350
+ * cdef char *itemp = <char *> self.view.buf
+ *
+ * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
+ *
+ */
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":353
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
+ *
+ * return itemp # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_itemp;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":346
+ * PyThread_free_lock(self.lock)
+ *
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dim
+ * cdef char *itemp = <char *> self.view.buf
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_idx);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":356
+ *
+ *
+ * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
+ * if index is Ellipsis:
+ * return self
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
+static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
+ PyObject *__pyx_v_have_slices = NULL;
+ PyObject *__pyx_v_indices = NULL;
+ char *__pyx_v_itemp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getitem__", 0);
+
+ /* "View.MemoryView":357
+ *
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
+ __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":358
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis:
+ * return self # <<<<<<<<<<<<<<
+ *
+ * have_slices, indices = _unellipsify(index, self.view.ndim)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __pyx_r = ((PyObject *)__pyx_v_self);
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":360
+ * return self
+ *
+ * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * cdef char *itemp
+ */
+ __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (likely(__pyx_t_3 != Py_None)) {
+ PyObject* sequence = __pyx_t_3;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ Py_ssize_t size = Py_SIZE(sequence);
+ #else
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ #else
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ #endif
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else {
+ __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_v_have_slices = __pyx_t_4;
+ __pyx_t_4 = 0;
+ __pyx_v_indices = __pyx_t_5;
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":363
+ *
+ * cdef char *itemp
+ * if have_slices: # <<<<<<<<<<<<<<
+ * return memview_slice(self, indices)
+ * else:
+ */
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":364
+ * cdef char *itemp
+ * if have_slices:
+ * return memview_slice(self, indices) # <<<<<<<<<<<<<<
+ * else:
+ * itemp = self.get_item_pointer(indices)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":366
+ * return memview_slice(self, indices)
+ * else:
+ * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
+ * return self.convert_item_to_object(itemp)
+ *
+ */
+ __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_itemp = __pyx_t_6;
+
+ /* "View.MemoryView":367
+ * else:
+ * itemp = self.get_item_pointer(indices)
+ * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
+ *
+ * def __setitem__(memoryview self, object index, object value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":356
+ *
+ *
+ * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
+ * if index is Ellipsis:
+ * return self
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_have_slices);
+ __Pyx_XDECREF(__pyx_v_indices);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":369
+ * return self.convert_item_to_object(itemp)
+ *
+ * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
+ PyObject *__pyx_v_have_slices = NULL;
+ PyObject *__pyx_v_obj = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__setitem__", 0);
+ __Pyx_INCREF(__pyx_v_index);
+
+ /* "View.MemoryView":370
+ *
+ * def __setitem__(memoryview self, object index, object value):
+ * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * if have_slices:
+ */
+ __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (likely(__pyx_t_1 != Py_None)) {
+ PyObject* sequence = __pyx_t_1;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ Py_ssize_t size = Py_SIZE(sequence);
+ #else
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_3);
+ #else
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ #endif
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else {
+ __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_v_have_slices = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":372
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ * if have_slices: # <<<<<<<<<<<<<<
+ * obj = self.is_slice(value)
+ * if obj:
+ */
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":373
+ *
+ * if have_slices:
+ * obj = self.is_slice(value) # <<<<<<<<<<<<<<
+ * if obj:
+ * self.setitem_slice_assignment(self[index], obj)
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_obj = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":374
+ * if have_slices:
+ * obj = self.is_slice(value)
+ * if obj: # <<<<<<<<<<<<<<
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ */
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":375
+ * obj = self.is_slice(value)
+ * if obj:
+ * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
+ * else:
+ * self.setitem_slice_assign_scalar(self[index], value)
+ */
+ __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":377
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
+ * else:
+ * self.setitem_indexed(index, value)
+ */
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_3);
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
+ __pyx_L4:;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":379
+ * self.setitem_slice_assign_scalar(self[index], value)
+ * else:
+ * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
+ *
+ * cdef is_slice(self, obj):
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":369
+ * return self.convert_item_to_object(itemp)
+ *
+ * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_have_slices);
+ __Pyx_XDECREF(__pyx_v_obj);
+ __Pyx_XDECREF(__pyx_v_index);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":381
+ * self.setitem_indexed(index, value)
+ *
+ * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
+ * if not isinstance(obj, memoryview):
+ * try:
+ */
+
+static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ int __pyx_t_9;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("is_slice", 0);
+ __Pyx_INCREF(__pyx_v_obj);
+
+ /* "View.MemoryView":382
+ *
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, ((PyObject *)__pyx_memoryview_type));
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":383
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ {
+ __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_5);
+ /*try:*/ {
+
+ /* "View.MemoryView":384
+ * if not isinstance(obj, memoryview):
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
+ * self.dtype_is_object)
+ * except TypeError:
+ */
+ __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "View.MemoryView":385
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object) # <<<<<<<<<<<<<<
+ * except TypeError:
+ * return None
+ */
+ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "View.MemoryView":384
+ * if not isinstance(obj, memoryview):
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
+ * self.dtype_is_object)
+ * except TypeError:
+ */
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_INCREF(__pyx_v_obj);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
+ __Pyx_GIVEREF(__pyx_v_obj);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_6 = 0;
+ __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
+ __pyx_t_7 = 0;
+ }
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ goto __pyx_L11_try_end;
+ __pyx_L4_error:;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "View.MemoryView":386
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ * except TypeError: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
+ __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ if (__pyx_t_9) {
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "View.MemoryView":387
+ * self.dtype_is_object)
+ * except TypeError:
+ * return None # <<<<<<<<<<<<<<
+ *
+ * return obj
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(Py_None);
+ __pyx_r = Py_None;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ goto __pyx_L7_except_return;
+ }
+ goto __pyx_L6_except_error;
+ __pyx_L6_except_error:;
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+ goto __pyx_L1_error;
+ __pyx_L7_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+ goto __pyx_L0;
+ __pyx_L11_try_end:;
+ }
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":389
+ * return None
+ *
+ * return obj # <<<<<<<<<<<<<<
+ *
+ * cdef setitem_slice_assignment(self, dst, src):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_obj);
+ __pyx_r = __pyx_v_obj;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":381
+ * self.setitem_indexed(index, value)
+ *
+ * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
+ * if not isinstance(obj, memoryview):
+ * try:
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_obj);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":391
+ * return obj
+ *
+ * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice dst_slice
+ * cdef __Pyx_memviewslice src_slice
+ */
+
+static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
+ __Pyx_memviewslice __pyx_v_dst_slice;
+ __Pyx_memviewslice __pyx_v_src_slice;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
+
+ /* "View.MemoryView":395
+ * cdef __Pyx_memviewslice src_slice
+ *
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
+ * get_slice_from_memview(dst, &dst_slice)[0],
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ */
+ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":396
+ *
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
+ * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ *
+ */
+ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":397
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
+ * get_slice_from_memview(dst, &dst_slice)[0],
+ * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "View.MemoryView":395
+ * cdef __Pyx_memviewslice src_slice
+ *
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
+ * get_slice_from_memview(dst, &dst_slice)[0],
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ */
+ __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":391
+ * return obj
+ *
+ * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice dst_slice
+ * cdef __Pyx_memviewslice src_slice
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":399
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ *
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
+ * cdef int array[128]
+ * cdef void *tmp = NULL
+ */
+
+static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
+ int __pyx_v_array[128];
+ void *__pyx_v_tmp;
+ void *__pyx_v_item;
+ __Pyx_memviewslice *__pyx_v_dst_slice;
+ __Pyx_memviewslice __pyx_v_tmp_slice;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ char const *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ PyObject *__pyx_t_11 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
+
+ /* "View.MemoryView":401
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
+ * cdef int array[128]
+ * cdef void *tmp = NULL # <<<<<<<<<<<<<<
+ * cdef void *item
+ *
+ */
+ __pyx_v_tmp = NULL;
+
+ /* "View.MemoryView":406
+ * cdef __Pyx_memviewslice *dst_slice
+ * cdef __Pyx_memviewslice tmp_slice
+ * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
+ *
+ * if <size_t>self.view.itemsize > sizeof(array):
+ */
+ __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
+
+ /* "View.MemoryView":408
+ * dst_slice = get_slice_from_memview(dst, &tmp_slice)
+ *
+ * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL:
+ */
+ __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":409
+ *
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
+ * if tmp == NULL:
+ * raise MemoryError
+ */
+ __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
+
+ /* "View.MemoryView":410
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ * item = tmp
+ */
+ __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":411
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
+ * item = tmp
+ * else:
+ */
+ PyErr_NoMemory(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":412
+ * if tmp == NULL:
+ * raise MemoryError
+ * item = tmp # <<<<<<<<<<<<<<
+ * else:
+ * item = <void *> array
+ */
+ __pyx_v_item = __pyx_v_tmp;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":414
+ * item = tmp
+ * else:
+ * item = <void *> array # <<<<<<<<<<<<<<
+ *
+ * try:
+ */
+ __pyx_v_item = ((void *)__pyx_v_array);
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":416
+ * item = <void *> array
+ *
+ * try: # <<<<<<<<<<<<<<
+ * if self.dtype_is_object:
+ * (<PyObject **> item)[0] = <PyObject *> value
+ */
+ /*try:*/ {
+
+ /* "View.MemoryView":417
+ *
+ * try:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":418
+ * try:
+ * if self.dtype_is_object:
+ * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
+ * else:
+ * self.assign_item_from_object(<char *> item, value)
+ */
+ (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
+ goto __pyx_L8;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":420
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ __pyx_L8:;
+
+ /* "View.MemoryView":424
+ *
+ *
+ * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":425
+ *
+ * if self.view.suboffsets != NULL:
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
+ * item, self.dtype_is_object)
+ */
+ __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ goto __pyx_L9;
+ }
+ __pyx_L9:;
+
+ /* "View.MemoryView":426
+ * if self.view.suboffsets != NULL:
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
+ * item, self.dtype_is_object)
+ * finally:
+ */
+ __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
+ }
+
+ /* "View.MemoryView":429
+ * item, self.dtype_is_object)
+ * finally:
+ * PyMem_Free(tmp) # <<<<<<<<<<<<<<
+ *
+ * cdef setitem_indexed(self, index, value):
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ PyMem_Free(__pyx_v_tmp);
+ goto __pyx_L7;
+ }
+ /*exception exit:*/{
+ __pyx_L6_error:;
+ __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+ if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
+ __Pyx_XGOTREF(__pyx_t_6);
+ __Pyx_XGOTREF(__pyx_t_7);
+ __Pyx_XGOTREF(__pyx_t_8);
+ __Pyx_XGOTREF(__pyx_t_9);
+ __Pyx_XGOTREF(__pyx_t_10);
+ __Pyx_XGOTREF(__pyx_t_11);
+ __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
+ {
+ PyMem_Free(__pyx_v_tmp);
+ }
+ if (PY_MAJOR_VERSION >= 3) {
+ __Pyx_XGIVEREF(__pyx_t_9);
+ __Pyx_XGIVEREF(__pyx_t_10);
+ __Pyx_XGIVEREF(__pyx_t_11);
+ __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+ }
+ __Pyx_XGIVEREF(__pyx_t_6);
+ __Pyx_XGIVEREF(__pyx_t_7);
+ __Pyx_XGIVEREF(__pyx_t_8);
+ __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+ __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
+ __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
+ goto __pyx_L1_error;
+ }
+ __pyx_L7:;
+ }
+
+ /* "View.MemoryView":399
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ *
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
+ * cdef int array[128]
+ * cdef void *tmp = NULL
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":431
+ * PyMem_Free(tmp)
+ *
+ * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
+ * cdef char *itemp = self.get_item_pointer(index)
+ * self.assign_item_from_object(itemp, value)
+ */
+
+static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
+ char *__pyx_v_itemp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ char *__pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("setitem_indexed", 0);
+
+ /* "View.MemoryView":432
+ *
+ * cdef setitem_indexed(self, index, value):
+ * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
+ * self.assign_item_from_object(itemp, value)
+ *
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_itemp = __pyx_t_1;
+
+ /* "View.MemoryView":433
+ * cdef setitem_indexed(self, index, value):
+ * cdef char *itemp = self.get_item_pointer(index)
+ * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ */
+ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":431
+ * PyMem_Free(tmp)
+ *
+ * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
+ * cdef char *itemp = self.get_item_pointer(index)
+ * self.assign_item_from_object(itemp, value)
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":435
+ * self.assign_item_from_object(itemp, value)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
+ PyObject *__pyx_v_struct = NULL;
+ PyObject *__pyx_v_bytesitem = 0;
+ PyObject *__pyx_v_result = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ Py_ssize_t __pyx_t_8;
+ PyObject *__pyx_t_9 = NULL;
+ size_t __pyx_t_10;
+ int __pyx_t_11;
+ int __pyx_t_12;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("convert_item_to_object", 0);
+
+ /* "View.MemoryView":438
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ * import struct # <<<<<<<<<<<<<<
+ * cdef bytes bytesitem
+ *
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_struct = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":441
+ * cdef bytes bytesitem
+ *
+ * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
+ * try:
+ * result = struct.unpack(self.view.format, bytesitem)
+ */
+ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":442
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ {
+ __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ /*try:*/ {
+
+ /* "View.MemoryView":443
+ * bytesitem = itemp[:self.view.itemsize]
+ * try:
+ * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
+ * except struct.error:
+ * raise ValueError("Unable to convert item to object")
+ */
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = NULL;
+ __pyx_t_8 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_7)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ __pyx_t_8 = 1;
+ }
+ }
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+ }
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_v_bytesitem);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
+ __Pyx_GIVEREF(__pyx_v_bytesitem);
+ __pyx_t_6 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_result = __pyx_t_1;
+ __pyx_t_1 = 0;
+ }
+ /*else:*/ {
+
+ /* "View.MemoryView":447
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
+ * return result[0]
+ * return result
+ */
+ __pyx_t_10 = strlen(__pyx_v_self->view.format);
+ __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
+ if (__pyx_t_11) {
+
+ /* "View.MemoryView":448
+ * else:
+ * if len(self.view.format) == 1:
+ * return result[0] # <<<<<<<<<<<<<<
+ * return result
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;};
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L6_except_return;
+ }
+
+ /* "View.MemoryView":449
+ * if len(self.view.format) == 1:
+ * return result[0]
+ * return result # <<<<<<<<<<<<<<
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_result);
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L6_except_return;
+ }
+ __pyx_L3_error:;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "View.MemoryView":444
+ * try:
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error: # <<<<<<<<<<<<<<
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_12 = PyErr_ExceptionMatches(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__pyx_t_12) {
+ __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_9);
+
+ /* "View.MemoryView":445
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
+ * else:
+ * if len(self.view.format) == 1:
+ */
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L1_error;
+ __pyx_L6_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":435
+ * self.assign_item_from_object(itemp, value)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_struct);
+ __Pyx_XDECREF(__pyx_v_bytesitem);
+ __Pyx_XDECREF(__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":451
+ * return result
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
+ PyObject *__pyx_v_struct = NULL;
+ char __pyx_v_c;
+ PyObject *__pyx_v_bytesvalue = 0;
+ Py_ssize_t __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ Py_ssize_t __pyx_t_7;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ char *__pyx_t_10;
+ char *__pyx_t_11;
+ char *__pyx_t_12;
+ char *__pyx_t_13;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("assign_item_from_object", 0);
+
+ /* "View.MemoryView":454
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ * import struct # <<<<<<<<<<<<<<
+ * cdef char c
+ * cdef bytes bytesvalue
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_struct = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":459
+ * cdef Py_ssize_t i
+ *
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ */
+ __pyx_t_2 = PyTuple_Check(__pyx_v_value);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "View.MemoryView":460
+ *
+ * if isinstance(value, tuple):
+ * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
+ * else:
+ * bytesvalue = struct.pack(self.view.format, value)
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __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_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
+ __pyx_t_4 = 0;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":462
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
+ *
+ * for i, c in enumerate(bytesvalue):
+ */
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = NULL;
+ __pyx_t_7 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ __pyx_t_7 = 1;
+ }
+ }
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ if (__pyx_t_5) {
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ }
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __pyx_t_1 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
+ __pyx_t_4 = 0;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":464
+ * bytesvalue = struct.pack(self.view.format, value)
+ *
+ * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
+ * itemp[i] = c
+ *
+ */
+ __pyx_t_7 = 0;
+ if (unlikely(__pyx_v_bytesvalue == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_INCREF(__pyx_v_bytesvalue);
+ __pyx_t_9 = __pyx_v_bytesvalue;
+ __pyx_t_11 = PyBytes_AS_STRING(__pyx_t_9);
+ __pyx_t_12 = (__pyx_t_11 + PyBytes_GET_SIZE(__pyx_t_9));
+ for (__pyx_t_13 = __pyx_t_11; __pyx_t_13 < __pyx_t_12; __pyx_t_13++) {
+ __pyx_t_10 = __pyx_t_13;
+ __pyx_v_c = (__pyx_t_10[0]);
+
+ /* "View.MemoryView":465
+ *
+ * for i, c in enumerate(bytesvalue):
+ * itemp[i] = c # <<<<<<<<<<<<<<
+ *
+ * @cname('getbuffer')
+ */
+ __pyx_v_i = __pyx_t_7;
+
+ /* "View.MemoryView":464
+ * bytesvalue = struct.pack(self.view.format, value)
+ *
+ * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
+ * itemp[i] = c
+ *
+ */
+ __pyx_t_7 = (__pyx_t_7 + 1);
+
+ /* "View.MemoryView":465
+ *
+ * for i, c in enumerate(bytesvalue):
+ * itemp[i] = c # <<<<<<<<<<<<<<
+ *
+ * @cname('getbuffer')
+ */
+ (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
+ }
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+ /* "View.MemoryView":451
+ * return result
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_struct);
+ __Pyx_XDECREF(__pyx_v_bytesvalue);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":468
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * if flags & PyBUF_STRIDES:
+ * info.shape = self.view.shape
+ */
+
+/* Python wrapper */
+static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ char *__pyx_t_3;
+ void *__pyx_t_4;
+ int __pyx_t_5;
+ Py_ssize_t __pyx_t_6;
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ if (__pyx_v_info != NULL) {
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_info->obj);
+ }
+
+ /* "View.MemoryView":469
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.shape = self.view.shape
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":470
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_STRIDES:
+ * info.shape = self.view.shape # <<<<<<<<<<<<<<
+ * else:
+ * info.shape = NULL
+ */
+ __pyx_t_2 = __pyx_v_self->view.shape;
+ __pyx_v_info->shape = __pyx_t_2;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":472
+ * info.shape = self.view.shape
+ * else:
+ * info.shape = NULL # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_STRIDES:
+ */
+ __pyx_v_info->shape = NULL;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":474
+ * info.shape = NULL
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.strides = self.view.strides
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":475
+ *
+ * if flags & PyBUF_STRIDES:
+ * info.strides = self.view.strides # <<<<<<<<<<<<<<
+ * else:
+ * info.strides = NULL
+ */
+ __pyx_t_2 = __pyx_v_self->view.strides;
+ __pyx_v_info->strides = __pyx_t_2;
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":477
+ * info.strides = self.view.strides
+ * else:
+ * info.strides = NULL # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_INDIRECT:
+ */
+ __pyx_v_info->strides = NULL;
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":479
+ * info.strides = NULL
+ *
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":480
+ *
+ * if flags & PyBUF_INDIRECT:
+ * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
+ * else:
+ * info.suboffsets = NULL
+ */
+ __pyx_t_2 = __pyx_v_self->view.suboffsets;
+ __pyx_v_info->suboffsets = __pyx_t_2;
+ goto __pyx_L5;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":482
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ * info.suboffsets = NULL # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_FORMAT:
+ */
+ __pyx_v_info->suboffsets = NULL;
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":484
+ * info.suboffsets = NULL
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.view.format
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":485
+ *
+ * if flags & PyBUF_FORMAT:
+ * info.format = self.view.format # <<<<<<<<<<<<<<
+ * else:
+ * info.format = NULL
+ */
+ __pyx_t_3 = __pyx_v_self->view.format;
+ __pyx_v_info->format = __pyx_t_3;
+ goto __pyx_L6;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":487
+ * info.format = self.view.format
+ * else:
+ * info.format = NULL # <<<<<<<<<<<<<<
+ *
+ * info.buf = self.view.buf
+ */
+ __pyx_v_info->format = NULL;
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":489
+ * info.format = NULL
+ *
+ * info.buf = self.view.buf # <<<<<<<<<<<<<<
+ * info.ndim = self.view.ndim
+ * info.itemsize = self.view.itemsize
+ */
+ __pyx_t_4 = __pyx_v_self->view.buf;
+ __pyx_v_info->buf = __pyx_t_4;
+
+ /* "View.MemoryView":490
+ *
+ * info.buf = self.view.buf
+ * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
+ * info.itemsize = self.view.itemsize
+ * info.len = self.view.len
+ */
+ __pyx_t_5 = __pyx_v_self->view.ndim;
+ __pyx_v_info->ndim = __pyx_t_5;
+
+ /* "View.MemoryView":491
+ * info.buf = self.view.buf
+ * info.ndim = self.view.ndim
+ * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
+ * info.len = self.view.len
+ * info.readonly = 0
+ */
+ __pyx_t_6 = __pyx_v_self->view.itemsize;
+ __pyx_v_info->itemsize = __pyx_t_6;
+
+ /* "View.MemoryView":492
+ * info.ndim = self.view.ndim
+ * info.itemsize = self.view.itemsize
+ * info.len = self.view.len # <<<<<<<<<<<<<<
+ * info.readonly = 0
+ * info.obj = self
+ */
+ __pyx_t_6 = __pyx_v_self->view.len;
+ __pyx_v_info->len = __pyx_t_6;
+
+ /* "View.MemoryView":493
+ * info.itemsize = self.view.itemsize
+ * info.len = self.view.len
+ * info.readonly = 0 # <<<<<<<<<<<<<<
+ * info.obj = self
+ *
+ */
+ __pyx_v_info->readonly = 0;
+
+ /* "View.MemoryView":494
+ * info.len = self.view.len
+ * info.readonly = 0
+ * info.obj = self # <<<<<<<<<<<<<<
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
+
+ /* "View.MemoryView":468
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * if flags & PyBUF_STRIDES:
+ * info.shape = self.view.shape
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
+ __Pyx_GOTREF(Py_None);
+ __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
+ }
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":501
+ * property T:
+ * @cname('__pyx_memoryview_transpose')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":502
+ * @cname('__pyx_memoryview_transpose')
+ * def __get__(self):
+ * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
+ * transpose_memslice(&result.from_slice)
+ * return result
+ */
+ __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":503
+ * def __get__(self):
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
+ * return result
+ *
+ */
+ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":504
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ * return result # <<<<<<<<<<<<<<
+ *
+ * property base:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = ((PyObject *)__pyx_v_result);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":501
+ * property T:
+ * @cname('__pyx_memoryview_transpose')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":508
+ * property base:
+ * @cname('__pyx_memoryview__get__base')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.obj
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":509
+ * @cname('__pyx_memoryview__get__base')
+ * def __get__(self):
+ * return self.obj # <<<<<<<<<<<<<<
+ *
+ * property shape:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->obj);
+ __pyx_r = __pyx_v_self->obj;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":508
+ * property base:
+ * @cname('__pyx_memoryview__get__base')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.obj
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":513
+ * property shape:
+ * @cname('__pyx_memoryview_get_shape')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)])
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":514
+ * @cname('__pyx_memoryview_get_shape')
+ * def __get__(self):
+ * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ *
+ * property strides:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __pyx_v_self->view.ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+ __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_self->view.shape[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
+ __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":513
+ * property shape:
+ * @cname('__pyx_memoryview_get_shape')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)])
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":518
+ * property strides:
+ * @cname('__pyx_memoryview_get_strides')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":519
+ * @cname('__pyx_memoryview_get_strides')
+ * def __get__(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ *
+ * raise ValueError("Buffer view does not expose strides")
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":521
+ * if self.view.strides == NULL:
+ *
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ *
+ * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ */
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __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[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":523
+ * raise ValueError("Buffer view does not expose strides")
+ *
+ * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ *
+ * property suboffsets:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __pyx_v_self->view.ndim;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+ __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.strides[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":518
+ * property strides:
+ * @cname('__pyx_memoryview_get_strides')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":527
+ * property suboffsets:
+ * @cname('__pyx_memoryview_get_suboffsets')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self.view.suboffsets == NULL:
+ * return [-1] * self.view.ndim
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":528
+ * @cname('__pyx_memoryview_get_suboffsets')
+ * def __get__(self):
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
+ * return [-1] * self.view.ndim
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":529
+ * def __get__(self):
+ * if self.view.suboffsets == NULL:
+ * return [-1] * self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyList_New(1 * ((__pyx_v_self->view.ndim<0) ? 0:__pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ { Py_ssize_t __pyx_temp;
+ for (__pyx_temp=0; __pyx_temp < __pyx_v_self->view.ndim; __pyx_temp++) {
+ __Pyx_INCREF(__pyx_int_neg_1);
+ PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_int_neg_1);
+ }
+ }
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":531
+ * return [-1] * self.view.ndim
+ *
+ * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ *
+ * property ndim:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __pyx_v_self->view.ndim;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+ __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.suboffsets[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":527
+ * property suboffsets:
+ * @cname('__pyx_memoryview_get_suboffsets')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self.view.suboffsets == NULL:
+ * return [-1] * self.view.ndim
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":535
+ * property ndim:
+ * @cname('__pyx_memoryview_get_ndim')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":536
+ * @cname('__pyx_memoryview_get_ndim')
+ * def __get__(self):
+ * return self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * property itemsize:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":535
+ * property ndim:
+ * @cname('__pyx_memoryview_get_ndim')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":540
+ * property itemsize:
+ * @cname('__pyx_memoryview_get_itemsize')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":541
+ * @cname('__pyx_memoryview_get_itemsize')
+ * def __get__(self):
+ * return self.view.itemsize # <<<<<<<<<<<<<<
+ *
+ * property nbytes:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":540
+ * property itemsize:
+ * @cname('__pyx_memoryview_get_itemsize')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":545
+ * property nbytes:
+ * @cname('__pyx_memoryview_get_nbytes')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":546
+ * @cname('__pyx_memoryview_get_nbytes')
+ * def __get__(self):
+ * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
+ *
+ * property size:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":545
+ * property nbytes:
+ * @cname('__pyx_memoryview_get_nbytes')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":550
+ * property size:
+ * @cname('__pyx_memoryview_get_size')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self._size is None:
+ * result = 1
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_v_result = NULL;
+ PyObject *__pyx_v_length = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ Py_ssize_t __pyx_t_5;
+ PyObject *(*__pyx_t_6)(PyObject *);
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":551
+ * @cname('__pyx_memoryview_get_size')
+ * def __get__(self):
+ * if self._size is None: # <<<<<<<<<<<<<<
+ * result = 1
+ *
+ */
+ __pyx_t_1 = (__pyx_v_self->_size == Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":552
+ * def __get__(self):
+ * if self._size is None:
+ * result = 1 # <<<<<<<<<<<<<<
+ *
+ * for length in self.shape:
+ */
+ __Pyx_INCREF(__pyx_int_1);
+ __pyx_v_result = __pyx_int_1;
+
+ /* "View.MemoryView":554
+ * result = 1
+ *
+ * for length in self.shape: # <<<<<<<<<<<<<<
+ * result *= length
+ *
+ */
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
+ __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
+ __pyx_t_6 = NULL;
+ } else {
+ __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ for (;;) {
+ if (likely(!__pyx_t_6)) {
+ if (likely(PyList_CheckExact(__pyx_t_4))) {
+ if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else {
+ if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ }
+ } else {
+ __pyx_t_3 = __pyx_t_6(__pyx_t_4);
+ if (unlikely(!__pyx_t_3)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_3);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":555
+ *
+ * for length in self.shape:
+ * result *= length # <<<<<<<<<<<<<<
+ *
+ * self._size = result
+ */
+ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":554
+ * result = 1
+ *
+ * for length in self.shape: # <<<<<<<<<<<<<<
+ * result *= length
+ *
+ */
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "View.MemoryView":557
+ * result *= length
+ *
+ * self._size = result # <<<<<<<<<<<<<<
+ *
+ * return self._size
+ */
+ __Pyx_INCREF(__pyx_v_result);
+ __Pyx_GIVEREF(__pyx_v_result);
+ __Pyx_GOTREF(__pyx_v_self->_size);
+ __Pyx_DECREF(__pyx_v_self->_size);
+ __pyx_v_self->_size = __pyx_v_result;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":559
+ * self._size = result
+ *
+ * return self._size # <<<<<<<<<<<<<<
+ *
+ * def __len__(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->_size);
+ __pyx_r = __pyx_v_self->_size;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":550
+ * property size:
+ * @cname('__pyx_memoryview_get_size')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self._size is None:
+ * result = 1
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_length);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":561
+ * return self._size
+ *
+ * def __len__(self): # <<<<<<<<<<<<<<
+ * if self.view.ndim >= 1:
+ * return self.view.shape[0]
+ */
+
+/* Python wrapper */
+static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
+static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("__len__", 0);
+
+ /* "View.MemoryView":562
+ *
+ * def __len__(self):
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
+ * return self.view.shape[0]
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":563
+ * def __len__(self):
+ * if self.view.ndim >= 1:
+ * return self.view.shape[0] # <<<<<<<<<<<<<<
+ *
+ * return 0
+ */
+ __pyx_r = (__pyx_v_self->view.shape[0]);
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":565
+ * return self.view.shape[0]
+ *
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ * def __repr__(self):
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":561
+ * return self._size
+ *
+ * def __len__(self): # <<<<<<<<<<<<<<
+ * if self.view.ndim >= 1:
+ * return self.view.shape[0]
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":567
+ * return 0
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
+ * id(self))
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__repr__", 0);
+
+ /* "View.MemoryView":568
+ *
+ * def __repr__(self):
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
+ * id(self))
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":569
+ * def __repr__(self):
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
+ * id(self)) # <<<<<<<<<<<<<<
+ *
+ * def __str__(self):
+ */
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":568
+ *
+ * def __repr__(self):
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
+ * id(self))
+ *
+ */
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_1 = 0;
+ __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":567
+ * return 0
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
+ * id(self))
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":571
+ * id(self))
+ *
+ * def __str__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__str__", 0);
+
+ /* "View.MemoryView":572
+ *
+ * def __str__(self):
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":571
+ * id(self))
+ *
+ * def __str__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":575
+ *
+ *
+ * def is_c_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice *__pyx_v_mslice;
+ __Pyx_memviewslice __pyx_v_tmp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("is_c_contig", 0);
+
+ /* "View.MemoryView":578
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice, 'C', self.view.ndim)
+ *
+ */
+ __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
+
+ /* "View.MemoryView":579
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp)
+ * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * def is_f_contig(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":575
+ *
+ *
+ * def is_c_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":581
+ * return slice_is_contig(mslice, 'C', self.view.ndim)
+ *
+ * def is_f_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice *__pyx_v_mslice;
+ __Pyx_memviewslice __pyx_v_tmp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("is_f_contig", 0);
+
+ /* "View.MemoryView":584
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice, 'F', self.view.ndim)
+ *
+ */
+ __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
+
+ /* "View.MemoryView":585
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp)
+ * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * def copy(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":581
+ * return slice_is_contig(mslice, 'C', self.view.ndim)
+ *
+ * def is_f_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":587
+ * return slice_is_contig(mslice, 'F', self.view.ndim)
+ *
+ * def copy(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice mslice
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("copy (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice __pyx_v_mslice;
+ int __pyx_v_flags;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_memviewslice __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("copy", 0);
+
+ /* "View.MemoryView":589
+ * def copy(self):
+ * cdef __Pyx_memviewslice mslice
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
+ *
+ * slice_copy(self, &mslice)
+ */
+ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
+
+ /* "View.MemoryView":591
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
+ *
+ * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
+ * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
+ * self.view.itemsize,
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
+
+ /* "View.MemoryView":592
+ *
+ * slice_copy(self, &mslice)
+ * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
+ * self.view.itemsize,
+ * flags|PyBUF_C_CONTIGUOUS,
+ */
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), __pyx_k_c, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_mslice = __pyx_t_1;
+
+ /* "View.MemoryView":597
+ * self.dtype_is_object)
+ *
+ * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
+ *
+ * def copy_fortran(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":587
+ * return slice_is_contig(mslice, 'F', self.view.ndim)
+ *
+ * def copy(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice mslice
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":599
+ * return memoryview_copy_from_slice(self, &mslice)
+ *
+ * def copy_fortran(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice src, dst
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice __pyx_v_src;
+ __Pyx_memviewslice __pyx_v_dst;
+ int __pyx_v_flags;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_memviewslice __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("copy_fortran", 0);
+
+ /* "View.MemoryView":601
+ * def copy_fortran(self):
+ * cdef __Pyx_memviewslice src, dst
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
+ *
+ * slice_copy(self, &src)
+ */
+ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
+
+ /* "View.MemoryView":603
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
+ *
+ * slice_copy(self, &src) # <<<<<<<<<<<<<<
+ * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
+ * self.view.itemsize,
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
+
+ /* "View.MemoryView":604
+ *
+ * slice_copy(self, &src)
+ * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
+ * self.view.itemsize,
+ * flags|PyBUF_F_CONTIGUOUS,
+ */
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), __pyx_k_fortran, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_dst = __pyx_t_1;
+
+ /* "View.MemoryView":609
+ * self.dtype_is_object)
+ *
+ * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":599
+ * return memoryview_copy_from_slice(self, &mslice)
+ *
+ * def copy_fortran(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice src, dst
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":613
+ *
+ * @cname('__pyx_memoryview_new')
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo
+ */
+
+static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
+ struct __pyx_memoryview_obj *__pyx_v_result = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
+
+ /* "View.MemoryView":614
+ * @cname('__pyx_memoryview_new')
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
+ * result.typeinfo = typeinfo
+ * return result
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_o);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
+ __Pyx_GIVEREF(__pyx_v_o);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":615
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
+ * return result
+ *
+ */
+ __pyx_v_result->typeinfo = __pyx_v_typeinfo;
+
+ /* "View.MemoryView":616
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo
+ * return result # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_check')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = ((PyObject *)__pyx_v_result);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":613
+ *
+ * @cname('__pyx_memoryview_new')
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":619
+ *
+ * @cname('__pyx_memoryview_check')
+ * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
+ * return isinstance(o, memoryview)
+ *
+ */
+
+static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("memoryview_check", 0);
+
+ /* "View.MemoryView":620
+ * @cname('__pyx_memoryview_check')
+ * cdef inline bint memoryview_check(object o):
+ * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
+ *
+ * cdef tuple _unellipsify(object index, int ndim):
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, ((PyObject *)__pyx_memoryview_type));
+ __pyx_r = __pyx_t_1;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":619
+ *
+ * @cname('__pyx_memoryview_check')
+ * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
+ * return isinstance(o, memoryview)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":622
+ * return isinstance(o, memoryview)
+ *
+ * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
+ * """
+ * Replace all ellipses with full slices and fill incomplete indices with
+ */
+
+static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
+ PyObject *__pyx_v_tup = NULL;
+ PyObject *__pyx_v_result = NULL;
+ int __pyx_v_have_slices;
+ int __pyx_v_seen_ellipsis;
+ CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
+ PyObject *__pyx_v_item = NULL;
+ Py_ssize_t __pyx_v_nslices;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ Py_ssize_t __pyx_t_5;
+ PyObject *(*__pyx_t_6)(PyObject *);
+ PyObject *__pyx_t_7 = NULL;
+ Py_ssize_t __pyx_t_8;
+ int __pyx_t_9;
+ int __pyx_t_10;
+ PyObject *__pyx_t_11 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_unellipsify", 0);
+
+ /* "View.MemoryView":627
+ * full slices.
+ * """
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
+ * tup = (index,)
+ * else:
+ */
+ __pyx_t_1 = PyTuple_Check(__pyx_v_index);
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":628
+ * """
+ * if not isinstance(index, tuple):
+ * tup = (index,) # <<<<<<<<<<<<<<
+ * else:
+ * tup = index
+ */
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_index);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
+ __Pyx_GIVEREF(__pyx_v_index);
+ __pyx_v_tup = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":630
+ * tup = (index,)
+ * else:
+ * tup = index # <<<<<<<<<<<<<<
+ *
+ * result = []
+ */
+ __Pyx_INCREF(__pyx_v_index);
+ __pyx_v_tup = __pyx_v_index;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":632
+ * tup = index
+ *
+ * result = [] # <<<<<<<<<<<<<<
+ * have_slices = False
+ * seen_ellipsis = False
+ */
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_v_result = ((PyObject*)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":633
+ *
+ * result = []
+ * have_slices = False # <<<<<<<<<<<<<<
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup):
+ */
+ __pyx_v_have_slices = 0;
+
+ /* "View.MemoryView":634
+ * result = []
+ * have_slices = False
+ * seen_ellipsis = False # <<<<<<<<<<<<<<
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis:
+ */
+ __pyx_v_seen_ellipsis = 0;
+
+ /* "View.MemoryView":635
+ * have_slices = False
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ */
+ __Pyx_INCREF(__pyx_int_0);
+ __pyx_t_3 = __pyx_int_0;
+ if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
+ __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
+ __pyx_t_6 = NULL;
+ } else {
+ __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ for (;;) {
+ if (likely(!__pyx_t_6)) {
+ if (likely(PyList_CheckExact(__pyx_t_4))) {
+ if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else {
+ if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ }
+ } else {
+ __pyx_t_7 = __pyx_t_6(__pyx_t_4);
+ if (unlikely(!__pyx_t_7)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_7);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
+ __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3);
+ __pyx_t_3 = __pyx_t_7;
+ __pyx_t_7 = 0;
+
+ /* "View.MemoryView":636
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis: # <<<<<<<<<<<<<<
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ */
+ __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":637
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis:
+ * if not seen_ellipsis: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ * seen_ellipsis = True
+ */
+ __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":638
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
+ * seen_ellipsis = True
+ * else:
+ */
+ __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ { Py_ssize_t __pyx_temp;
+ for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
+ __Pyx_INCREF(__pyx_slice__16);
+ PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__16);
+ __Pyx_GIVEREF(__pyx_slice__16);
+ }
+ }
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "View.MemoryView":639
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ * seen_ellipsis = True # <<<<<<<<<<<<<<
+ * else:
+ * result.append(slice(None))
+ */
+ __pyx_v_seen_ellipsis = 1;
+ goto __pyx_L7;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":641
+ * seen_ellipsis = True
+ * else:
+ * result.append(slice(None)) # <<<<<<<<<<<<<<
+ * have_slices = True
+ * else:
+ */
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__17); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L7:;
+
+ /* "View.MemoryView":642
+ * else:
+ * result.append(slice(None))
+ * have_slices = True # <<<<<<<<<<<<<<
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item):
+ */
+ __pyx_v_have_slices = 1;
+ goto __pyx_L6;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":644
+ * have_slices = True
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ */
+ __pyx_t_2 = PySlice_Check(__pyx_v_item);
+ __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
+ if (__pyx_t_10) {
+ } else {
+ __pyx_t_1 = __pyx_t_10;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
+ __pyx_t_1 = __pyx_t_10;
+ __pyx_L9_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":645
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item):
+ * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
+ *
+ * have_slices = have_slices or isinstance(item, slice)
+ */
+ __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_Raise(__pyx_t_7, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":647
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
+ * result.append(item)
+ *
+ */
+ __pyx_t_10 = (__pyx_v_have_slices != 0);
+ if (!__pyx_t_10) {
+ } else {
+ __pyx_t_1 = __pyx_t_10;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_10 = PySlice_Check(__pyx_v_item);
+ __pyx_t_2 = (__pyx_t_10 != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L11_bool_binop_done:;
+ __pyx_v_have_slices = __pyx_t_1;
+
+ /* "View.MemoryView":648
+ *
+ * have_slices = have_slices or isinstance(item, slice)
+ * result.append(item) # <<<<<<<<<<<<<<
+ *
+ * nslices = ndim - len(result)
+ */
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":635
+ * have_slices = False
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ */
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "View.MemoryView":650
+ * result.append(item)
+ *
+ * nslices = ndim - len(result) # <<<<<<<<<<<<<<
+ * if nslices:
+ * result.extend([slice(None)] * nslices)
+ */
+ __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
+
+ /* "View.MemoryView":651
+ *
+ * nslices = ndim - len(result)
+ * if nslices: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * nslices)
+ *
+ */
+ __pyx_t_1 = (__pyx_v_nslices != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":652
+ * nslices = ndim - len(result)
+ * if nslices:
+ * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
+ *
+ * return have_slices or nslices, tuple(result)
+ */
+ __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ { Py_ssize_t __pyx_temp;
+ for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
+ __Pyx_INCREF(__pyx_slice__18);
+ PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__18);
+ __Pyx_GIVEREF(__pyx_slice__18);
+ }
+ }
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L13;
+ }
+ __pyx_L13:;
+
+ /* "View.MemoryView":654
+ * result.extend([slice(None)] * nslices)
+ *
+ * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
+ *
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ if (!__pyx_v_have_slices) {
+ } else {
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L14_bool_binop_done;
+ }
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __pyx_t_4;
+ __pyx_t_4 = 0;
+ __pyx_L14_bool_binop_done:;
+ __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_3 = 0;
+ __pyx_t_4 = 0;
+ __pyx_r = ((PyObject*)__pyx_t_7);
+ __pyx_t_7 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":622
+ * return isinstance(o, memoryview)
+ *
+ * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
+ * """
+ * Replace all ellipses with full slices and fill incomplete indices with
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_11);
+ __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_tup);
+ __Pyx_XDECREF(__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_idx);
+ __Pyx_XDECREF(__pyx_v_item);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":656
+ * return have_slices or nslices, tuple(result)
+ *
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
+ * cdef int i
+ * for i in range(ndim):
+ */
+
+static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
+ int __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
+
+ /* "View.MemoryView":658
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * cdef int i
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if suboffsets[i] >= 0:
+ * raise ValueError("Indirect dimensions not supported")
+ */
+ __pyx_t_1 = __pyx_v_ndim;
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "View.MemoryView":659
+ * cdef int i
+ * for i in range(ndim):
+ * if suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Indirect dimensions not supported")
+ *
+ */
+ __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0);
+ if (__pyx_t_3) {
+
+ /* "View.MemoryView":660
+ * for i in range(ndim):
+ * if suboffsets[i] >= 0:
+ * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 660; __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[2]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+
+ /* "View.MemoryView":656
+ * return have_slices or nslices, tuple(result)
+ *
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
+ * cdef int i
+ * for i in range(ndim):
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":667
+ *
+ * @cname('__pyx_memview_slice')
+ * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim
+ * cdef bint negative_step
+ */
+
+static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
+ int __pyx_v_new_ndim;
+ int __pyx_v_suboffset_dim;
+ int __pyx_v_dim;
+ __Pyx_memviewslice __pyx_v_src;
+ __Pyx_memviewslice __pyx_v_dst;
+ __Pyx_memviewslice *__pyx_v_p_src;
+ struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
+ __Pyx_memviewslice *__pyx_v_p_dst;
+ int *__pyx_v_p_suboffset_dim;
+ Py_ssize_t __pyx_v_start;
+ Py_ssize_t __pyx_v_stop;
+ Py_ssize_t __pyx_v_step;
+ int __pyx_v_have_start;
+ int __pyx_v_have_stop;
+ int __pyx_v_have_step;
+ PyObject *__pyx_v_index = NULL;
+ struct __pyx_memoryview_obj *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ struct __pyx_memoryview_obj *__pyx_t_4;
+ char *__pyx_t_5;
+ int __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ PyObject *(*__pyx_t_8)(PyObject *);
+ PyObject *__pyx_t_9 = NULL;
+ Py_ssize_t __pyx_t_10;
+ int __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("memview_slice", 0);
+
+ /* "View.MemoryView":668
+ * @cname('__pyx_memview_slice')
+ * cdef memoryview memview_slice(memoryview memview, object indices):
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
+ * cdef bint negative_step
+ * cdef __Pyx_memviewslice src, dst
+ */
+ __pyx_v_new_ndim = 0;
+ __pyx_v_suboffset_dim = -1;
+
+ /* "View.MemoryView":675
+ *
+ *
+ * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
+ *
+ * cdef _memoryviewslice memviewsliceobj
+ */
+ memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));
+
+ /* "View.MemoryView":679
+ * cdef _memoryviewslice memviewsliceobj
+ *
+ * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
+ *
+ * if isinstance(memview, _memoryviewslice):
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
+ PyErr_SetNone(PyExc_AssertionError);
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+
+ /* "View.MemoryView":681
+ * assert memview.view.ndim > 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":682
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * memviewsliceobj = memview # <<<<<<<<<<<<<<
+ * p_src = &memviewsliceobj.from_slice
+ * else:
+ */
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)__pyx_v_memview);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":683
+ * if isinstance(memview, _memoryviewslice):
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
+ * else:
+ * slice_copy(memview, &src)
+ */
+ __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":685
+ * p_src = &memviewsliceobj.from_slice
+ * else:
+ * slice_copy(memview, &src) # <<<<<<<<<<<<<<
+ * p_src = &src
+ *
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
+
+ /* "View.MemoryView":686
+ * else:
+ * slice_copy(memview, &src)
+ * p_src = &src # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_p_src = (&__pyx_v_src);
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":692
+ *
+ *
+ * dst.memview = p_src.memview # <<<<<<<<<<<<<<
+ * dst.data = p_src.data
+ *
+ */
+ __pyx_t_4 = __pyx_v_p_src->memview;
+ __pyx_v_dst.memview = __pyx_t_4;
+
+ /* "View.MemoryView":693
+ *
+ * dst.memview = p_src.memview
+ * dst.data = p_src.data # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __pyx_v_p_src->data;
+ __pyx_v_dst.data = __pyx_t_5;
+
+ /* "View.MemoryView":698
+ *
+ *
+ * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
+ * cdef int *p_suboffset_dim = &suboffset_dim
+ * cdef Py_ssize_t start, stop, step
+ */
+ __pyx_v_p_dst = (&__pyx_v_dst);
+
+ /* "View.MemoryView":699
+ *
+ * cdef __Pyx_memviewslice *p_dst = &dst
+ * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t start, stop, step
+ * cdef bint have_start, have_stop, have_step
+ */
+ __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
+
+ /* "View.MemoryView":703
+ * cdef bint have_start, have_stop, have_step
+ *
+ * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
+ * if PyIndex_Check(index):
+ * slice_memviewslice(
+ */
+ __pyx_t_6 = 0;
+ if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
+ __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
+ __pyx_t_8 = NULL;
+ } else {
+ __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ for (;;) {
+ if (likely(!__pyx_t_8)) {
+ if (likely(PyList_CheckExact(__pyx_t_3))) {
+ if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else {
+ if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ }
+ } else {
+ __pyx_t_9 = __pyx_t_8(__pyx_t_3);
+ if (unlikely(!__pyx_t_9)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_9);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_v_dim = __pyx_t_6;
+ __pyx_t_6 = (__pyx_t_6 + 1);
+
+ /* "View.MemoryView":704
+ *
+ * for dim, index in enumerate(indices):
+ * if PyIndex_Check(index): # <<<<<<<<<<<<<<
+ * slice_memviewslice(
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ */
+ __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":708
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ * dim, new_ndim, p_suboffset_dim,
+ * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ */
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":705
+ * for dim, index in enumerate(indices):
+ * if PyIndex_Check(index):
+ * slice_memviewslice( # <<<<<<<<<<<<<<
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ * dim, new_ndim, p_suboffset_dim,
+ */
+ __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L6;
+ }
+
+ /* "View.MemoryView":711
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ * elif index is None: # <<<<<<<<<<<<<<
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ */
+ __pyx_t_2 = (__pyx_v_index == Py_None);
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":712
+ * False)
+ * elif index is None:
+ * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
+ * p_dst.strides[new_ndim] = 0
+ * p_dst.suboffsets[new_ndim] = -1
+ */
+ (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
+
+ /* "View.MemoryView":713
+ * elif index is None:
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
+ * p_dst.suboffsets[new_ndim] = -1
+ * new_ndim += 1
+ */
+ (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
+
+ /* "View.MemoryView":714
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
+ * new_ndim += 1
+ * else:
+ */
+ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1;
+
+ /* "View.MemoryView":715
+ * p_dst.strides[new_ndim] = 0
+ * p_dst.suboffsets[new_ndim] = -1
+ * new_ndim += 1 # <<<<<<<<<<<<<<
+ * else:
+ * start = index.start or 0
+ */
+ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+ goto __pyx_L6;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":717
+ * new_ndim += 1
+ * else:
+ * start = index.start or 0 # <<<<<<<<<<<<<<
+ * stop = index.stop or 0
+ * step = index.step or 0
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_1) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else {
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __pyx_t_12;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_t_10 = 0;
+ __pyx_L7_bool_binop_done:;
+ __pyx_v_start = __pyx_t_10;
+
+ /* "View.MemoryView":718
+ * else:
+ * start = index.start or 0
+ * stop = index.stop or 0 # <<<<<<<<<<<<<<
+ * step = index.step or 0
+ *
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_1) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else {
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __pyx_t_12;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_10 = 0;
+ __pyx_L9_bool_binop_done:;
+ __pyx_v_stop = __pyx_t_10;
+
+ /* "View.MemoryView":719
+ * start = index.start or 0
+ * stop = index.stop or 0
+ * step = index.step or 0 # <<<<<<<<<<<<<<
+ *
+ * have_start = index.start is not None
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_1) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else {
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __pyx_t_12;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_10 = 0;
+ __pyx_L11_bool_binop_done:;
+ __pyx_v_step = __pyx_t_10;
+
+ /* "View.MemoryView":721
+ * step = index.step or 0
+ *
+ * have_start = index.start is not None # <<<<<<<<<<<<<<
+ * have_stop = index.stop is not None
+ * have_step = index.step is not None
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_have_start = __pyx_t_1;
+
+ /* "View.MemoryView":722
+ *
+ * have_start = index.start is not None
+ * have_stop = index.stop is not None # <<<<<<<<<<<<<<
+ * have_step = index.step is not None
+ *
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_have_stop = __pyx_t_1;
+
+ /* "View.MemoryView":723
+ * have_start = index.start is not None
+ * have_stop = index.stop is not None
+ * have_step = index.step is not None # <<<<<<<<<<<<<<
+ *
+ * slice_memviewslice(
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_have_step = __pyx_t_1;
+
+ /* "View.MemoryView":725
+ * have_step = index.step is not None
+ *
+ * slice_memviewslice( # <<<<<<<<<<<<<<
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ * dim, new_ndim, p_suboffset_dim,
+ */
+ __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":731
+ * have_start, have_stop, have_step,
+ * True)
+ * new_ndim += 1 # <<<<<<<<<<<<<<
+ *
+ * if isinstance(memview, _memoryviewslice):
+ */
+ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":703
+ * cdef bint have_start, have_stop, have_step
+ *
+ * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
+ * if PyIndex_Check(index):
+ * slice_memviewslice(
+ */
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "View.MemoryView":733
+ * new_ndim += 1
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":734
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
+ * memviewsliceobj.to_object_func,
+ * memviewsliceobj.to_dtype_func,
+ */
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+
+ /* "View.MemoryView":735
+ * if isinstance(memview, _memoryviewslice):
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
+ * memviewsliceobj.to_dtype_func,
+ * memview.dtype_is_object)
+ */
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+
+ /* "View.MemoryView":736
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
+ * memview.dtype_is_object)
+ * else:
+ */
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+
+ /* "View.MemoryView":734
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
+ * memviewsliceobj.to_object_func,
+ * memviewsliceobj.to_dtype_func,
+ */
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":739
+ * memview.dtype_is_object)
+ * else:
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
+ * memview.dtype_is_object)
+ *
+ */
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+
+ /* "View.MemoryView":740
+ * else:
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
+ * memview.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+
+ /* "View.MemoryView":739
+ * memview.dtype_is_object)
+ * else:
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
+ * memview.dtype_is_object)
+ *
+ */
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":667
+ *
+ * @cname('__pyx_memview_slice')
+ * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim
+ * cdef bint negative_step
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
+ __Pyx_XDECREF(__pyx_v_index);
+ __Pyx_XGIVEREF((PyObject *)__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":764
+ *
+ * @cname('__pyx_memoryview_slice_memviewslice')
+ * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
+ */
+
+static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
+ Py_ssize_t __pyx_v_new_shape;
+ int __pyx_v_negative_step;
+ int __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+
+ /* "View.MemoryView":784
+ * cdef bint negative_step
+ *
+ * if not is_slice: # <<<<<<<<<<<<<<
+ *
+ * if start < 0:
+ */
+ __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":786
+ * if not is_slice:
+ *
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if not 0 <= start < shape:
+ */
+ __pyx_t_1 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":787
+ *
+ * if start < 0:
+ * start += shape # <<<<<<<<<<<<<<
+ * if not 0 <= start < shape:
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ */
+ __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":788
+ * if start < 0:
+ * start += shape
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ * else:
+ */
+ __pyx_t_1 = (0 <= __pyx_v_start);
+ if (__pyx_t_1) {
+ __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
+ }
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":789
+ * start += shape
+ * if not 0 <= start < shape:
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
+ * else:
+ *
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":792
+ * else:
+ *
+ * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
+ *
+ * if have_step and step == 0:
+ */
+ __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L6_bool_binop_done;
+ }
+ __pyx_t_1 = ((__pyx_v_step < 0) != 0);
+ __pyx_t_2 = __pyx_t_1;
+ __pyx_L6_bool_binop_done:;
+ __pyx_v_negative_step = __pyx_t_2;
+
+ /* "View.MemoryView":794
+ * negative_step = have_step != 0 and step < 0
+ *
+ * if have_step and step == 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
+ *
+ */
+ __pyx_t_1 = (__pyx_v_have_step != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_1 = ((__pyx_v_step == 0) != 0);
+ __pyx_t_2 = __pyx_t_1;
+ __pyx_L9_bool_binop_done:;
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":795
+ *
+ * if have_step and step == 0:
+ * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+
+ /* "View.MemoryView":798
+ *
+ *
+ * if have_start: # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start += shape
+ */
+ __pyx_t_2 = (__pyx_v_have_start != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":799
+ *
+ * if have_start:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if start < 0:
+ */
+ __pyx_t_2 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":800
+ * if have_start:
+ * if start < 0:
+ * start += shape # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start = 0
+ */
+ __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
+
+ /* "View.MemoryView":801
+ * if start < 0:
+ * start += shape
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = 0
+ * elif start >= shape:
+ */
+ __pyx_t_2 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":802
+ * start += shape
+ * if start < 0:
+ * start = 0 # <<<<<<<<<<<<<<
+ * elif start >= shape:
+ * if negative_step:
+ */
+ __pyx_v_start = 0;
+ goto __pyx_L13;
+ }
+ __pyx_L13:;
+ goto __pyx_L12;
+ }
+
+ /* "View.MemoryView":803
+ * if start < 0:
+ * start = 0
+ * elif start >= shape: # <<<<<<<<<<<<<<
+ * if negative_step:
+ * start = shape - 1
+ */
+ __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":804
+ * start = 0
+ * elif start >= shape:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":805
+ * elif start >= shape:
+ * if negative_step:
+ * start = shape - 1 # <<<<<<<<<<<<<<
+ * else:
+ * start = shape
+ */
+ __pyx_v_start = (__pyx_v_shape - 1);
+ goto __pyx_L14;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":807
+ * start = shape - 1
+ * else:
+ * start = shape # <<<<<<<<<<<<<<
+ * else:
+ * if negative_step:
+ */
+ __pyx_v_start = __pyx_v_shape;
+ }
+ __pyx_L14:;
+ goto __pyx_L12;
+ }
+ __pyx_L12:;
+ goto __pyx_L11;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":809
+ * start = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":810
+ * else:
+ * if negative_step:
+ * start = shape - 1 # <<<<<<<<<<<<<<
+ * else:
+ * start = 0
+ */
+ __pyx_v_start = (__pyx_v_shape - 1);
+ goto __pyx_L15;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":812
+ * start = shape - 1
+ * else:
+ * start = 0 # <<<<<<<<<<<<<<
+ *
+ * if have_stop:
+ */
+ __pyx_v_start = 0;
+ }
+ __pyx_L15:;
+ }
+ __pyx_L11:;
+
+ /* "View.MemoryView":814
+ * start = 0
+ *
+ * if have_stop: # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop += shape
+ */
+ __pyx_t_2 = (__pyx_v_have_stop != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":815
+ *
+ * if have_stop:
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop += shape
+ * if stop < 0:
+ */
+ __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":816
+ * if have_stop:
+ * if stop < 0:
+ * stop += shape # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop = 0
+ */
+ __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
+
+ /* "View.MemoryView":817
+ * if stop < 0:
+ * stop += shape
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop = 0
+ * elif stop > shape:
+ */
+ __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":818
+ * stop += shape
+ * if stop < 0:
+ * stop = 0 # <<<<<<<<<<<<<<
+ * elif stop > shape:
+ * stop = shape
+ */
+ __pyx_v_stop = 0;
+ goto __pyx_L18;
+ }
+ __pyx_L18:;
+ goto __pyx_L17;
+ }
+
+ /* "View.MemoryView":819
+ * if stop < 0:
+ * stop = 0
+ * elif stop > shape: # <<<<<<<<<<<<<<
+ * stop = shape
+ * else:
+ */
+ __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":820
+ * stop = 0
+ * elif stop > shape:
+ * stop = shape # <<<<<<<<<<<<<<
+ * else:
+ * if negative_step:
+ */
+ __pyx_v_stop = __pyx_v_shape;
+ goto __pyx_L17;
+ }
+ __pyx_L17:;
+ goto __pyx_L16;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":822
+ * stop = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * stop = -1
+ * else:
+ */
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":823
+ * else:
+ * if negative_step:
+ * stop = -1 # <<<<<<<<<<<<<<
+ * else:
+ * stop = shape
+ */
+ __pyx_v_stop = -1;
+ goto __pyx_L19;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":825
+ * stop = -1
+ * else:
+ * stop = shape # <<<<<<<<<<<<<<
+ *
+ * if not have_step:
+ */
+ __pyx_v_stop = __pyx_v_shape;
+ }
+ __pyx_L19:;
+ }
+ __pyx_L16:;
+
+ /* "View.MemoryView":827
+ * stop = shape
+ *
+ * if not have_step: # <<<<<<<<<<<<<<
+ * step = 1
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":828
+ *
+ * if not have_step:
+ * step = 1 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_step = 1;
+ goto __pyx_L20;
+ }
+ __pyx_L20:;
+
+ /* "View.MemoryView":832
+ *
+ * with cython.cdivision(True):
+ * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
+ *
+ * if (stop - start) - step * new_shape:
+ */
+ __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
+
+ /* "View.MemoryView":834
+ * new_shape = (stop - start) // step
+ *
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
+ * new_shape += 1
+ *
+ */
+ __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":835
+ *
+ * if (stop - start) - step * new_shape:
+ * new_shape += 1 # <<<<<<<<<<<<<<
+ *
+ * if new_shape < 0:
+ */
+ __pyx_v_new_shape = (__pyx_v_new_shape + 1);
+ goto __pyx_L21;
+ }
+ __pyx_L21:;
+
+ /* "View.MemoryView":837
+ * new_shape += 1
+ *
+ * if new_shape < 0: # <<<<<<<<<<<<<<
+ * new_shape = 0
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":838
+ *
+ * if new_shape < 0:
+ * new_shape = 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_new_shape = 0;
+ goto __pyx_L22;
+ }
+ __pyx_L22:;
+
+ /* "View.MemoryView":841
+ *
+ *
+ * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
+ * dst.shape[new_ndim] = new_shape
+ * dst.suboffsets[new_ndim] = suboffset
+ */
+ (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
+
+ /* "View.MemoryView":842
+ *
+ * dst.strides[new_ndim] = stride * step
+ * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
+ * dst.suboffsets[new_ndim] = suboffset
+ *
+ */
+ (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
+
+ /* "View.MemoryView":843
+ * dst.strides[new_ndim] = stride * step
+ * dst.shape[new_ndim] = new_shape
+ * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":846
+ *
+ *
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
+ * dst.data += start * stride
+ * else:
+ */
+ __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":847
+ *
+ * if suboffset_dim[0] < 0:
+ * dst.data += start * stride # <<<<<<<<<<<<<<
+ * else:
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ */
+ __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
+ goto __pyx_L23;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":849
+ * dst.data += start * stride
+ * else:
+ * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
+ *
+ * if suboffset >= 0:
+ */
+ __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
+ (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
+ }
+ __pyx_L23:;
+
+ /* "View.MemoryView":851
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ *
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * if not is_slice:
+ * if new_ndim == 0:
+ */
+ __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":852
+ *
+ * if suboffset >= 0:
+ * if not is_slice: # <<<<<<<<<<<<<<
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ */
+ __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":853
+ * if suboffset >= 0:
+ * if not is_slice:
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ */
+ __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":854
+ * if not is_slice:
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
+ */
+ __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
+ goto __pyx_L26;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":856
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
+ * "must be indexed and not sliced", dim)
+ * else:
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L26:;
+ goto __pyx_L25;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":859
+ * "must be indexed and not sliced", dim)
+ * else:
+ * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
+ *
+ * return 0
+ */
+ (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
+ }
+ __pyx_L25:;
+ goto __pyx_L24;
+ }
+ __pyx_L24:;
+
+ /* "View.MemoryView":861
+ * suboffset_dim[0] = new_ndim
+ *
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":764
+ *
+ * @cname('__pyx_memoryview_slice_memviewslice')
+ * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = -1;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":867
+ *
+ * @cname('__pyx_pybuffer_index')
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1
+ */
+
+static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
+ Py_ssize_t __pyx_v_shape;
+ Py_ssize_t __pyx_v_stride;
+ Py_ssize_t __pyx_v_suboffset;
+ Py_ssize_t __pyx_v_itemsize;
+ char *__pyx_v_resultp;
+ char *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("pybuffer_index", 0);
+
+ /* "View.MemoryView":869
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t itemsize = view.itemsize
+ * cdef char *resultp
+ */
+ __pyx_v_suboffset = -1;
+
+ /* "View.MemoryView":870
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1
+ * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
+ * cdef char *resultp
+ *
+ */
+ __pyx_t_1 = __pyx_v_view->itemsize;
+ __pyx_v_itemsize = __pyx_t_1;
+
+ /* "View.MemoryView":873
+ * cdef char *resultp
+ *
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
+ * shape = view.len / itemsize
+ * stride = itemsize
+ */
+ __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":874
+ *
+ * if view.ndim == 0:
+ * shape = view.len / itemsize # <<<<<<<<<<<<<<
+ * stride = itemsize
+ * else:
+ */
+ if (unlikely(__pyx_v_itemsize == 0)) {
+ #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[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
+
+ /* "View.MemoryView":875
+ * if view.ndim == 0:
+ * shape = view.len / itemsize
+ * stride = itemsize # <<<<<<<<<<<<<<
+ * else:
+ * shape = view.shape[dim]
+ */
+ __pyx_v_stride = __pyx_v_itemsize;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":877
+ * stride = itemsize
+ * else:
+ * shape = view.shape[dim] # <<<<<<<<<<<<<<
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL:
+ */
+ __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
+
+ /* "View.MemoryView":878
+ * else:
+ * shape = view.shape[dim]
+ * stride = view.strides[dim] # <<<<<<<<<<<<<<
+ * if view.suboffsets != NULL:
+ * suboffset = view.suboffsets[dim]
+ */
+ __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
+
+ /* "View.MemoryView":879
+ * shape = view.shape[dim]
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * suboffset = view.suboffsets[dim]
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":880
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL:
+ * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
+ *
+ * if index < 0:
+ */
+ __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":882
+ * suboffset = view.suboffsets[dim]
+ *
+ * if index < 0: # <<<<<<<<<<<<<<
+ * index += view.shape[dim]
+ * if index < 0:
+ */
+ __pyx_t_2 = ((__pyx_v_index < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":883
+ *
+ * if index < 0:
+ * index += view.shape[dim] # <<<<<<<<<<<<<<
+ * if index < 0:
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ */
+ __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
+
+ /* "View.MemoryView":884
+ * if index < 0:
+ * index += view.shape[dim]
+ * if index < 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_index < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":885
+ * index += view.shape[dim]
+ * if index < 0:
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
+ *
+ * if index >= shape:
+ */
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":887
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ * if index >= shape: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":888
+ *
+ * if index >= shape:
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
+ *
+ * resultp = bufp + index * stride
+ */
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 888; __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_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 888; __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[2]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":890
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ * resultp = bufp + index * stride # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * resultp = (<char **> resultp)[0] + suboffset
+ */
+ __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
+
+ /* "View.MemoryView":891
+ *
+ * resultp = bufp + index * stride
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":892
+ * resultp = bufp + index * stride
+ * if suboffset >= 0:
+ * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
+ *
+ * return resultp
+ */
+ __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+
+ /* "View.MemoryView":894
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ * return resultp # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_resultp;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":867
+ *
+ * @cname('__pyx_pybuffer_index')
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":900
+ *
+ * @cname('__pyx_memslice_transpose')
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
+ * cdef int ndim = memslice.memview.view.ndim
+ *
+ */
+
+static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
+ int __pyx_v_ndim;
+ Py_ssize_t *__pyx_v_shape;
+ Py_ssize_t *__pyx_v_strides;
+ int __pyx_v_i;
+ int __pyx_v_j;
+ int __pyx_r;
+ int __pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ long __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ int __pyx_t_8;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+
+ /* "View.MemoryView":901
+ * @cname('__pyx_memslice_transpose')
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
+ * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
+ *
+ * cdef Py_ssize_t *shape = memslice.shape
+ */
+ __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
+ __pyx_v_ndim = __pyx_t_1;
+
+ /* "View.MemoryView":903
+ * cdef int ndim = memslice.memview.view.ndim
+ *
+ * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t *strides = memslice.strides
+ *
+ */
+ __pyx_t_2 = __pyx_v_memslice->shape;
+ __pyx_v_shape = __pyx_t_2;
+
+ /* "View.MemoryView":904
+ *
+ * cdef Py_ssize_t *shape = memslice.shape
+ * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = __pyx_v_memslice->strides;
+ __pyx_v_strides = __pyx_t_2;
+
+ /* "View.MemoryView":908
+ *
+ * cdef int i, j
+ * for i in range(ndim / 2): # <<<<<<<<<<<<<<
+ * j = ndim - 1 - i
+ * strides[i], strides[j] = strides[j], strides[i]
+ */
+ __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
+ for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
+ __pyx_v_i = __pyx_t_1;
+
+ /* "View.MemoryView":909
+ * cdef int i, j
+ * for i in range(ndim / 2):
+ * j = ndim - 1 - i # <<<<<<<<<<<<<<
+ * strides[i], strides[j] = strides[j], strides[i]
+ * shape[i], shape[j] = shape[j], shape[i]
+ */
+ __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
+
+ /* "View.MemoryView":910
+ * for i in range(ndim / 2):
+ * j = ndim - 1 - i
+ * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
+ * shape[i], shape[j] = shape[j], shape[i]
+ *
+ */
+ __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]);
+ __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]);
+ (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
+ (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;
+
+ /* "View.MemoryView":911
+ * j = ndim - 1 - i
+ * strides[i], strides[j] = strides[j], strides[i]
+ * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
+ *
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
+ */
+ __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]);
+ __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]);
+ (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
+ (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;
+
+ /* "View.MemoryView":913
+ * shape[i], shape[j] = shape[j], shape[i]
+ *
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
+ *
+ */
+ __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
+ if (!__pyx_t_7) {
+ } else {
+ __pyx_t_6 = __pyx_t_7;
+ goto __pyx_L6_bool_binop_done;
+ }
+ __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
+ __pyx_t_6 = __pyx_t_7;
+ __pyx_L6_bool_binop_done:;
+ if (__pyx_t_6) {
+
+ /* "View.MemoryView":914
+ *
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
+ *
+ * return 1
+ */
+ __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, __pyx_k_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+
+ /* "View.MemoryView":916
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
+ *
+ * return 1 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = 1;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":900
+ *
+ * @cname('__pyx_memslice_transpose')
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
+ * cdef int ndim = memslice.memview.view.ndim
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = 0;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":933
+ * cdef int (*to_dtype_func)(char *, object) except 0
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ */
+
+/* Python wrapper */
+static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "View.MemoryView":934
+ *
+ * def __dealloc__(self):
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ */
+ __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
+
+ /* "View.MemoryView":933
+ * cdef int (*to_dtype_func)(char *, object) except 0
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":936
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * if self.to_object_func != NULL:
+ * return self.to_object_func(itemp)
+ */
+
+static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("convert_item_to_object", 0);
+
+ /* "View.MemoryView":937
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
+ * return self.to_object_func(itemp)
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":938
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL:
+ * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
+ * else:
+ * return memoryview.convert_item_to_object(self, itemp)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":940
+ * return self.to_object_func(itemp)
+ * else:
+ * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":936
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * if self.to_object_func != NULL:
+ * return self.to_object_func(itemp)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":942
+ * return memoryview.convert_item_to_object(self, itemp)
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * if self.to_dtype_func != NULL:
+ * self.to_dtype_func(itemp, value)
+ */
+
+static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("assign_item_from_object", 0);
+
+ /* "View.MemoryView":943
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
+ * self.to_dtype_func(itemp, value)
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":944
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL:
+ * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
+ * else:
+ * memoryview.assign_item_from_object(self, itemp, value)
+ */
+ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":946
+ * self.to_dtype_func(itemp, value)
+ * else:
+ * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
+ *
+ * property base:
+ */
+ __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":942
+ * return memoryview.convert_item_to_object(self, itemp)
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * if self.to_dtype_func != NULL:
+ * self.to_dtype_func(itemp, value)
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":950
+ * property base:
+ * @cname('__pyx_memoryviewslice__get__base')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.from_object
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":951
+ * @cname('__pyx_memoryviewslice__get__base')
+ * def __get__(self):
+ * return self.from_object # <<<<<<<<<<<<<<
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->from_object);
+ __pyx_r = __pyx_v_self->from_object;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":950
+ * property base:
+ * @cname('__pyx_memoryviewslice__get__base')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.from_object
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":957
+ *
+ * @cname('__pyx_memoryview_fromslice')
+ * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * object (*to_object_func)(char *),
+ */
+
+static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
+ struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
+ int __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_TypeInfo *__pyx_t_4;
+ Py_buffer __pyx_t_5;
+ Py_ssize_t __pyx_t_6;
+ int __pyx_t_7;
+ int __pyx_t_8;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
+
+ /* "View.MemoryView":966
+ * cdef int i
+ *
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
+ __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":967
+ *
+ * if <PyObject *> memviewslice.memview == Py_None:
+ * return None # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(Py_None);
+ __pyx_r = Py_None;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":972
+ *
+ *
+ * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ * result.from_slice = memviewslice
+ */
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_INCREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
+ __Pyx_GIVEREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryviewslice_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":974
+ * result = _memoryviewslice(None, 0, dtype_is_object)
+ *
+ * result.from_slice = memviewslice # <<<<<<<<<<<<<<
+ * __PYX_INC_MEMVIEW(&memviewslice, 1)
+ *
+ */
+ __pyx_v_result->from_slice = __pyx_v_memviewslice;
+
+ /* "View.MemoryView":975
+ *
+ * result.from_slice = memviewslice
+ * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
+ *
+ * result.from_object = (<memoryview> memviewslice.memview).base
+ */
+ __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
+
+ /* "View.MemoryView":977
+ * __PYX_INC_MEMVIEW(&memviewslice, 1)
+ *
+ * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
+ * result.typeinfo = memviewslice.memview.typeinfo
+ *
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_v_result->from_object);
+ __Pyx_DECREF(__pyx_v_result->from_object);
+ __pyx_v_result->from_object = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":978
+ *
+ * result.from_object = (<memoryview> memviewslice.memview).base
+ * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
+ *
+ * result.view = memviewslice.memview.view
+ */
+ __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
+ __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
+
+ /* "View.MemoryView":980
+ * result.typeinfo = memviewslice.memview.typeinfo
+ *
+ * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
+ * result.view.buf = <void *> memviewslice.data
+ * result.view.ndim = ndim
+ */
+ __pyx_t_5 = __pyx_v_memviewslice.memview->view;
+ __pyx_v_result->__pyx_base.view = __pyx_t_5;
+
+ /* "View.MemoryView":981
+ *
+ * result.view = memviewslice.memview.view
+ * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
+ * result.view.ndim = ndim
+ * (<__pyx_buffer *> &result.view).obj = Py_None
+ */
+ __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
+
+ /* "View.MemoryView":982
+ * result.view = memviewslice.memview.view
+ * result.view.buf = <void *> memviewslice.data
+ * result.view.ndim = ndim # <<<<<<<<<<<<<<
+ * (<__pyx_buffer *> &result.view).obj = Py_None
+ * Py_INCREF(Py_None)
+ */
+ __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
+
+ /* "View.MemoryView":983
+ * result.view.buf = <void *> memviewslice.data
+ * result.view.ndim = ndim
+ * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
+ * Py_INCREF(Py_None)
+ *
+ */
+ ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
+
+ /* "View.MemoryView":984
+ * result.view.ndim = ndim
+ * (<__pyx_buffer *> &result.view).obj = Py_None
+ * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
+ *
+ * result.flags = PyBUF_RECORDS
+ */
+ Py_INCREF(Py_None);
+
+ /* "View.MemoryView":986
+ * Py_INCREF(Py_None)
+ *
+ * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
+ *
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape
+ */
+ __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
+
+ /* "View.MemoryView":988
+ * result.flags = PyBUF_RECORDS
+ *
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
+ * result.view.strides = <Py_ssize_t *> result.from_slice.strides
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ */
+ __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
+
+ /* "View.MemoryView":989
+ *
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape
+ * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ *
+ */
+ __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
+
+ /* "View.MemoryView":990
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape
+ * result.view.strides = <Py_ssize_t *> result.from_slice.strides
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
+ *
+ * result.view.len = result.view.itemsize
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+
+ /* "View.MemoryView":992
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ *
+ * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
+ * for i in range(ndim):
+ * result.view.len *= result.view.shape[i]
+ */
+ __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_6;
+
+ /* "View.MemoryView":993
+ *
+ * result.view.len = result.view.itemsize
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * result.view.len *= result.view.shape[i]
+ *
+ */
+ __pyx_t_7 = __pyx_v_ndim;
+ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
+ __pyx_v_i = __pyx_t_8;
+
+ /* "View.MemoryView":994
+ * result.view.len = result.view.itemsize
+ * for i in range(ndim):
+ * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<<
+ *
+ * result.to_object_func = to_object_func
+ */
+ __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * (__pyx_v_result->__pyx_base.view.shape[__pyx_v_i]));
+ }
+
+ /* "View.MemoryView":996
+ * result.view.len *= result.view.shape[i]
+ *
+ * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
+ * result.to_dtype_func = to_dtype_func
+ *
+ */
+ __pyx_v_result->to_object_func = __pyx_v_to_object_func;
+
+ /* "View.MemoryView":997
+ *
+ * result.to_object_func = to_object_func
+ * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
+ *
+ * return result
+ */
+ __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
+
+ /* "View.MemoryView":999
+ * result.to_dtype_func = to_dtype_func
+ *
+ * return result # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_get_slice_from_memoryview')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = ((PyObject *)__pyx_v_result);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":957
+ *
+ * @cname('__pyx_memoryview_fromslice')
+ * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * object (*to_object_func)(char *),
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1002
+ *
+ * @cname('__pyx_memoryview_get_slice_from_memoryview')
+ * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ */
+
+static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
+ struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
+ __Pyx_memviewslice *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
+
+ /* "View.MemoryView":1005
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * obj = memview
+ * return &obj.from_slice
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1006
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice):
+ * obj = memview # <<<<<<<<<<<<<<
+ * return &obj.from_slice
+ * else:
+ */
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)__pyx_v_memview);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":1007
+ * if isinstance(memview, _memoryviewslice):
+ * obj = memview
+ * return &obj.from_slice # <<<<<<<<<<<<<<
+ * else:
+ * slice_copy(memview, mslice)
+ */
+ __pyx_r = (&__pyx_v_obj->from_slice);
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1009
+ * return &obj.from_slice
+ * else:
+ * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
+ * return mslice
+ *
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
+
+ /* "View.MemoryView":1010
+ * else:
+ * slice_copy(memview, mslice)
+ * return mslice # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_slice_copy')
+ */
+ __pyx_r = __pyx_v_mslice;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":1002
+ *
+ * @cname('__pyx_memoryview_get_slice_from_memoryview')
+ * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_obj);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1013
+ *
+ * @cname('__pyx_memoryview_slice_copy')
+ * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
+ * cdef int dim
+ * cdef (Py_ssize_t*) shape, strides, suboffsets
+ */
+
+static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
+ int __pyx_v_dim;
+ Py_ssize_t *__pyx_v_shape;
+ Py_ssize_t *__pyx_v_strides;
+ Py_ssize_t *__pyx_v_suboffsets;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t *__pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ __Pyx_RefNannySetupContext("slice_copy", 0);
+
+ /* "View.MemoryView":1017
+ * cdef (Py_ssize_t*) shape, strides, suboffsets
+ *
+ * shape = memview.view.shape # <<<<<<<<<<<<<<
+ * strides = memview.view.strides
+ * suboffsets = memview.view.suboffsets
+ */
+ __pyx_t_1 = __pyx_v_memview->view.shape;
+ __pyx_v_shape = __pyx_t_1;
+
+ /* "View.MemoryView":1018
+ *
+ * shape = memview.view.shape
+ * strides = memview.view.strides # <<<<<<<<<<<<<<
+ * suboffsets = memview.view.suboffsets
+ *
+ */
+ __pyx_t_1 = __pyx_v_memview->view.strides;
+ __pyx_v_strides = __pyx_t_1;
+
+ /* "View.MemoryView":1019
+ * shape = memview.view.shape
+ * strides = memview.view.strides
+ * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
+ *
+ * dst.memview = <__pyx_memoryview *> memview
+ */
+ __pyx_t_1 = __pyx_v_memview->view.suboffsets;
+ __pyx_v_suboffsets = __pyx_t_1;
+
+ /* "View.MemoryView":1021
+ * suboffsets = memview.view.suboffsets
+ *
+ * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
+ * dst.data = <char *> memview.view.buf
+ *
+ */
+ __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
+
+ /* "View.MemoryView":1022
+ *
+ * dst.memview = <__pyx_memoryview *> memview
+ * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
+ *
+ * for dim in range(memview.view.ndim):
+ */
+ __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
+
+ /* "View.MemoryView":1024
+ * dst.data = <char *> memview.view.buf
+ *
+ * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
+ * dst.shape[dim] = shape[dim]
+ * dst.strides[dim] = strides[dim]
+ */
+ __pyx_t_2 = __pyx_v_memview->view.ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_dim = __pyx_t_3;
+
+ /* "View.MemoryView":1025
+ *
+ * for dim in range(memview.view.ndim):
+ * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
+ * dst.strides[dim] = strides[dim]
+ * if suboffsets == NULL:
+ */
+ (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
+
+ /* "View.MemoryView":1026
+ * for dim in range(memview.view.ndim):
+ * dst.shape[dim] = shape[dim]
+ * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
+ * if suboffsets == NULL:
+ * dst.suboffsets[dim] = -1
+ */
+ (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
+
+ /* "View.MemoryView":1027
+ * dst.shape[dim] = shape[dim]
+ * dst.strides[dim] = strides[dim]
+ * if suboffsets == NULL: # <<<<<<<<<<<<<<
+ * dst.suboffsets[dim] = -1
+ * else:
+ */
+ __pyx_t_4 = ((__pyx_v_suboffsets == NULL) != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":1028
+ * dst.strides[dim] = strides[dim]
+ * if suboffsets == NULL:
+ * dst.suboffsets[dim] = -1 # <<<<<<<<<<<<<<
+ * else:
+ * dst.suboffsets[dim] = suboffsets[dim]
+ */
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = -1;
+ goto __pyx_L5;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1030
+ * dst.suboffsets[dim] = -1
+ * else:
+ * dst.suboffsets[dim] = suboffsets[dim] # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_object')
+ */
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]);
+ }
+ __pyx_L5:;
+ }
+
+ /* "View.MemoryView":1013
+ *
+ * @cname('__pyx_memoryview_slice_copy')
+ * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
+ * cdef int dim
+ * cdef (Py_ssize_t*) shape, strides, suboffsets
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":1033
+ *
+ * @cname('__pyx_memoryview_copy_object')
+ * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
+ * "Create a new memoryview object"
+ * cdef __Pyx_memviewslice memviewslice
+ */
+
+static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
+ __Pyx_memviewslice __pyx_v_memviewslice;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("memoryview_copy", 0);
+
+ /* "View.MemoryView":1036
+ * "Create a new memoryview object"
+ * cdef __Pyx_memviewslice memviewslice
+ * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
+ * return memoryview_copy_from_slice(memview, &memviewslice)
+ *
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
+
+ /* "View.MemoryView":1037
+ * cdef __Pyx_memviewslice memviewslice
+ * slice_copy(memview, &memviewslice)
+ * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_object_from_slice')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1033
+ *
+ * @cname('__pyx_memoryview_copy_object')
+ * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
+ * "Create a new memoryview object"
+ * cdef __Pyx_memviewslice memviewslice
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1040
+ *
+ * @cname('__pyx_memoryview_copy_object_from_slice')
+ * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
+ * """
+ * Create a new memoryview object from a given memoryview object and slice.
+ */
+
+static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
+ PyObject *(*__pyx_v_to_object_func)(char *);
+ int (*__pyx_v_to_dtype_func)(char *, PyObject *);
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *(*__pyx_t_3)(char *);
+ int (*__pyx_t_4)(char *, PyObject *);
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
+
+ /* "View.MemoryView":1047
+ * cdef int (*to_dtype_func)(char *, object) except 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * to_object_func = (<_memoryviewslice> memview).to_object_func
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1048
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
+ * else:
+ */
+ __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
+ __pyx_v_to_object_func = __pyx_t_3;
+
+ /* "View.MemoryView":1049
+ * if isinstance(memview, _memoryviewslice):
+ * to_object_func = (<_memoryviewslice> memview).to_object_func
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
+ * else:
+ * to_object_func = NULL
+ */
+ __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
+ __pyx_v_to_dtype_func = __pyx_t_4;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1051
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
+ * else:
+ * to_object_func = NULL # <<<<<<<<<<<<<<
+ * to_dtype_func = NULL
+ *
+ */
+ __pyx_v_to_object_func = NULL;
+
+ /* "View.MemoryView":1052
+ * else:
+ * to_object_func = NULL
+ * to_dtype_func = NULL # <<<<<<<<<<<<<<
+ *
+ * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
+ */
+ __pyx_v_to_dtype_func = NULL;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1054
+ * to_dtype_func = NULL
+ *
+ * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
+ * to_object_func, to_dtype_func,
+ * memview.dtype_is_object)
+ */
+ __Pyx_XDECREF(__pyx_r);
+
+ /* "View.MemoryView":1056
+ * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
+ * to_object_func, to_dtype_func,
+ * memview.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1040
+ *
+ * @cname('__pyx_memoryview_copy_object_from_slice')
+ * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
+ * """
+ * Create a new memoryview object from a given memoryview object and slice.
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1062
+ *
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
+ * if arg < 0:
+ * return -arg
+ */
+
+static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
+ Py_ssize_t __pyx_r;
+ int __pyx_t_1;
+
+ /* "View.MemoryView":1063
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0: # <<<<<<<<<<<<<<
+ * return -arg
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1064
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0:
+ * return -arg # <<<<<<<<<<<<<<
+ * else:
+ * return arg
+ */
+ __pyx_r = (-__pyx_v_arg);
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1066
+ * return -arg
+ * else:
+ * return arg # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_get_best_slice_order')
+ */
+ __pyx_r = __pyx_v_arg;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":1062
+ *
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
+ * if arg < 0:
+ * return -arg
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1069
+ *
+ * @cname('__pyx_get_best_slice_order')
+ * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
+ * """
+ * Figure out the best memory access order for a given slice.
+ */
+
+static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
+ int __pyx_v_i;
+ Py_ssize_t __pyx_v_c_stride;
+ Py_ssize_t __pyx_v_f_stride;
+ char __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+
+ /* "View.MemoryView":1074
+ * """
+ * cdef int i
+ * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t f_stride = 0
+ *
+ */
+ __pyx_v_c_stride = 0;
+
+ /* "View.MemoryView":1075
+ * cdef int i
+ * cdef Py_ssize_t c_stride = 0
+ * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim - 1, -1, -1):
+ */
+ __pyx_v_f_stride = 0;
+
+ /* "View.MemoryView":1077
+ * cdef Py_ssize_t f_stride = 0
+ *
+ * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
+ * if mslice.shape[i] > 1:
+ * c_stride = mslice.strides[i]
+ */
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ __pyx_v_i = __pyx_t_1;
+
+ /* "View.MemoryView":1078
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * c_stride = mslice.strides[i]
+ * break
+ */
+ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1079
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1:
+ * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
+
+ /* "View.MemoryView":1080
+ * if mslice.shape[i] > 1:
+ * c_stride = mslice.strides[i]
+ * break # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim):
+ */
+ goto __pyx_L4_break;
+ }
+ }
+ __pyx_L4_break:;
+
+ /* "View.MemoryView":1082
+ * break
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if mslice.shape[i] > 1:
+ * f_stride = mslice.strides[i]
+ */
+ __pyx_t_1 = __pyx_v_ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1083
+ *
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * f_stride = mslice.strides[i]
+ * break
+ */
+ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1084
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1:
+ * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
+
+ /* "View.MemoryView":1085
+ * if mslice.shape[i] > 1:
+ * f_stride = mslice.strides[i]
+ * break # <<<<<<<<<<<<<<
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
+ */
+ goto __pyx_L7_break;
+ }
+ }
+ __pyx_L7_break:;
+
+ /* "View.MemoryView":1087
+ * break
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
+ * return 'C'
+ * else:
+ */
+ __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1088
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
+ * return 'C' # <<<<<<<<<<<<<<
+ * else:
+ * return 'F'
+ */
+ __pyx_r = 'C';
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1090
+ * return 'C'
+ * else:
+ * return 'F' # <<<<<<<<<<<<<<
+ *
+ * @cython.cdivision(True)
+ */
+ __pyx_r = 'F';
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":1069
+ *
+ * @cname('__pyx_get_best_slice_order')
+ * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
+ * """
+ * Figure out the best memory access order for a given slice.
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1093
+ *
+ * @cython.cdivision(True)
+ * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
+ * char *dst_data, Py_ssize_t *dst_strides,
+ * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
+ */
+
+static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
+ CYTHON_UNUSED Py_ssize_t __pyx_v_i;
+ CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
+ Py_ssize_t __pyx_v_dst_extent;
+ Py_ssize_t __pyx_v_src_stride;
+ Py_ssize_t __pyx_v_dst_stride;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+
+ /* "View.MemoryView":1100
+ *
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dst_extent = dst_shape[0]
+ * cdef Py_ssize_t src_stride = src_strides[0]
+ */
+ __pyx_v_src_extent = (__pyx_v_src_shape[0]);
+
+ /* "View.MemoryView":1101
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t src_extent = src_shape[0]
+ * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t src_stride = src_strides[0]
+ * cdef Py_ssize_t dst_stride = dst_strides[0]
+ */
+ __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
+
+ /* "View.MemoryView":1102
+ * cdef Py_ssize_t src_extent = src_shape[0]
+ * cdef Py_ssize_t dst_extent = dst_shape[0]
+ * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dst_stride = dst_strides[0]
+ *
+ */
+ __pyx_v_src_stride = (__pyx_v_src_strides[0]);
+
+ /* "View.MemoryView":1103
+ * cdef Py_ssize_t dst_extent = dst_shape[0]
+ * cdef Py_ssize_t src_stride = src_strides[0]
+ * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
+ *
+ * if ndim == 1:
+ */
+ __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
+
+ /* "View.MemoryView":1105
+ * cdef Py_ssize_t dst_stride = dst_strides[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if (src_stride > 0 and dst_stride > 0 and
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ */
+ __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1106
+ *
+ * if ndim == 1:
+ * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ */
+ __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L5_bool_binop_done;
+ }
+
+ /* "View.MemoryView":1107
+ * if ndim == 1:
+ * if (src_stride > 0 and dst_stride > 0 and
+ * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ * else:
+ */
+ __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
+ if (__pyx_t_2) {
+ __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
+ }
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_L5_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1108
+ * if (src_stride > 0 and dst_stride > 0 and
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
+ * else:
+ * for i in range(dst_extent):
+ */
+ memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1110
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ * else:
+ * for i in range(dst_extent): # <<<<<<<<<<<<<<
+ * memcpy(dst_data, src_data, itemsize)
+ * src_data += src_stride
+ */
+ __pyx_t_4 = __pyx_v_dst_extent;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "View.MemoryView":1111
+ * else:
+ * for i in range(dst_extent):
+ * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
+ * src_data += src_stride
+ * dst_data += dst_stride
+ */
+ memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);
+
+ /* "View.MemoryView":1112
+ * for i in range(dst_extent):
+ * memcpy(dst_data, src_data, itemsize)
+ * src_data += src_stride # <<<<<<<<<<<<<<
+ * dst_data += dst_stride
+ * else:
+ */
+ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
+
+ /* "View.MemoryView":1113
+ * memcpy(dst_data, src_data, itemsize)
+ * src_data += src_stride
+ * dst_data += dst_stride # <<<<<<<<<<<<<<
+ * else:
+ * for i in range(dst_extent):
+ */
+ __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
+ }
+ }
+ __pyx_L4:;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1115
+ * dst_data += dst_stride
+ * else:
+ * for i in range(dst_extent): # <<<<<<<<<<<<<<
+ * _copy_strided_to_strided(src_data, src_strides + 1,
+ * dst_data, dst_strides + 1,
+ */
+ __pyx_t_4 = __pyx_v_dst_extent;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "View.MemoryView":1116
+ * else:
+ * for i in range(dst_extent):
+ * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
+ * dst_data, dst_strides + 1,
+ * src_shape + 1, dst_shape + 1,
+ */
+ _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
+
+ /* "View.MemoryView":1120
+ * src_shape + 1, dst_shape + 1,
+ * ndim - 1, itemsize)
+ * src_data += src_stride # <<<<<<<<<<<<<<
+ * dst_data += dst_stride
+ *
+ */
+ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
+
+ /* "View.MemoryView":1121
+ * ndim - 1, itemsize)
+ * src_data += src_stride
+ * dst_data += dst_stride # <<<<<<<<<<<<<<
+ *
+ * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
+ */
+ __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
+ }
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1093
+ *
+ * @cython.cdivision(True)
+ * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
+ * char *dst_data, Py_ssize_t *dst_strides,
+ * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1123
+ * dst_data += dst_stride
+ *
+ * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * int ndim, size_t itemsize) nogil:
+ */
+
+static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
+
+ /* "View.MemoryView":1126
+ * __Pyx_memviewslice *dst,
+ * int ndim, size_t itemsize) nogil:
+ * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
+ * src.shape, dst.shape, ndim, itemsize)
+ *
+ */
+ _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
+
+ /* "View.MemoryView":1123
+ * dst_data += dst_stride
+ *
+ * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * int ndim, size_t itemsize) nogil:
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1130
+ *
+ * @cname('__pyx_memoryview_slice_get_size')
+ * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
+ * "Return the size of the memory occupied by the slice in number of bytes"
+ * cdef int i
+ */
+
+static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
+ int __pyx_v_i;
+ Py_ssize_t __pyx_v_size;
+ Py_ssize_t __pyx_r;
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+
+ /* "View.MemoryView":1133
+ * "Return the size of the memory occupied by the slice in number of bytes"
+ * cdef int i
+ * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim):
+ */
+ __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
+ __pyx_v_size = __pyx_t_1;
+
+ /* "View.MemoryView":1135
+ * cdef Py_ssize_t size = src.memview.view.itemsize
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * size *= src.shape[i]
+ *
+ */
+ __pyx_t_2 = __pyx_v_ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1136
+ *
+ * for i in range(ndim):
+ * size *= src.shape[i] # <<<<<<<<<<<<<<
+ *
+ * return size
+ */
+ __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
+ }
+
+ /* "View.MemoryView":1138
+ * size *= src.shape[i]
+ *
+ * return size # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_fill_contig_strides_array')
+ */
+ __pyx_r = __pyx_v_size;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1130
+ *
+ * @cname('__pyx_memoryview_slice_get_size')
+ * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
+ * "Return the size of the memory occupied by the slice in number of bytes"
+ * cdef int i
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1141
+ *
+ * @cname('__pyx_fill_contig_strides_array')
+ * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
+ * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
+ * int ndim, char order) nogil:
+ */
+
+static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
+ int __pyx_v_idx;
+ Py_ssize_t __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+
+ /* "View.MemoryView":1150
+ * cdef int idx
+ *
+ * if order == 'F': # <<<<<<<<<<<<<<
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ */
+ __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1151
+ *
+ * if order == 'F':
+ * for idx in range(ndim): # <<<<<<<<<<<<<<
+ * strides[idx] = stride
+ * stride = stride * shape[idx]
+ */
+ __pyx_t_2 = __pyx_v_ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_idx = __pyx_t_3;
+
+ /* "View.MemoryView":1152
+ * if order == 'F':
+ * for idx in range(ndim):
+ * strides[idx] = stride # <<<<<<<<<<<<<<
+ * stride = stride * shape[idx]
+ * else:
+ */
+ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
+
+ /* "View.MemoryView":1153
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ * stride = stride * shape[idx] # <<<<<<<<<<<<<<
+ * else:
+ * for idx in range(ndim - 1, -1, -1):
+ */
+ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
+ }
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1155
+ * stride = stride * shape[idx]
+ * else:
+ * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
+ * strides[idx] = stride
+ * stride = stride * shape[idx]
+ */
+ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
+ __pyx_v_idx = __pyx_t_2;
+
+ /* "View.MemoryView":1156
+ * else:
+ * for idx in range(ndim - 1, -1, -1):
+ * strides[idx] = stride # <<<<<<<<<<<<<<
+ * stride = stride * shape[idx]
+ *
+ */
+ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
+
+ /* "View.MemoryView":1157
+ * for idx in range(ndim - 1, -1, -1):
+ * strides[idx] = stride
+ * stride = stride * shape[idx] # <<<<<<<<<<<<<<
+ *
+ * return stride
+ */
+ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
+ }
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1159
+ * stride = stride * shape[idx]
+ *
+ * return stride # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_data_to_temp')
+ */
+ __pyx_r = __pyx_v_stride;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1141
+ *
+ * @cname('__pyx_fill_contig_strides_array')
+ * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
+ * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
+ * int ndim, char order) nogil:
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1162
+ *
+ * @cname('__pyx_memoryview_copy_data_to_temp')
+ * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *tmpslice,
+ * char order,
+ */
+
+static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
+ int __pyx_v_i;
+ void *__pyx_v_result;
+ size_t __pyx_v_itemsize;
+ size_t __pyx_v_size;
+ void *__pyx_r;
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ struct __pyx_memoryview_obj *__pyx_t_4;
+ int __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+
+ /* "View.MemoryView":1173
+ * cdef void *result
+ *
+ * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
+ * cdef size_t size = slice_get_size(src, ndim)
+ *
+ */
+ __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
+ __pyx_v_itemsize = __pyx_t_1;
+
+ /* "View.MemoryView":1174
+ *
+ * cdef size_t itemsize = src.memview.view.itemsize
+ * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
+ *
+ * result = malloc(size)
+ */
+ __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
+
+ /* "View.MemoryView":1176
+ * cdef size_t size = slice_get_size(src, ndim)
+ *
+ * result = malloc(size) # <<<<<<<<<<<<<<
+ * if not result:
+ * _err(MemoryError, NULL)
+ */
+ __pyx_v_result = malloc(__pyx_v_size);
+
+ /* "View.MemoryView":1177
+ *
+ * result = malloc(size)
+ * if not result: # <<<<<<<<<<<<<<
+ * _err(MemoryError, NULL)
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1178
+ * result = malloc(size)
+ * if not result:
+ * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1181
+ *
+ *
+ * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
+ * tmpslice.memview = src.memview
+ * for i in range(ndim):
+ */
+ __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
+
+ /* "View.MemoryView":1182
+ *
+ * tmpslice.data = <char *> result
+ * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
+ * for i in range(ndim):
+ * tmpslice.shape[i] = src.shape[i]
+ */
+ __pyx_t_4 = __pyx_v_src->memview;
+ __pyx_v_tmpslice->memview = __pyx_t_4;
+
+ /* "View.MemoryView":1183
+ * tmpslice.data = <char *> result
+ * tmpslice.memview = src.memview
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * tmpslice.shape[i] = src.shape[i]
+ * tmpslice.suboffsets[i] = -1
+ */
+ __pyx_t_3 = __pyx_v_ndim;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "View.MemoryView":1184
+ * tmpslice.memview = src.memview
+ * for i in range(ndim):
+ * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
+ * tmpslice.suboffsets[i] = -1
+ *
+ */
+ (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
+
+ /* "View.MemoryView":1185
+ * for i in range(ndim):
+ * tmpslice.shape[i] = src.shape[i]
+ * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ *
+ * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
+ */
+ (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1;
+ }
+
+ /* "View.MemoryView":1187
+ * tmpslice.suboffsets[i] = -1
+ *
+ * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
+ * ndim, order)
+ *
+ */
+ __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order);
+
+ /* "View.MemoryView":1191
+ *
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if tmpslice.shape[i] == 1:
+ * tmpslice.strides[i] = 0
+ */
+ __pyx_t_3 = __pyx_v_ndim;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "View.MemoryView":1192
+ *
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
+ * tmpslice.strides[i] = 0
+ *
+ */
+ __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1193
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1:
+ * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
+ *
+ * if slice_is_contig(src, order, ndim):
+ */
+ (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+ }
+
+ /* "View.MemoryView":1195
+ * tmpslice.strides[i] = 0
+ *
+ * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * memcpy(result, src.data, size)
+ * else:
+ */
+ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1196
+ *
+ * if slice_is_contig(src, order, ndim):
+ * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
+ * else:
+ * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
+ */
+ memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size);
+ goto __pyx_L9;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1198
+ * memcpy(result, src.data, size)
+ * else:
+ * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
+ *
+ * return result
+ */
+ copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
+ }
+ __pyx_L9:;
+
+ /* "View.MemoryView":1200
+ * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
+ *
+ * return result # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1162
+ *
+ * @cname('__pyx_memoryview_copy_data_to_temp')
+ * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *tmpslice,
+ * char order,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = NULL;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1205
+ *
+ * @cname('__pyx_memoryview_err_extents')
+ * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
+ */
+
+static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("_err_extents", 0);
+
+ /* "View.MemoryView":1208
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
+ * (i, extent1, extent2)) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_err_dim')
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":1207
+ * cdef int _err_extents(int i, Py_ssize_t extent1,
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
+ * (i, extent1, extent2))
+ *
+ */
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1207; __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[2]; __pyx_lineno = 1207; __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[2]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":1205
+ *
+ * @cname('__pyx_memoryview_err_extents')
+ * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1211
+ *
+ * @cname('__pyx_memoryview_err_dim')
+ * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii') % dim)
+ *
+ */
+
+static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("_err_dim", 0);
+ __Pyx_INCREF(__pyx_v_error);
+
+ /* "View.MemoryView":1212
+ * @cname('__pyx_memoryview_err_dim')
+ * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
+ * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_err')
+ */
+ __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __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_3); __pyx_t_3 = 0;
+ __Pyx_INCREF(__pyx_v_error);
+ __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_2)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (!__pyx_t_2) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __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_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":1211
+ *
+ * @cname('__pyx_memoryview_err_dim')
+ * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii') % dim)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __Pyx_XDECREF(__pyx_v_error);
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1215
+ *
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
+ * if msg != NULL:
+ * raise error(msg.decode('ascii'))
+ */
+
+static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("_err", 0);
+ __Pyx_INCREF(__pyx_v_error);
+
+ /* "View.MemoryView":1216
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii'))
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1217
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL:
+ * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
+ * else:
+ * raise error
+ */
+ __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_error);
+ __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ if (!__pyx_t_5) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ } else {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1219
+ * raise error(msg.decode('ascii'))
+ * else:
+ * raise error # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_contents')
+ */
+ __Pyx_Raise(__pyx_v_error, 0, 0, 0);
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":1215
+ *
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
+ * if msg != NULL:
+ * raise error(msg.decode('ascii'))
+ */
+
+ /* 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);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __Pyx_XDECREF(__pyx_v_error);
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1222
+ *
+ * @cname('__pyx_memoryview_copy_contents')
+ * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice dst,
+ * int src_ndim, int dst_ndim,
+ */
+
+static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
+ void *__pyx_v_tmpdata;
+ size_t __pyx_v_itemsize;
+ int __pyx_v_i;
+ char __pyx_v_order;
+ int __pyx_v_broadcasting;
+ int __pyx_v_direct_copy;
+ __Pyx_memviewslice __pyx_v_tmp;
+ int __pyx_v_ndim;
+ int __pyx_r;
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ void *__pyx_t_6;
+ int __pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+
+ /* "View.MemoryView":1230
+ * Check for overlapping memory and verify the shapes.
+ * """
+ * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
+ * cdef size_t itemsize = src.memview.view.itemsize
+ * cdef int i
+ */
+ __pyx_v_tmpdata = NULL;
+
+ /* "View.MemoryView":1231
+ * """
+ * cdef void *tmpdata = NULL
+ * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
+ * cdef int i
+ * cdef char order = get_best_order(&src, src_ndim)
+ */
+ __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
+ __pyx_v_itemsize = __pyx_t_1;
+
+ /* "View.MemoryView":1233
+ * cdef size_t itemsize = src.memview.view.itemsize
+ * cdef int i
+ * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
+ * cdef bint broadcasting = False
+ * cdef bint direct_copy = False
+ */
+ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
+
+ /* "View.MemoryView":1234
+ * cdef int i
+ * cdef char order = get_best_order(&src, src_ndim)
+ * cdef bint broadcasting = False # <<<<<<<<<<<<<<
+ * cdef bint direct_copy = False
+ * cdef __Pyx_memviewslice tmp
+ */
+ __pyx_v_broadcasting = 0;
+
+ /* "View.MemoryView":1235
+ * cdef char order = get_best_order(&src, src_ndim)
+ * cdef bint broadcasting = False
+ * cdef bint direct_copy = False # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice tmp
+ *
+ */
+ __pyx_v_direct_copy = 0;
+
+ /* "View.MemoryView":1238
+ * cdef __Pyx_memviewslice tmp
+ *
+ * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ */
+ __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1239
+ *
+ * if src_ndim < dst_ndim:
+ * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
+ * elif dst_ndim < src_ndim:
+ * broadcast_leading(&dst, dst_ndim, src_ndim)
+ */
+ __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":1240
+ * if src_ndim < dst_ndim:
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&dst, dst_ndim, src_ndim)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1241
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
+ *
+ * cdef int ndim = max(src_ndim, dst_ndim)
+ */
+ __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1243
+ * broadcast_leading(&dst, dst_ndim, src_ndim)
+ *
+ * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim):
+ */
+ __pyx_t_3 = __pyx_v_dst_ndim;
+ __pyx_t_4 = __pyx_v_src_ndim;
+ if (((__pyx_t_3 > __pyx_t_4) != 0)) {
+ __pyx_t_5 = __pyx_t_3;
+ } else {
+ __pyx_t_5 = __pyx_t_4;
+ }
+ __pyx_v_ndim = __pyx_t_5;
+
+ /* "View.MemoryView":1245
+ * cdef int ndim = max(src_ndim, dst_ndim)
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1:
+ */
+ __pyx_t_5 = __pyx_v_ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1246
+ *
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ */
+ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1247
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1: # <<<<<<<<<<<<<<
+ * broadcasting = True
+ * src.strides[i] = 0
+ */
+ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1248
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1:
+ * broadcasting = True # <<<<<<<<<<<<<<
+ * src.strides[i] = 0
+ * else:
+ */
+ __pyx_v_broadcasting = 1;
+
+ /* "View.MemoryView":1249
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ * src.strides[i] = 0 # <<<<<<<<<<<<<<
+ * else:
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ */
+ (__pyx_v_src.strides[__pyx_v_i]) = 0;
+ goto __pyx_L7;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1251
+ * src.strides[i] = 0
+ * else:
+ * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
+ *
+ * if src.suboffsets[i] >= 0:
+ */
+ __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L7:;
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":1253
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ *
+ * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ */
+ __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1254
+ *
+ * if src.suboffsets[i] >= 0:
+ * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
+ *
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ */
+ __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+ }
+
+ /* "View.MemoryView":1256
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
+ *
+ * if not slice_is_contig(&src, order, ndim):
+ */
+ __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1258
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ *
+ * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<<
+ * order = get_best_order(&dst, ndim)
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_memviewslice_is_contig((&__pyx_v_src), __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1259
+ *
+ * if not slice_is_contig(&src, order, ndim):
+ * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
+ *
+ * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
+ */
+ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
+ goto __pyx_L10;
+ }
+ __pyx_L10:;
+
+ /* "View.MemoryView":1261
+ * order = get_best_order(&dst, ndim)
+ *
+ * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
+ * src = tmp
+ *
+ */
+ __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_tmpdata = __pyx_t_6;
+
+ /* "View.MemoryView":1262
+ *
+ * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
+ * src = tmp # <<<<<<<<<<<<<<
+ *
+ * if not broadcasting:
+ */
+ __pyx_v_src = __pyx_v_tmp;
+ goto __pyx_L9;
+ }
+ __pyx_L9:;
+
+ /* "View.MemoryView":1264
+ * src = tmp
+ *
+ * if not broadcasting: # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1267
+ *
+ *
+ * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(&dst, 'C', ndim)
+ * elif slice_is_contig(&src, 'F', ndim):
+ */
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'C', __pyx_v_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1268
+ *
+ * if slice_is_contig(&src, 'C', ndim):
+ * direct_copy = slice_is_contig(&dst, 'C', ndim) # <<<<<<<<<<<<<<
+ * elif slice_is_contig(&src, 'F', ndim):
+ * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ */
+ __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'C', __pyx_v_ndim);
+ goto __pyx_L12;
+ }
+
+ /* "View.MemoryView":1269
+ * if slice_is_contig(&src, 'C', ndim):
+ * direct_copy = slice_is_contig(&dst, 'C', ndim)
+ * elif slice_is_contig(&src, 'F', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ *
+ */
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'F', __pyx_v_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1270
+ * direct_copy = slice_is_contig(&dst, 'C', ndim)
+ * elif slice_is_contig(&src, 'F', ndim):
+ * direct_copy = slice_is_contig(&dst, 'F', ndim) # <<<<<<<<<<<<<<
+ *
+ * if direct_copy:
+ */
+ __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'F', __pyx_v_ndim);
+ goto __pyx_L12;
+ }
+ __pyx_L12:;
+
+ /* "View.MemoryView":1272
+ * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ *
+ * if direct_copy: # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
+ __pyx_t_2 = (__pyx_v_direct_copy != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1274
+ * if direct_copy:
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
+
+ /* "View.MemoryView":1275
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ * free(tmpdata)
+ */
+ memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));
+
+ /* "View.MemoryView":1276
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
+ * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
+ * free(tmpdata)
+ * return 0
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
+
+ /* "View.MemoryView":1277
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ * free(tmpdata) # <<<<<<<<<<<<<<
+ * return 0
+ *
+ */
+ free(__pyx_v_tmpdata);
+
+ /* "View.MemoryView":1278
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ * free(tmpdata)
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ * if order == 'F' == get_best_order(&dst, ndim):
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+ goto __pyx_L11;
+ }
+ __pyx_L11:;
+
+ /* "View.MemoryView":1280
+ * return 0
+ *
+ * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = (__pyx_v_order == 'F');
+ if (__pyx_t_2) {
+ __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
+ }
+ __pyx_t_7 = (__pyx_t_2 != 0);
+ if (__pyx_t_7) {
+
+ /* "View.MemoryView":1283
+ *
+ *
+ * transpose_memslice(&src) # <<<<<<<<<<<<<<
+ * transpose_memslice(&dst)
+ *
+ */
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":1284
+ *
+ * transpose_memslice(&src)
+ * transpose_memslice(&dst) # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L14;
+ }
+ __pyx_L14:;
+
+ /* "View.MemoryView":1286
+ * transpose_memslice(&dst)
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
+ * copy_strided_to_strided(&src, &dst, ndim, itemsize)
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
+
+ /* "View.MemoryView":1287
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ *
+ */
+ copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
+
+ /* "View.MemoryView":1288
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * copy_strided_to_strided(&src, &dst, ndim, itemsize)
+ * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
+ *
+ * free(tmpdata)
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
+
+ /* "View.MemoryView":1290
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ *
+ * free(tmpdata) # <<<<<<<<<<<<<<
+ * return 0
+ *
+ */
+ free(__pyx_v_tmpdata);
+
+ /* "View.MemoryView":1291
+ *
+ * free(tmpdata)
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_broadcast_leading')
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1222
+ *
+ * @cname('__pyx_memoryview_copy_contents')
+ * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice dst,
+ * int src_ndim, int dst_ndim,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = -1;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1294
+ *
+ * @cname('__pyx_memoryview_broadcast_leading')
+ * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * int ndim_other) nogil:
+ */
+
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
+ int __pyx_v_i;
+ int __pyx_v_offset;
+ int __pyx_t_1;
+ int __pyx_t_2;
+
+ /* "View.MemoryView":1298
+ * int ndim_other) nogil:
+ * cdef int i
+ * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim - 1, -1, -1):
+ */
+ __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
+
+ /* "View.MemoryView":1300
+ * cdef int offset = ndim_other - ndim
+ *
+ * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
+ * slice.shape[i + offset] = slice.shape[i]
+ * slice.strides[i + offset] = slice.strides[i]
+ */
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ __pyx_v_i = __pyx_t_1;
+
+ /* "View.MemoryView":1301
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * slice.shape[i + offset] = slice.shape[i] # <<<<<<<<<<<<<<
+ * slice.strides[i + offset] = slice.strides[i]
+ * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ */
+ (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]);
+
+ /* "View.MemoryView":1302
+ * for i in range(ndim - 1, -1, -1):
+ * slice.shape[i + offset] = slice.shape[i]
+ * slice.strides[i + offset] = slice.strides[i] # <<<<<<<<<<<<<<
+ * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ *
+ */
+ (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]);
+
+ /* "View.MemoryView":1303
+ * slice.shape[i + offset] = slice.shape[i]
+ * slice.strides[i + offset] = slice.strides[i]
+ * slice.suboffsets[i + offset] = slice.suboffsets[i] # <<<<<<<<<<<<<<
+ *
+ * for i in range(offset):
+ */
+ (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]);
+ }
+
+ /* "View.MemoryView":1305
+ * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ *
+ * for i in range(offset): # <<<<<<<<<<<<<<
+ * slice.shape[i] = 1
+ * slice.strides[i] = slice.strides[0]
+ */
+ __pyx_t_1 = __pyx_v_offset;
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "View.MemoryView":1306
+ *
+ * for i in range(offset):
+ * slice.shape[i] = 1 # <<<<<<<<<<<<<<
+ * slice.strides[i] = slice.strides[0]
+ * slice.suboffsets[i] = -1
+ */
+ (__pyx_v_slice->shape[__pyx_v_i]) = 1;
+
+ /* "View.MemoryView":1307
+ * for i in range(offset):
+ * slice.shape[i] = 1
+ * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<<
+ * slice.suboffsets[i] = -1
+ *
+ */
+ (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]);
+
+ /* "View.MemoryView":1308
+ * slice.shape[i] = 1
+ * slice.strides[i] = slice.strides[0]
+ * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1;
+ }
+
+ /* "View.MemoryView":1294
+ *
+ * @cname('__pyx_memoryview_broadcast_leading')
+ * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * int ndim_other) nogil:
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1316
+ *
+ * @cname('__pyx_memoryview_refcount_copying')
+ * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
+ * int ndim, bint inc) nogil:
+ *
+ */
+
+static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
+ int __pyx_t_1;
+
+ /* "View.MemoryView":1320
+ *
+ *
+ * if dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
+ * dst.strides, ndim, inc)
+ */
+ __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1321
+ *
+ * if dtype_is_object:
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
+ * dst.strides, ndim, inc)
+ *
+ */
+ __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1316
+ *
+ * @cname('__pyx_memoryview_refcount_copying')
+ * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
+ * int ndim, bint inc) nogil:
+ *
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1325
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
+ * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * bint inc) with gil:
+ */
+
+static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
+ __Pyx_RefNannyDeclarations
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
+
+ /* "View.MemoryView":1328
+ * Py_ssize_t *strides, int ndim,
+ * bint inc) with gil:
+ * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice')
+ */
+ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
+
+ /* "View.MemoryView":1325
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
+ * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * bint inc) with gil:
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+}
+
+/* "View.MemoryView":1331
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice')
+ * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim, bint inc):
+ * cdef Py_ssize_t i
+ */
+
+static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
+ CYTHON_UNUSED Py_ssize_t __pyx_v_i;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ Py_ssize_t __pyx_t_2;
+ int __pyx_t_3;
+ __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
+
+ /* "View.MemoryView":1335
+ * cdef Py_ssize_t i
+ *
+ * for i in range(shape[0]): # <<<<<<<<<<<<<<
+ * if ndim == 1:
+ * if inc:
+ */
+ __pyx_t_1 = (__pyx_v_shape[0]);
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "View.MemoryView":1336
+ *
+ * for i in range(shape[0]):
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0])
+ */
+ __pyx_t_3 = ((__pyx_v_ndim == 1) != 0);
+ if (__pyx_t_3) {
+
+ /* "View.MemoryView":1337
+ * for i in range(shape[0]):
+ * if ndim == 1:
+ * if inc: # <<<<<<<<<<<<<<
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ */
+ __pyx_t_3 = (__pyx_v_inc != 0);
+ if (__pyx_t_3) {
+
+ /* "View.MemoryView":1338
+ * if ndim == 1:
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
+ * else:
+ * Py_DECREF((<PyObject **> data)[0])
+ */
+ Py_INCREF((((PyObject **)__pyx_v_data)[0]));
+ goto __pyx_L6;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1340
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1,
+ */
+ Py_DECREF((((PyObject **)__pyx_v_data)[0]));
+ }
+ __pyx_L6:;
+ goto __pyx_L5;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1342
+ * Py_DECREF((<PyObject **> data)[0])
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
+ * ndim - 1, inc)
+ *
+ */
+ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":1345
+ * ndim - 1, inc)
+ *
+ * data += strides[0] # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
+ }
+
+ /* "View.MemoryView":1331
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice')
+ * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim, bint inc):
+ * cdef Py_ssize_t i
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":1351
+ *
+ * @cname('__pyx_memoryview_slice_assign_scalar')
+ * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
+ * size_t itemsize, void *item,
+ * bint dtype_is_object) nogil:
+ */
+
+static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
+
+ /* "View.MemoryView":1354
+ * size_t itemsize, void *item,
+ * bint dtype_is_object) nogil:
+ * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
+ * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
+ * itemsize, item)
+ */
+ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
+
+ /* "View.MemoryView":1355
+ * bint dtype_is_object) nogil:
+ * refcount_copying(dst, dtype_is_object, ndim, False)
+ * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
+ * itemsize, item)
+ * refcount_copying(dst, dtype_is_object, ndim, True)
+ */
+ __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
+
+ /* "View.MemoryView":1357
+ * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
+ * itemsize, item)
+ * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
+
+ /* "View.MemoryView":1351
+ *
+ * @cname('__pyx_memoryview_slice_assign_scalar')
+ * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
+ * size_t itemsize, void *item,
+ * bint dtype_is_object) nogil:
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1361
+ *
+ * @cname('__pyx_memoryview__slice_assign_scalar')
+ * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * size_t itemsize, void *item) nogil:
+ */
+
+static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
+ CYTHON_UNUSED Py_ssize_t __pyx_v_i;
+ Py_ssize_t __pyx_v_stride;
+ Py_ssize_t __pyx_v_extent;
+ int __pyx_t_1;
+ Py_ssize_t __pyx_t_2;
+ Py_ssize_t __pyx_t_3;
+
+ /* "View.MemoryView":1365
+ * size_t itemsize, void *item) nogil:
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ */
+ __pyx_v_stride = (__pyx_v_strides[0]);
+
+ /* "View.MemoryView":1366
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t stride = strides[0]
+ * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
+ *
+ * if ndim == 1:
+ */
+ __pyx_v_extent = (__pyx_v_shape[0]);
+
+ /* "View.MemoryView":1368
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ */
+ __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1369
+ *
+ * if ndim == 1:
+ * for i in range(extent): # <<<<<<<<<<<<<<
+ * memcpy(data, item, itemsize)
+ * data += stride
+ */
+ __pyx_t_2 = __pyx_v_extent;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1370
+ * if ndim == 1:
+ * for i in range(extent):
+ * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
+ * data += stride
+ * else:
+ */
+ memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);
+
+ /* "View.MemoryView":1371
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ * data += stride # <<<<<<<<<<<<<<
+ * else:
+ * for i in range(extent):
+ */
+ __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
+ }
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1373
+ * data += stride
+ * else:
+ * for i in range(extent): # <<<<<<<<<<<<<<
+ * _slice_assign_scalar(data, shape + 1, strides + 1,
+ * ndim - 1, itemsize, item)
+ */
+ __pyx_t_2 = __pyx_v_extent;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1374
+ * else:
+ * for i in range(extent):
+ * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
+ * ndim - 1, itemsize, item)
+ * data += stride
+ */
+ __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
+
+ /* "View.MemoryView":1376
+ * _slice_assign_scalar(data, shape + 1, strides + 1,
+ * ndim - 1, itemsize, item)
+ * data += stride # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
+ }
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1361
+ *
+ * @cname('__pyx_memoryview__slice_assign_scalar')
+ * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * size_t itemsize, void *item) nogil:
+ */
+
+ /* function exit code */
+}
+
+static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_array_obj *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_array_obj *)o);
+ p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) {
+ Py_DECREF(o); o = 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_array(PyObject *o) {
+ struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_array___dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ Py_CLEAR(p->mode);
+ Py_CLEAR(p->_format);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
+ PyObject *r;
+ PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
+ r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
+ Py_DECREF(x);
+ return r;
+}
+
+static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
+ if (v) {
+ return __pyx_array___setitem__(o, i, v);
+ }
+ else {
+ PyErr_Format(PyExc_NotImplementedError,
+ "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
+ return -1;
+ }
+}
+
+static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
+ PyObject *v = PyObject_GenericGetAttr(o, n);
+ if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Clear();
+ v = __pyx_array___getattr__(o, n);
+ }
+ return v;
+}
+
+static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
+ return get_memview(o);
+}
+
+static PyMethodDef __pyx_methods_array[] = {
+ {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_array[] = {
+ {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PySequenceMethods __pyx_tp_as_sequence_array = {
+ 0, /*sq_length*/
+ 0, /*sq_concat*/
+ 0, /*sq_repeat*/
+ __pyx_sq_item_array, /*sq_item*/
+ 0, /*sq_slice*/
+ 0, /*sq_ass_item*/
+ 0, /*sq_ass_slice*/
+ 0, /*sq_contains*/
+ 0, /*sq_inplace_concat*/
+ 0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping_array = {
+ 0, /*mp_length*/
+ __pyx_array___getitem__, /*mp_subscript*/
+ __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
+};
+
+static PyBufferProcs __pyx_tp_as_buffer_array = {
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getreadbuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getwritebuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getsegcount*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getcharbuffer*/
+ #endif
+ __pyx_array_getbuffer, /*bf_getbuffer*/
+ 0, /*bf_releasebuffer*/
+};
+
+static PyTypeObject __pyx_type___pyx_array = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "fabio.ext._cif.array", /*tp_name*/
+ sizeof(struct __pyx_array_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_array, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ __pyx_tp_getattro_array, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /*tp_doc*/
+ 0, /*tp_traverse*/
+ 0, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_array, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_array, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_array, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+
+static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_MemviewEnum_obj *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_MemviewEnum_obj *)o);
+ p->name = Py_None; Py_INCREF(Py_None);
+ return o;
+}
+
+static void __pyx_tp_dealloc_Enum(PyObject *o) {
+ struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->name);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
+ if (p->name) {
+ e = (*v)(p->name, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_Enum(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
+ tmp = ((PyObject*)p->name);
+ p->name = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyMethodDef __pyx_methods_Enum[] = {
+ {0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type___pyx_MemviewEnum = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "fabio.ext._cif.Enum", /*tp_name*/
+ sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_Enum, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ __pyx_MemviewEnum___repr__, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_Enum, /*tp_traverse*/
+ __pyx_tp_clear_Enum, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_Enum, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ __pyx_MemviewEnum___init__, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_Enum, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
+
+static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_memoryview_obj *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_memoryview_obj *)o);
+ p->__pyx_vtab = __pyx_vtabptr_memoryview;
+ p->obj = Py_None; Py_INCREF(Py_None);
+ p->_size = Py_None; Py_INCREF(Py_None);
+ p->_array_interface = Py_None; Py_INCREF(Py_None);
+ p->view.obj = NULL;
+ if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) {
+ Py_DECREF(o); o = 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_memoryview(PyObject *o) {
+ struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_memoryview___dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ Py_CLEAR(p->obj);
+ Py_CLEAR(p->_size);
+ Py_CLEAR(p->_array_interface);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
+ if (p->obj) {
+ e = (*v)(p->obj, a); if (e) return e;
+ }
+ if (p->_size) {
+ e = (*v)(p->_size, a); if (e) return e;
+ }
+ if (p->_array_interface) {
+ e = (*v)(p->_array_interface, a); if (e) return e;
+ }
+ if (p->view.obj) {
+ e = (*v)(p->view.obj, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_memoryview(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
+ tmp = ((PyObject*)p->obj);
+ p->obj = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_size);
+ p->_size = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_array_interface);
+ p->_array_interface = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ Py_CLEAR(p->view.obj);
+ return 0;
+}
+static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
+ PyObject *r;
+ PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
+ r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
+ Py_DECREF(x);
+ return r;
+}
+
+static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
+ if (v) {
+ return __pyx_memoryview___setitem__(o, i, v);
+ }
+ else {
+ PyErr_Format(PyExc_NotImplementedError,
+ "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
+ return -1;
+ }
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_transpose(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview__get__base(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_shape(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_strides(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_suboffsets(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_ndim(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_itemsize(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_nbytes(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_size(o);
+}
+
+static PyMethodDef __pyx_methods_memoryview[] = {
+ {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
+ {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
+ {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
+ {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_memoryview[] = {
+ {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
+ {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
+ {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
+ {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
+ {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
+ {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
+ {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
+ {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
+ __pyx_memoryview___len__, /*sq_length*/
+ 0, /*sq_concat*/
+ 0, /*sq_repeat*/
+ __pyx_sq_item_memoryview, /*sq_item*/
+ 0, /*sq_slice*/
+ 0, /*sq_ass_item*/
+ 0, /*sq_ass_slice*/
+ 0, /*sq_contains*/
+ 0, /*sq_inplace_concat*/
+ 0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
+ __pyx_memoryview___len__, /*mp_length*/
+ __pyx_memoryview___getitem__, /*mp_subscript*/
+ __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
+};
+
+static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getreadbuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getwritebuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getsegcount*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getcharbuffer*/
+ #endif
+ __pyx_memoryview_getbuffer, /*bf_getbuffer*/
+ 0, /*bf_releasebuffer*/
+};
+
+static PyTypeObject __pyx_type___pyx_memoryview = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "fabio.ext._cif.memoryview", /*tp_name*/
+ sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ __pyx_memoryview___repr__, /*tp_repr*/
+ 0, /*tp_as_number*/
+ &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ __pyx_memoryview___str__, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_memoryview, /*tp_traverse*/
+ __pyx_tp_clear_memoryview, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_memoryview, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_memoryview, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_memoryview, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
+
+static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_memoryviewslice_obj *p;
+ PyObject *o = __pyx_tp_new_memoryview(t, a, k);
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_memoryviewslice_obj *)o);
+ p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
+ p->from_object = Py_None; Py_INCREF(Py_None);
+ p->from_slice.memview = NULL;
+ return o;
+}
+
+static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
+ struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_memoryviewslice___dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ Py_CLEAR(p->from_object);
+ PyObject_GC_Track(o);
+ __pyx_tp_dealloc_memoryview(o);
+}
+
+static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
+ e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
+ if (p->from_object) {
+ e = (*v)(p->from_object, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
+ __pyx_tp_clear_memoryview(o);
+ tmp = ((PyObject*)p->from_object);
+ p->from_object = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
+ return 0;
+}
+
+static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryviewslice__get__base(o);
+}
+
+static PyMethodDef __pyx_methods__memoryviewslice[] = {
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
+ {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type___pyx_memoryviewslice = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "fabio.ext._cif._memoryviewslice", /*tp_name*/
+ sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ #if CYTHON_COMPILING_IN_PYPY
+ __pyx_memoryview___repr__, /*tp_repr*/
+ #else
+ 0, /*tp_repr*/
+ #endif
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ #if CYTHON_COMPILING_IN_PYPY
+ __pyx_memoryview___str__, /*tp_str*/
+ #else
+ 0, /*tp_str*/
+ #endif
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ "Internal class for passing memoryview slices to Python", /*tp_doc*/
+ __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
+ __pyx_tp_clear__memoryviewslice, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods__memoryviewslice, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets__memoryviewslice, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new__memoryviewslice, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef __pyx_moduledef = {
+ #if PY_VERSION_HEX < 0x03020000
+ { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
+ #else
+ PyModuleDef_HEAD_INIT,
+ #endif
+ "_cif",
+ __pyx_k_Cif_parser_helper_functions, /* m_doc */
+ -1, /* m_size */
+ __pyx_methods /* m_methods */,
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_kp_b_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 0, 0},
+ {&__pyx_kp_s_2014_European_Synchrotron_Radiat, __pyx_k_2014_European_Synchrotron_Radiat, sizeof(__pyx_k_2014_European_Synchrotron_Radiat), 0, 0, 1, 0},
+ {&__pyx_kp_s_25_07_2017, __pyx_k_25_07_2017, sizeof(__pyx_k_25_07_2017), 0, 0, 1, 0},
+ {&__pyx_n_s_BINARY_MARKER, __pyx_k_BINARY_MARKER, sizeof(__pyx_k_BINARY_MARKER), 0, 0, 1, 1},
+ {&__pyx_n_s_BLANK, __pyx_k_BLANK, sizeof(__pyx_k_BLANK), 0, 0, 1, 1},
+ {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
+ {&__pyx_kp_b_CIF_BINARY_FORMAT_SECTION, __pyx_k_CIF_BINARY_FORMAT_SECTION, sizeof(__pyx_k_CIF_BINARY_FORMAT_SECTION), 0, 0, 0, 0},
+ {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
+ {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
+ {&__pyx_n_s_DASH, __pyx_k_DASH, sizeof(__pyx_k_DASH), 0, 0, 1, 1},
+ {&__pyx_n_s_DOUBLE_QUOTE, __pyx_k_DOUBLE_QUOTE, sizeof(__pyx_k_DOUBLE_QUOTE), 0, 0, 1, 1},
+ {&__pyx_n_s_EOL, __pyx_k_EOL, sizeof(__pyx_k_EOL), 0, 0, 1, 1},
+ {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
+ {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
+ {&__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_n_s_HASH, __pyx_k_HASH, sizeof(__pyx_k_HASH), 0, 0, 1, 1},
+ {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
+ {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
+ {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
+ {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
+ {&__pyx_kp_s_Jerome_Kieffer, __pyx_k_Jerome_Kieffer, sizeof(__pyx_k_Jerome_Kieffer), 0, 0, 1, 0},
+ {&__pyx_n_s_MIT, __pyx_k_MIT, sizeof(__pyx_k_MIT), 0, 0, 1, 1},
+ {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
+ {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
+ {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 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_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
+ {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
+ {&__pyx_n_s_QUESTIONMARK, __pyx_k_QUESTIONMARK, sizeof(__pyx_k_QUESTIONMARK), 0, 0, 1, 1},
+ {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
+ {&__pyx_n_s_SEMICOLUMN, __pyx_k_SEMICOLUMN, sizeof(__pyx_k_SEMICOLUMN), 0, 0, 1, 1},
+ {&__pyx_n_s_SINGLE_QUOTE, __pyx_k_SINGLE_QUOTE, sizeof(__pyx_k_SINGLE_QUOTE), 0, 0, 1, 1},
+ {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
+ {&__pyx_n_s_UNDERSCORE, __pyx_k_UNDERSCORE, sizeof(__pyx_k_UNDERSCORE), 0, 0, 1, 1},
+ {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
+ {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
+ {&__pyx_kp_b__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 0, 0},
+ {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
+ {&__pyx_n_s_ary, __pyx_k_ary, sizeof(__pyx_k_ary), 0, 0, 1, 1},
+ {&__pyx_n_s_author, __pyx_k_author, sizeof(__pyx_k_author), 0, 0, 1, 1},
+ {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
+ {&__pyx_n_s_bytes_text, __pyx_k_bytes_text, sizeof(__pyx_k_bytes_text), 0, 0, 1, 1},
+ {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
+ {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
+ {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
+ {&__pyx_n_s_contact, __pyx_k_contact, sizeof(__pyx_k_contact), 0, 0, 1, 1},
+ {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
+ {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
+ {&__pyx_n_s_copyright, __pyx_k_copyright, sizeof(__pyx_k_copyright), 0, 0, 1, 1},
+ {&__pyx_n_s_cur, __pyx_k_cur, sizeof(__pyx_k_cur), 0, 0, 1, 1},
+ {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1},
+ {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
+ {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
+ {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
+ {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
+ {&__pyx_n_s_fabio_ext__cif, __pyx_k_fabio_ext__cif, sizeof(__pyx_k_fabio_ext__cif), 0, 0, 1, 1},
+ {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1},
+ {&__pyx_n_s_find, __pyx_k_find, sizeof(__pyx_k_find), 0, 0, 1, 1},
+ {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
+ {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
+ {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
+ {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
+ {&__pyx_n_s_go_on, __pyx_k_go_on, sizeof(__pyx_k_go_on), 0, 0, 1, 1},
+ {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
+ {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
+ {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
+ {&__pyx_n_s_imax, __pyx_k_imax, sizeof(__pyx_k_imax), 0, 0, 1, 1},
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+ {&__pyx_n_s_in_comment, __pyx_k_in_comment, sizeof(__pyx_k_in_comment), 0, 0, 1, 1},
+ {&__pyx_n_s_in_double_quote, __pyx_k_in_double_quote, sizeof(__pyx_k_in_double_quote), 0, 0, 1, 1},
+ {&__pyx_n_s_in_single_quote, __pyx_k_in_single_quote, sizeof(__pyx_k_in_single_quote), 0, 0, 1, 1},
+ {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
+ {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
+ {&__pyx_kp_s_jerome_kieffer_esrf_eu, __pyx_k_jerome_kieffer_esrf_eu, sizeof(__pyx_k_jerome_kieffer_esrf_eu), 0, 0, 1, 0},
+ {&__pyx_n_s_lbms, __pyx_k_lbms, sizeof(__pyx_k_lbms), 0, 0, 1, 1},
+ {&__pyx_n_s_license, __pyx_k_license, sizeof(__pyx_k_license), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
+ {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
+ {&__pyx_n_s_multiline, __pyx_k_multiline, sizeof(__pyx_k_multiline), 0, 0, 1, 1},
+ {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
+ {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
+ {&__pyx_kp_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_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
+ {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1},
+ {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+ {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
+ {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
+ {&__pyx_n_s_prev, __pyx_k_prev, sizeof(__pyx_k_prev), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
+ {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+ {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
+ {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
+ {&__pyx_n_s_split_tokens, __pyx_k_split_tokens, sizeof(__pyx_k_split_tokens), 0, 0, 1, 1},
+ {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
+ {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
+ {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
+ {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
+ {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
+ {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
+ {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
+ {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
+ {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 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_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
+ {&__pyx_kp_s_workspace_valls_fabio_git_fabio, __pyx_k_workspace_valls_fabio_git_fabio, sizeof(__pyx_k_workspace_valls_fabio_git_fabio), 0, 0, 1, 0},
+ {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static int __Pyx_InitCachedBuiltins(void) {
+ __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_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 228; __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;}
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if PY_MAJOR_VERSION >= 3
+ __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__3);
+ __Pyx_GIVEREF(__pyx_tuple__3);
+
+ /* "../../../usr/lib/python2.7/dist-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_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__4);
+ __Pyx_GIVEREF(__pyx_tuple__4);
+
+ /* "../../../usr/lib/python2.7/dist-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_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 = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__5);
+ __Pyx_GIVEREF(__pyx_tuple__5);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
+ *
+ * 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_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__6);
+ __Pyx_GIVEREF(__pyx_tuple__6);
+
+ /* "../../../usr/lib/python2.7/dist-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_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__7);
+ __Pyx_GIVEREF(__pyx_tuple__7);
+
+ /* "../../../usr/lib/python2.7/dist-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_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__8);
+ __Pyx_GIVEREF(__pyx_tuple__8);
+
+ /* "View.MemoryView":127
+ *
+ * if not self.ndim:
+ * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if itemsize <= 0:
+ */
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__9);
+ __Pyx_GIVEREF(__pyx_tuple__9);
+
+ /* "View.MemoryView":130
+ *
+ * if itemsize <= 0:
+ * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if isinstance(format, unicode):
+ */
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__10);
+ __Pyx_GIVEREF(__pyx_tuple__10);
+
+ /* "View.MemoryView":142
+ *
+ * if not self._shape:
+ * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__11);
+ __Pyx_GIVEREF(__pyx_tuple__11);
+
+ /* "View.MemoryView":170
+ * self.data = <char *>malloc(self.len)
+ * if not self.data:
+ * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
+ *
+ * if self.dtype_is_object:
+ */
+ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__12);
+ __Pyx_GIVEREF(__pyx_tuple__12);
+
+ /* "View.MemoryView":186
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
+ * info.buf = self.data
+ * info.len = self.len
+ */
+ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__13);
+ __Pyx_GIVEREF(__pyx_tuple__13);
+
+ /* "View.MemoryView":445
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
+ * else:
+ * if len(self.view.format) == 1:
+ */
+ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__14);
+ __Pyx_GIVEREF(__pyx_tuple__14);
+
+ /* "View.MemoryView":521
+ * if self.view.strides == NULL:
+ *
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ *
+ * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ */
+ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__15);
+ __Pyx_GIVEREF(__pyx_tuple__15);
+
+ /* "View.MemoryView":638
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
+ * seen_ellipsis = True
+ * else:
+ */
+ __pyx_slice__16 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_slice__16);
+ __Pyx_GIVEREF(__pyx_slice__16);
+
+ /* "View.MemoryView":641
+ * seen_ellipsis = True
+ * else:
+ * result.append(slice(None)) # <<<<<<<<<<<<<<
+ * have_slices = True
+ * else:
+ */
+ __pyx_slice__17 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_slice__17);
+ __Pyx_GIVEREF(__pyx_slice__17);
+
+ /* "View.MemoryView":652
+ * nslices = ndim - len(result)
+ * if nslices:
+ * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
+ *
+ * return have_slices or nslices, tuple(result)
+ */
+ __pyx_slice__18 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__18)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_slice__18);
+ __Pyx_GIVEREF(__pyx_slice__18);
+
+ /* "View.MemoryView":660
+ * for i in range(ndim):
+ * if suboffsets[i] >= 0:
+ * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__19);
+ __Pyx_GIVEREF(__pyx_tuple__19);
+
+ /* "fabio/ext/_cif.pyx":42
+ *
+ * @cython.boundscheck(False)
+ * def split_tokens(bytes_text): # <<<<<<<<<<<<<<
+ * """
+ * Separate the text representing a CIF file into a list of tokens.
+ */
+ __pyx_tuple__20 = PyTuple_Pack(26, __pyx_n_s_bytes_text, __pyx_n_s_ary, __pyx_n_s_in_comment, __pyx_n_s_in_single_quote, __pyx_n_s_in_double_quote, __pyx_n_s_multiline, __pyx_n_s_go_on, __pyx_n_s_i, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_imax, __pyx_n_s_prev, __pyx_n_s_next, __pyx_n_s_cur, __pyx_n_s_EOL, __pyx_n_s_BLANK, __pyx_n_s_SINGLE_QUOTE, __pyx_n_s_DOUBLE_QUOTE, __pyx_n_s_SEMICOLUMN, __pyx_n_s_HASH, __pyx_n_s_UNDERSCORE, __pyx_n_s_DASH, __pyx_n_s_QUESTIONMARK, __pyx_n_s_BINARY_MARKER, __pyx_n_s_lbms, __pyx_n_s_fields); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__20);
+ __Pyx_GIVEREF(__pyx_tuple__20);
+ __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 26, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_workspace_valls_fabio_git_fabio, __pyx_n_s_split_tokens, 42, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":276
+ * return self.name
+ *
+ * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>")
+ */
+ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__22);
+ __Pyx_GIVEREF(__pyx_tuple__22);
+
+ /* "View.MemoryView":277
+ *
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
+ * cdef indirect = Enum("<strided and indirect>")
+ *
+ */
+ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__23);
+ __Pyx_GIVEREF(__pyx_tuple__23);
+
+ /* "View.MemoryView":278
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__24);
+ __Pyx_GIVEREF(__pyx_tuple__24);
+
+ /* "View.MemoryView":281
+ *
+ *
+ * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>")
+ *
+ */
+ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__25);
+ __Pyx_GIVEREF(__pyx_tuple__25);
+
+ /* "View.MemoryView":282
+ *
+ * cdef contiguous = Enum("<contiguous and direct>")
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__26);
+ __Pyx_GIVEREF(__pyx_tuple__26);
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+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_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;
+}
+
+#if PY_MAJOR_VERSION < 3
+PyMODINIT_FUNC init_cif(void); /*proto*/
+PyMODINIT_FUNC init_cif(void)
+#else
+PyMODINIT_FUNC PyInit__cif(void); /*proto*/
+PyMODINIT_FUNC PyInit__cif(void)
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_REFNANNY
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+ if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+ }
+ #endif
+ __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__cif(void)", 0);
+ if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #ifdef __Pyx_CyFunction_USED
+ if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
+ /*--- Module creation code ---*/
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("_cif", __pyx_methods, __pyx_k_Cif_parser_helper_functions, 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_fabio__ext___cif) {
+ 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;}
+ if (!PyDict_GetItemString(modules, "fabio.ext._cif")) {
+ if (unlikely(PyDict_SetItemString(modules, "fabio.ext._cif", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+ /*--- 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 ---*/
+ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Global init code ---*/
+ generic = Py_None; Py_INCREF(Py_None);
+ strided = Py_None; Py_INCREF(Py_None);
+ indirect = Py_None; Py_INCREF(Py_None);
+ contiguous = Py_None; Py_INCREF(Py_None);
+ indirect_contiguous = Py_None; Py_INCREF(Py_None);
+ /*--- Variable export code ---*/
+ /*--- Function export code ---*/
+ /*--- Type init code ---*/
+ if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type___pyx_array.tp_print = 0;
+ __pyx_array_type = &__pyx_type___pyx_array;
+ if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type___pyx_MemviewEnum.tp_print = 0;
+ __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
+ __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
+ __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
+ __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
+ __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
+ __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
+ __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
+ __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
+ __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
+ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type___pyx_memoryview.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
+ __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
+ __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
+ __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
+ __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
+ __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
+ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type___pyx_memoryviewslice.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
+ /*--- Type import code ---*/
+ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
+ #if CYTHON_COMPILING_IN_PYPY
+ sizeof(PyTypeObject),
+ #else
+ sizeof(PyHeapTypeObject),
+ #endif
+ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Variable import code ---*/
+ /*--- Function import code ---*/
+ /*--- Execution code ---*/
+
+ /* "fabio/ext/_cif.pyx":30
+ * """Cif parser helper functions"""
+ *
+ * __author__ = "Jerome Kieffer" # <<<<<<<<<<<<<<
+ * __contact__ = "jerome.kieffer@esrf.eu"
+ * __license__ = "MIT"
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Jerome_Kieffer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/_cif.pyx":31
+ *
+ * __author__ = "Jerome Kieffer"
+ * __contact__ = "jerome.kieffer@esrf.eu" # <<<<<<<<<<<<<<
+ * __license__ = "MIT"
+ * __copyright__ = "2014, European Synchrotron Radiation Facility, Grenoble, France"
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_contact, __pyx_kp_s_jerome_kieffer_esrf_eu) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/_cif.pyx":32
+ * __author__ = "Jerome Kieffer"
+ * __contact__ = "jerome.kieffer@esrf.eu"
+ * __license__ = "MIT" # <<<<<<<<<<<<<<
+ * __copyright__ = "2014, European Synchrotron Radiation Facility, Grenoble, France"
+ * __date__ = "25/07/2017"
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/_cif.pyx":33
+ * __contact__ = "jerome.kieffer@esrf.eu"
+ * __license__ = "MIT"
+ * __copyright__ = "2014, European Synchrotron Radiation Facility, Grenoble, France" # <<<<<<<<<<<<<<
+ * __date__ = "25/07/2017"
+ *
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_2014_European_Synchrotron_Radiat) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/_cif.pyx":34
+ * __license__ = "MIT"
+ * __copyright__ = "2014, European Synchrotron Radiation Facility, Grenoble, France"
+ * __date__ = "25/07/2017" # <<<<<<<<<<<<<<
+ *
+ * cimport numpy
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_25_07_2017) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/_cif.pyx":37
+ *
+ * cimport numpy
+ * import numpy # <<<<<<<<<<<<<<
+ * import cython
+ *
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/_cif.pyx":42
+ *
+ * @cython.boundscheck(False)
+ * def split_tokens(bytes_text): # <<<<<<<<<<<<<<
+ * """
+ * Separate the text representing a CIF file into a list of tokens.
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5fabio_3ext_4_cif_1split_tokens, NULL, __pyx_n_s_fabio_ext__cif); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_split_tokens, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/_cif.pyx":1
+ * # coding: utf-8 # <<<<<<<<<<<<<<
+ * #
+ * # Project: X-ray image reader
+ */
+ __pyx_t_1 = PyDict_New(); 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 (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __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;
+
+ /* "View.MemoryView":203
+ * info.obj = self
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
+ *
+ * def __dealloc__(array self):
+ */
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ PyType_Modified(__pyx_array_type);
+
+ /* "View.MemoryView":276
+ * return self.name
+ *
+ * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>")
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(generic);
+ __Pyx_DECREF_SET(generic, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":277
+ *
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
+ * cdef indirect = Enum("<strided and indirect>")
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(strided);
+ __Pyx_DECREF_SET(strided, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":278
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(indirect);
+ __Pyx_DECREF_SET(indirect, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":281
+ *
+ *
+ * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>")
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(contiguous);
+ __Pyx_DECREF_SET(contiguous, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":282
+ *
+ * cdef contiguous = Enum("<contiguous and direct>")
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(indirect_contiguous);
+ __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":496
+ * info.obj = self
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ PyType_Modified(__pyx_memoryview_type);
+
+ /* "View.MemoryView":953
+ * return self.from_object
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ PyType_Modified(__pyx_memoryviewslice_type);
+
+ /* "View.MemoryView":1361
+ *
+ * @cname('__pyx_memoryview__slice_assign_scalar')
+ * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * size_t itemsize, void *item) nogil:
+ */
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init fabio.ext._cif", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_DECREF(__pyx_m); __pyx_m = 0;
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init fabio.ext._cif");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if PY_MAJOR_VERSION < 3
+ return;
+ #else
+ return __pyx_m;
+ #endif
+}
+
+/* Runtime support code */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+#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 PyObject* __Pyx_PyObject_GetSlice(
+ PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
+ PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
+ int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyMappingMethods* mp;
+#if PY_MAJOR_VERSION < 3
+ PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
+ if (likely(ms && ms->sq_slice)) {
+ if (!has_cstart) {
+ if (_py_start && (*_py_start != Py_None)) {
+ cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
+ if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
+ } else
+ cstart = 0;
+ }
+ if (!has_cstop) {
+ if (_py_stop && (*_py_stop != Py_None)) {
+ cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
+ if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
+ } else
+ cstop = PY_SSIZE_T_MAX;
+ }
+ if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
+ Py_ssize_t l = ms->sq_length(obj);
+ if (likely(l >= 0)) {
+ if (cstop < 0) {
+ cstop += l;
+ if (cstop < 0) cstop = 0;
+ }
+ if (cstart < 0) {
+ cstart += l;
+ if (cstart < 0) cstart = 0;
+ }
+ } else {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError))
+ PyErr_Clear();
+ else
+ goto bad;
+ }
+ }
+ return ms->sq_slice(obj, cstart, cstop);
+ }
+#endif
+ mp = Py_TYPE(obj)->tp_as_mapping;
+ if (likely(mp && mp->mp_subscript))
+#endif
+ {
+ PyObject* result;
+ PyObject *py_slice, *py_start, *py_stop;
+ if (_py_slice) {
+ py_slice = *_py_slice;
+ } else {
+ PyObject* owned_start = NULL;
+ PyObject* owned_stop = NULL;
+ if (_py_start) {
+ py_start = *_py_start;
+ } else {
+ if (has_cstart) {
+ owned_start = py_start = PyInt_FromSsize_t(cstart);
+ if (unlikely(!py_start)) goto bad;
+ } else
+ py_start = Py_None;
+ }
+ if (_py_stop) {
+ py_stop = *_py_stop;
+ } else {
+ if (has_cstop) {
+ owned_stop = py_stop = PyInt_FromSsize_t(cstop);
+ if (unlikely(!py_stop)) {
+ Py_XDECREF(owned_start);
+ goto bad;
+ }
+ } else
+ py_stop = Py_None;
+ }
+ py_slice = PySlice_New(py_start, py_stop, Py_None);
+ Py_XDECREF(owned_start);
+ Py_XDECREF(owned_stop);
+ if (unlikely(!py_slice)) goto bad;
+ }
+#if CYTHON_COMPILING_IN_CPYTHON
+ result = mp->mp_subscript(obj, py_slice);
+#else
+ result = PyObject_GetItem(obj, py_slice);
+#endif
+ if (!_py_slice) {
+ Py_DECREF(py_slice);
+ }
+ return result;
+ }
+ PyErr_Format(PyExc_TypeError,
+ "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
+bad:
+ return NULL;
+}
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+ PyObject *self, *result;
+ PyCFunction cfunc;
+ cfunc = PyCFunction_GET_FUNCTION(func);
+ self = PyCFunction_GET_SELF(func);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = cfunc(self, arg);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_New(1);
+ if (unlikely(!args)) return NULL;
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(args, 0, arg);
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+ return __Pyx_PyObject_CallMethO(func, arg);
+ }
+ }
+ return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject* args = PyTuple_Pack(1, arg);
+ return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
+ return __Pyx_PyObject_CallMethO(func, NULL);
+ }
+ }
+ return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
+}
+#endif
+
+static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+#if CYTHON_COMPILING_IN_PYPY
+ return PyObject_RichCompareBool(s1, s2, equals);
+#else
+ if (s1 == s2) {
+ return (equals == Py_EQ);
+ } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
+ const char *ps1, *ps2;
+ Py_ssize_t length = PyBytes_GET_SIZE(s1);
+ if (length != PyBytes_GET_SIZE(s2))
+ return (equals == Py_NE);
+ ps1 = PyBytes_AS_STRING(s1);
+ ps2 = PyBytes_AS_STRING(s2);
+ if (ps1[0] != ps2[0]) {
+ return (equals == Py_NE);
+ } else if (length == 1) {
+ return (equals == Py_EQ);
+ } else {
+ int result = memcmp(ps1, ps2, (size_t)length);
+ return (equals == Py_EQ) ? (result == 0) : (result != 0);
+ }
+ } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
+ return (equals == Py_NE);
+ } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
+ return (equals == Py_NE);
+ } else {
+ int result;
+ PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
+ if (!py_result)
+ return -1;
+ result = __Pyx_PyObject_IsTrue(py_result);
+ Py_DECREF(py_result);
+ return result;
+ }
+#endif
+}
+
+static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
+ unsigned int n = 1;
+ return *(unsigned char*)(&n) != 0;
+}
+static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type) {
+ stack[0].field = &ctx->root;
+ stack[0].parent_offset = 0;
+ ctx->root.type = type;
+ ctx->root.name = "buffer dtype";
+ ctx->root.offset = 0;
+ ctx->head = stack;
+ ctx->head->field = &ctx->root;
+ ctx->fmt_offset = 0;
+ ctx->head->parent_offset = 0;
+ ctx->new_packmode = '@';
+ ctx->enc_packmode = '@';
+ ctx->new_count = 1;
+ ctx->enc_count = 0;
+ ctx->enc_type = 0;
+ ctx->is_complex = 0;
+ ctx->is_valid_array = 0;
+ ctx->struct_alignment = 0;
+ while (type->typegroup == 'S') {
+ ++ctx->head;
+ ctx->head->field = type->fields;
+ ctx->head->parent_offset = 0;
+ type = type->fields->type;
+ }
+}
+static int __Pyx_BufFmt_ParseNumber(const char** ts) {
+ int count;
+ const char* t = *ts;
+ if (*t < '0' || *t > '9') {
+ return -1;
+ } else {
+ count = *t++ - '0';
+ while (*t >= '0' && *t < '9') {
+ count *= 10;
+ count += *t++ - '0';
+ }
+ }
+ *ts = t;
+ return count;
+}
+static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
+ int number = __Pyx_BufFmt_ParseNumber(ts);
+ if (number == -1)
+ PyErr_Format(PyExc_ValueError,\
+ "Does not understand character buffer dtype format string ('%c')", **ts);
+ return number;
+}
+static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
+ PyErr_Format(PyExc_ValueError,
+ "Unexpected format string character: '%c'", ch);
+}
+static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
+ switch (ch) {
+ case 'c': return "'char'";
+ case 'b': return "'signed char'";
+ case 'B': return "'unsigned char'";
+ case 'h': return "'short'";
+ case 'H': return "'unsigned short'";
+ case 'i': return "'int'";
+ case 'I': return "'unsigned int'";
+ case 'l': return "'long'";
+ case 'L': return "'unsigned long'";
+ case 'q': return "'long long'";
+ case 'Q': return "'unsigned long long'";
+ case 'f': return (is_complex ? "'complex float'" : "'float'");
+ case 'd': return (is_complex ? "'complex double'" : "'double'");
+ case 'g': return (is_complex ? "'complex long double'" : "'long double'");
+ case 'T': return "a struct";
+ case 'O': return "Python object";
+ case 'P': return "a pointer";
+ case 's': case 'p': return "a string";
+ case 0: return "end";
+ default: return "unparseable format string";
+ }
+}
+static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return 2;
+ case 'i': case 'I': case 'l': case 'L': return 4;
+ case 'q': case 'Q': return 8;
+ case 'f': return (is_complex ? 8 : 4);
+ case 'd': return (is_complex ? 16 : 8);
+ case 'g': {
+ PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
+ return 0;
+ }
+ case 'O': case 'P': return sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
+ switch (ch) {
+ case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(short);
+ case 'i': case 'I': return sizeof(int);
+ case 'l': case 'L': return sizeof(long);
+ #ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(PY_LONG_LONG);
+ #endif
+ case 'f': return sizeof(float) * (is_complex ? 2 : 1);
+ case 'd': return sizeof(double) * (is_complex ? 2 : 1);
+ case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
+ case 'O': case 'P': return sizeof(void*);
+ default: {
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+ }
+}
+typedef struct { char c; short x; } __Pyx_st_short;
+typedef struct { char c; int x; } __Pyx_st_int;
+typedef struct { char c; long x; } __Pyx_st_long;
+typedef struct { char c; float x; } __Pyx_st_float;
+typedef struct { char c; double x; } __Pyx_st_double;
+typedef struct { char c; long double x; } __Pyx_st_longdouble;
+typedef struct { char c; void *x; } __Pyx_st_void_p;
+#ifdef HAVE_LONG_LONG
+typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
+#endif
+static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
+ case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
+ case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
+#ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
+#endif
+ case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
+ case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
+ case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
+ case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+/* These are for computing the padding at the end of the struct to align
+ on the first member of the struct. This will probably the same as above,
+ but we don't have any guarantees.
+ */
+typedef struct { short x; char c; } __Pyx_pad_short;
+typedef struct { int x; char c; } __Pyx_pad_int;
+typedef struct { long x; char c; } __Pyx_pad_long;
+typedef struct { float x; char c; } __Pyx_pad_float;
+typedef struct { double x; char c; } __Pyx_pad_double;
+typedef struct { long double x; char c; } __Pyx_pad_longdouble;
+typedef struct { void *x; char c; } __Pyx_pad_void_p;
+#ifdef HAVE_LONG_LONG
+typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
+#endif
+static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
+ case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
+ case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
+#ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
+#endif
+ case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
+ case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
+ case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
+ case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
+ switch (ch) {
+ case 'c':
+ return 'H';
+ case 'b': case 'h': case 'i':
+ case 'l': case 'q': case 's': case 'p':
+ return 'I';
+ case 'B': case 'H': case 'I': case 'L': case 'Q':
+ return 'U';
+ case 'f': case 'd': case 'g':
+ return (is_complex ? 'C' : 'R');
+ case 'O':
+ return 'O';
+ case 'P':
+ return 'P';
+ default: {
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+ }
+}
+static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
+ if (ctx->head == NULL || ctx->head->field == &ctx->root) {
+ const char* expected;
+ const char* quote;
+ if (ctx->head == NULL) {
+ expected = "end";
+ quote = "";
+ } else {
+ expected = ctx->head->field->type->name;
+ quote = "'";
+ }
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch, expected %s%s%s but got %s",
+ quote, expected, quote,
+ __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
+ } else {
+ __Pyx_StructField* field = ctx->head->field;
+ __Pyx_StructField* parent = (ctx->head - 1)->field;
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
+ field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
+ parent->type->name, field->name);
+ }
+}
+static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
+ char group;
+ size_t size, offset, arraysize = 1;
+ if (ctx->enc_type == 0) return 0;
+ if (ctx->head->field->type->arraysize[0]) {
+ int i, ndim = 0;
+ if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
+ ctx->is_valid_array = ctx->head->field->type->ndim == 1;
+ ndim = 1;
+ if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
+ PyErr_Format(PyExc_ValueError,
+ "Expected a dimension of size %zu, got %zu",
+ ctx->head->field->type->arraysize[0], ctx->enc_count);
+ return -1;
+ }
+ }
+ if (!ctx->is_valid_array) {
+ PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
+ ctx->head->field->type->ndim, ndim);
+ return -1;
+ }
+ for (i = 0; i < ctx->head->field->type->ndim; i++) {
+ arraysize *= ctx->head->field->type->arraysize[i];
+ }
+ ctx->is_valid_array = 0;
+ ctx->enc_count = 1;
+ }
+ group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
+ do {
+ __Pyx_StructField* field = ctx->head->field;
+ __Pyx_TypeInfo* type = field->type;
+ if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
+ size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
+ } else {
+ size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
+ }
+ if (ctx->enc_packmode == '@') {
+ size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
+ size_t align_mod_offset;
+ if (align_at == 0) return -1;
+ align_mod_offset = ctx->fmt_offset % align_at;
+ if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
+ if (ctx->struct_alignment == 0)
+ ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
+ ctx->is_complex);
+ }
+ if (type->size != size || type->typegroup != group) {
+ if (type->typegroup == 'C' && type->fields != NULL) {
+ size_t parent_offset = ctx->head->parent_offset + field->offset;
+ ++ctx->head;
+ ctx->head->field = type->fields;
+ ctx->head->parent_offset = parent_offset;
+ continue;
+ }
+ if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
+ } else {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return -1;
+ }
+ }
+ offset = ctx->head->parent_offset + field->offset;
+ if (ctx->fmt_offset != offset) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
+ (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
+ return -1;
+ }
+ ctx->fmt_offset += size;
+ if (arraysize)
+ ctx->fmt_offset += (arraysize - 1) * size;
+ --ctx->enc_count;
+ while (1) {
+ if (field == &ctx->root) {
+ ctx->head = NULL;
+ if (ctx->enc_count != 0) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return -1;
+ }
+ break;
+ }
+ ctx->head->field = ++field;
+ if (field->type == NULL) {
+ --ctx->head;
+ field = ctx->head->field;
+ continue;
+ } else if (field->type->typegroup == 'S') {
+ size_t parent_offset = ctx->head->parent_offset + field->offset;
+ if (field->type->fields->type == NULL) continue;
+ field = field->type->fields;
+ ++ctx->head;
+ ctx->head->field = field;
+ ctx->head->parent_offset = parent_offset;
+ break;
+ } else {
+ break;
+ }
+ }
+ } while (ctx->enc_count);
+ ctx->enc_type = 0;
+ ctx->is_complex = 0;
+ return 0;
+}
+static CYTHON_INLINE PyObject *
+__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
+{
+ const char *ts = *tsp;
+ int i = 0, number;
+ int ndim = ctx->head->field->type->ndim;
+;
+ ++ts;
+ if (ctx->new_count != 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "Cannot handle repeated arrays in format string");
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ while (*ts && *ts != ')') {
+ 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])
+ return PyErr_Format(PyExc_ValueError,
+ "Expected a dimension of size %zu, got %d",
+ ctx->head->field->type->arraysize[i], number);
+ if (*ts != ',' && *ts != ')')
+ return PyErr_Format(PyExc_ValueError,
+ "Expected a comma in format string, got '%c'", *ts);
+ if (*ts == ',') ts++;
+ i++;
+ }
+ if (i != ndim)
+ return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
+ ctx->head->field->type->ndim, i);
+ if (!*ts) {
+ PyErr_SetString(PyExc_ValueError,
+ "Unexpected end of format string, expected ')'");
+ return NULL;
+ }
+ ctx->is_valid_array = 1;
+ ctx->new_count = 1;
+ *tsp = ++ts;
+ return Py_None;
+}
+static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
+ int got_Z = 0;
+ while (1) {
+ switch(*ts) {
+ case 0:
+ if (ctx->enc_type != 0 && ctx->head == NULL) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ if (ctx->head != NULL) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return NULL;
+ }
+ return ts;
+ case ' ':
+ case '\r':
+ case '\n':
+ ++ts;
+ break;
+ case '<':
+ if (!__Pyx_IsLittleEndian()) {
+ PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
+ return NULL;
+ }
+ ctx->new_packmode = '=';
+ ++ts;
+ break;
+ case '>':
+ case '!':
+ if (__Pyx_IsLittleEndian()) {
+ PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
+ return NULL;
+ }
+ ctx->new_packmode = '=';
+ ++ts;
+ break;
+ case '=':
+ case '@':
+ case '^':
+ ctx->new_packmode = *ts++;
+ break;
+ case 'T':
+ {
+ const char* ts_after_sub;
+ size_t i, struct_count = ctx->new_count;
+ size_t struct_alignment = ctx->struct_alignment;
+ ctx->new_count = 1;
+ ++ts;
+ if (*ts != '{') {
+ PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->enc_type = 0;
+ ctx->enc_count = 0;
+ ctx->struct_alignment = 0;
+ ++ts;
+ ts_after_sub = ts;
+ for (i = 0; i != struct_count; ++i) {
+ ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
+ if (!ts_after_sub) return NULL;
+ }
+ ts = ts_after_sub;
+ if (struct_alignment) ctx->struct_alignment = struct_alignment;
+ }
+ break;
+ case '}':
+ {
+ size_t alignment = ctx->struct_alignment;
+ ++ts;
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->enc_type = 0;
+ if (alignment && ctx->fmt_offset % alignment) {
+ ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
+ }
+ }
+ return ts;
+ case 'x':
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->fmt_offset += ctx->new_count;
+ ctx->new_count = 1;
+ ctx->enc_count = 0;
+ ctx->enc_type = 0;
+ ctx->enc_packmode = ctx->new_packmode;
+ ++ts;
+ break;
+ case 'Z':
+ got_Z = 1;
+ ++ts;
+ if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
+ __Pyx_BufFmt_RaiseUnexpectedChar('Z');
+ return NULL;
+ }
+ 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 'p':
+ if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
+ ctx->enc_packmode == ctx->new_packmode) {
+ ctx->enc_count += ctx->new_count;
+ 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;
+ break;
+ case ':':
+ ++ts;
+ while(*ts != ':') ++ts;
+ ++ts;
+ break;
+ case '(':
+ if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
+ break;
+ default:
+ {
+ int number = __Pyx_BufFmt_ExpectNumber(&ts);
+ if (number == -1) return NULL;
+ ctx->new_count = (size_t)number;
+ }
+ }
+ }
+}
+static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
+ buf->buf = NULL;
+ buf->obj = NULL;
+ buf->strides = __Pyx_zeros;
+ buf->shape = __Pyx_zeros;
+ buf->suboffsets = __Pyx_minusones;
+}
+static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
+ Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
+ int nd, int cast, __Pyx_BufFmt_StackElem* stack)
+{
+ if (obj == Py_None || obj == NULL) {
+ __Pyx_ZeroBuffer(buf);
+ return 0;
+ }
+ buf->buf = NULL;
+ if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
+ if (buf->ndim != nd) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer has wrong number of dimensions (expected %d, got %d)",
+ nd, buf->ndim);
+ goto fail;
+ }
+ if (!cast) {
+ __Pyx_BufFmt_Context ctx;
+ __Pyx_BufFmt_Init(&ctx, stack, dtype);
+ if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
+ }
+ if ((unsigned)buf->itemsize != dtype->size) {
+ PyErr_Format(PyExc_ValueError,
+ "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
+ buf->itemsize, (buf->itemsize > 1) ? "s" : "",
+ dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
+ goto fail;
+ }
+ if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
+ return 0;
+fail:;
+ __Pyx_ZeroBuffer(buf);
+ return -1;
+}
+static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
+ if (info->buf == NULL) return;
+ if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
+ __Pyx_ReleaseBuffer(info);
+}
+
+static int
+__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
+ int ndim,
+ __Pyx_memviewslice *memviewslice,
+ int memview_is_new_reference)
+{
+ __Pyx_RefNannyDeclarations
+ int i, retval=-1;
+ Py_buffer *buf = &memview->view;
+ __Pyx_RefNannySetupContext("init_memviewslice", 0);
+ if (!buf) {
+ PyErr_SetString(PyExc_ValueError,
+ "buf is NULL.");
+ goto fail;
+ } else if (memviewslice->memview || memviewslice->data) {
+ PyErr_SetString(PyExc_ValueError,
+ "memviewslice is already initialized!");
+ goto fail;
+ }
+ if (buf->strides) {
+ for (i = 0; i < ndim; i++) {
+ memviewslice->strides[i] = buf->strides[i];
+ }
+ } else {
+ Py_ssize_t stride = buf->itemsize;
+ for (i = ndim - 1; i >= 0; i--) {
+ memviewslice->strides[i] = stride;
+ stride *= buf->shape[i];
+ }
+ }
+ for (i = 0; i < ndim; i++) {
+ memviewslice->shape[i] = buf->shape[i];
+ if (buf->suboffsets) {
+ memviewslice->suboffsets[i] = buf->suboffsets[i];
+ } else {
+ memviewslice->suboffsets[i] = -1;
+ }
+ }
+ memviewslice->memview = memview;
+ memviewslice->data = (char *)buf->buf;
+ if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
+ Py_INCREF(memview);
+ }
+ retval = 0;
+ goto no_fail;
+fail:
+ memviewslice->memview = 0;
+ memviewslice->data = 0;
+ retval = -1;
+no_fail:
+ __Pyx_RefNannyFinishContext();
+ return retval;
+}
+static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) {
+ va_list vargs;
+ char msg[200];
+ va_start(vargs, fmt);
+#ifdef HAVE_STDARG_PROTOTYPES
+ va_start(vargs, fmt);
+#else
+ va_start(vargs);
+#endif
+ vsnprintf(msg, 200, fmt, vargs);
+ Py_FatalError(msg);
+ va_end(vargs);
+}
+static CYTHON_INLINE int
+__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
+ PyThread_type_lock lock)
+{
+ int result;
+ PyThread_acquire_lock(lock, 1);
+ result = (*acquisition_count)++;
+ PyThread_release_lock(lock);
+ return result;
+}
+static CYTHON_INLINE int
+__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
+ PyThread_type_lock lock)
+{
+ int result;
+ PyThread_acquire_lock(lock, 1);
+ result = (*acquisition_count)--;
+ PyThread_release_lock(lock);
+ return result;
+}
+static CYTHON_INLINE void
+__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
+{
+ int first_time;
+ struct __pyx_memoryview_obj *memview = memslice->memview;
+ if (!memview || (PyObject *) memview == Py_None)
+ return;
+ if (__pyx_get_slice_count(memview) < 0)
+ __pyx_fatalerror("Acquisition count is %d (line %d)",
+ __pyx_get_slice_count(memview), lineno);
+ first_time = __pyx_add_acquisition_count(memview) == 0;
+ if (first_time) {
+ if (have_gil) {
+ Py_INCREF((PyObject *) memview);
+ } else {
+ PyGILState_STATE _gilstate = PyGILState_Ensure();
+ Py_INCREF((PyObject *) memview);
+ PyGILState_Release(_gilstate);
+ }
+ }
+}
+static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
+ int have_gil, int lineno) {
+ int last_time;
+ struct __pyx_memoryview_obj *memview = memslice->memview;
+ if (!memview ) {
+ return;
+ } else if ((PyObject *) memview == Py_None) {
+ memslice->memview = NULL;
+ return;
+ }
+ if (__pyx_get_slice_count(memview) <= 0)
+ __pyx_fatalerror("Acquisition count is %d (line %d)",
+ __pyx_get_slice_count(memview), lineno);
+ last_time = __pyx_sub_acquisition_count(memview) == 1;
+ memslice->data = NULL;
+ if (last_time) {
+ if (have_gil) {
+ Py_CLEAR(memslice->memview);
+ } else {
+ PyGILState_STATE _gilstate = PyGILState_Ensure();
+ Py_CLEAR(memslice->memview);
+ PyGILState_Release(_gilstate);
+ }
+ } else {
+ memslice->memview = NULL;
+ }
+}
+
+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;
+}
+
+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;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_Restore(type, value, tb);
+#endif
+}
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(type, value, tb);
+#endif
+}
+
+#if PY_MAJOR_VERSION < 3
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
+ CYTHON_UNUSED PyObject *cause) {
+ Py_XINCREF(type);
+ if (!value || value == Py_None)
+ value = NULL;
+ else
+ Py_INCREF(value);
+ if (!tb || tb == Py_None)
+ tb = NULL;
+ else {
+ Py_INCREF(tb);
+ if (!PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto raise_error;
+ }
+ }
+ if (PyType_Check(type)) {
+#if CYTHON_COMPILING_IN_PYPY
+ if (!value) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#endif
+ PyErr_NormalizeException(&type, &value, &tb);
+ } else {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto raise_error;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(type);
+ Py_INCREF(type);
+ if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto raise_error;
+ }
+ }
+ __Pyx_ErrRestore(type, value, tb);
+ return;
+raise_error:
+ Py_XDECREF(value);
+ Py_XDECREF(type);
+ Py_XDECREF(tb);
+ return;
+}
+#else
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
+ PyObject* owned_instance = NULL;
+ if (tb == Py_None) {
+ tb = 0;
+ } else if (tb && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto bad;
+ }
+ if (value == Py_None)
+ value = 0;
+ if (PyExceptionInstance_Check(type)) {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto bad;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(value);
+ } else if (PyExceptionClass_Check(type)) {
+ PyObject *instance_class = NULL;
+ if (value && PyExceptionInstance_Check(value)) {
+ instance_class = (PyObject*) Py_TYPE(value);
+ if (instance_class != type) {
+ if (PyObject_IsSubclass(instance_class, type)) {
+ type = instance_class;
+ } else {
+ instance_class = NULL;
+ }
+ }
+ }
+ if (!instance_class) {
+ PyObject *args;
+ if (!value)
+ args = PyTuple_New(0);
+ else if (PyTuple_Check(value)) {
+ Py_INCREF(value);
+ args = value;
+ } else
+ args = PyTuple_Pack(1, value);
+ if (!args)
+ goto bad;
+ owned_instance = PyObject_Call(type, args, NULL);
+ Py_DECREF(args);
+ if (!owned_instance)
+ goto bad;
+ value = owned_instance;
+ if (!PyExceptionInstance_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "calling %R should have returned an instance of "
+ "BaseException, not %R",
+ type, Py_TYPE(value));
+ goto bad;
+ }
+ }
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto bad;
+ }
+#if PY_VERSION_HEX >= 0x03030000
+ if (cause) {
+#else
+ if (cause && cause != Py_None) {
+#endif
+ PyObject *fixed_cause;
+ if (cause == Py_None) {
+ fixed_cause = NULL;
+ } else if (PyExceptionClass_Check(cause)) {
+ fixed_cause = PyObject_CallObject(cause, NULL);
+ if (fixed_cause == NULL)
+ goto bad;
+ } else if (PyExceptionInstance_Check(cause)) {
+ fixed_cause = cause;
+ Py_INCREF(fixed_cause);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "exception causes must derive from "
+ "BaseException");
+ goto bad;
+ }
+ PyException_SetCause(value, fixed_cause);
+ }
+ PyErr_SetObject(type, value);
+ if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
+ Py_INCREF(tb);
+ PyErr_Restore(tmp_type, tmp_value, tb);
+ Py_XDECREF(tmp_tb);
+#else
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject* tmp_tb = tstate->curexc_traceback;
+ if (tb != tmp_tb) {
+ Py_INCREF(tb);
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_tb);
+ }
+#endif
+ }
+bad:
+ Py_XDECREF(owned_instance);
+ return;
+}
+#endif
+
+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 CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ if (likely(PyObject_TypeCheck(obj, type)))
+ return 1;
+ PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
+ Py_TYPE(obj)->tp_name, type->tp_name);
+ return 0;
+}
+
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *more_or_less;
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+ func_name, more_or_less, num_expected,
+ (num_expected == 1) ? "" : "s", num_found);
+}
+
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AsString(kw_name));
+ #endif
+}
+
+static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ name = first_kw_arg;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ values[name-argnames] = value;
+ continue;
+ }
+ name = first_kw_arg;
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
+ while (*name) {
+ if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**name, key)) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ if ((**argname == key) || (
+ (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**argname, key))) {
+ goto arg_passed_twice;
+ }
+ argname++;
+ }
+ }
+ } else
+ #endif
+ if (likely(PyUnicode_Check(key))) {
+ while (*name) {
+ int cmp = (**name == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**name, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ int cmp = (**argname == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**argname, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) goto arg_passed_twice;
+ argname++;
+ }
+ }
+ } else
+ goto invalid_keyword_type;
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, key);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+bad:
+ return -1;
+}
+
+static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+ PyErr_Format(PyExc_TypeError,
+ "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
+ name, type->tp_name, Py_TYPE(obj)->tp_name);
+}
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+ const char *name, int exact)
+{
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ if (none_allowed && obj == Py_None) return 1;
+ else if (exact) {
+ if (likely(Py_TYPE(obj) == type)) return 1;
+ #if PY_MAJOR_VERSION == 2
+ else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
+ #endif
+ }
+ else {
+ if (likely(PyObject_TypeCheck(obj, type))) return 1;
+ }
+ __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
+ return 0;
+}
+
+static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+#if CYTHON_COMPILING_IN_PYPY
+ return PyObject_RichCompareBool(s1, s2, equals);
+#else
+#if PY_MAJOR_VERSION < 3
+ PyObject* owned_ref = NULL;
+#endif
+ int s1_is_unicode, s2_is_unicode;
+ if (s1 == s2) {
+ goto return_eq;
+ }
+ s1_is_unicode = PyUnicode_CheckExact(s1);
+ s2_is_unicode = PyUnicode_CheckExact(s2);
+#if PY_MAJOR_VERSION < 3
+ if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
+ owned_ref = PyUnicode_FromObject(s2);
+ if (unlikely(!owned_ref))
+ return -1;
+ s2 = owned_ref;
+ s2_is_unicode = 1;
+ } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
+ owned_ref = PyUnicode_FromObject(s1);
+ if (unlikely(!owned_ref))
+ return -1;
+ s1 = owned_ref;
+ s1_is_unicode = 1;
+ } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
+ return __Pyx_PyBytes_Equals(s1, s2, equals);
+ }
+#endif
+ if (s1_is_unicode & s2_is_unicode) {
+ Py_ssize_t length;
+ int kind;
+ void *data1, *data2;
+ if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
+ return -1;
+ length = __Pyx_PyUnicode_GET_LENGTH(s1);
+ if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
+ goto return_ne;
+ }
+ kind = __Pyx_PyUnicode_KIND(s1);
+ if (kind != __Pyx_PyUnicode_KIND(s2)) {
+ goto return_ne;
+ }
+ data1 = __Pyx_PyUnicode_DATA(s1);
+ data2 = __Pyx_PyUnicode_DATA(s2);
+ if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
+ goto return_ne;
+ } else if (length == 1) {
+ goto return_eq;
+ } else {
+ int result = memcmp(data1, data2, (size_t)(length * kind));
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_EQ) ? (result == 0) : (result != 0);
+ }
+ } else if ((s1 == Py_None) & s2_is_unicode) {
+ goto return_ne;
+ } else if ((s2 == Py_None) & s1_is_unicode) {
+ goto return_ne;
+ } else {
+ int result;
+ PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
+ if (!py_result)
+ return -1;
+ result = __Pyx_PyObject_IsTrue(py_result);
+ Py_DECREF(py_result);
+ return result;
+ }
+return_eq:
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_EQ);
+return_ne:
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_NE);
+#endif
+}
+
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
+ Py_ssize_t q = a / b;
+ Py_ssize_t r = a - q*b;
+ q -= ((r != 0) & ((r ^ b) < 0));
+ return q;
+}
+
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
+#if CYTHON_COMPILING_IN_CPYTHON
+#if PY_MAJOR_VERSION >= 3
+ if (likely(PyUnicode_Check(n)))
+#else
+ if (likely(PyString_Check(n)))
+#endif
+ return __Pyx_PyObject_GetAttrStr(o, n);
+#endif
+ return PyObject_GetAttr(o, n);
+}
+
+static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+ const char* cstring, Py_ssize_t start, Py_ssize_t stop,
+ const char* encoding, const char* errors,
+ PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
+ Py_ssize_t length;
+ if (unlikely((start < 0) | (stop < 0))) {
+ length = strlen(cstring);
+ if (start < 0) {
+ start += length;
+ if (start < 0)
+ start = 0;
+ }
+ if (stop < 0)
+ stop += length;
+ }
+ length = stop - start;
+ if (unlikely(length <= 0))
+ return PyUnicode_FromUnicode(NULL, 0);
+ cstring += start;
+ if (decode_func) {
+ return decode_func(cstring, length, errors);
+ } else {
+ return PyUnicode_Decode(cstring, length, encoding, errors);
+ }
+}
+
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->exc_type;
+ *value = tstate->exc_value;
+ *tb = tstate->exc_traceback;
+ Py_XINCREF(*type);
+ Py_XINCREF(*value);
+ Py_XINCREF(*tb);
+#else
+ PyErr_GetExcInfo(type, value, tb);
+#endif
+}
+static void __Pyx_ExceptionReset(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->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = type;
+ tstate->exc_value = value;
+ tstate->exc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(type, value, tb);
+#endif
+}
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *local_type, *local_value, *local_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ local_type = tstate->curexc_type;
+ local_value = tstate->curexc_value;
+ local_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(&local_type, &local_value, &local_tb);
+#endif
+ PyErr_NormalizeException(&local_type, &local_value, &local_tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(tstate->curexc_type))
+#else
+ if (unlikely(PyErr_Occurred()))
+#endif
+ goto bad;
+ #if PY_MAJOR_VERSION >= 3
+ if (local_tb) {
+ if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+ goto bad;
+ }
+ #endif
+ Py_XINCREF(local_tb);
+ Py_XINCREF(local_type);
+ Py_XINCREF(local_value);
+ *type = local_type;
+ *value = local_value;
+ *tb = local_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = local_type;
+ tstate->exc_value = local_value;
+ tstate->exc_traceback = local_tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
+#endif
+ return 0;
+bad:
+ *type = 0;
+ *value = 0;
+ *tb = 0;
+ Py_XDECREF(local_type);
+ Py_XDECREF(local_value);
+ Py_XDECREF(local_tb);
+ return -1;
+}
+
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = *type;
+ tstate->exc_value = *value;
+ tstate->exc_traceback = *tb;
+#else
+ PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
+ PyErr_SetExcInfo(*type, *value, *tb);
+#endif
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
+
+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_RaiseUnboundLocalError(const char *varname) {
+ PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
+}
+
+static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
+ long q = a / b;
+ long r = a - q*b;
+ q -= ((r != 0) & ((r ^ b) < 0));
+ return q;
+}
+
+static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+ CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
+ int full_traceback) {
+ PyObject *old_exc, *old_val, *old_tb;
+ PyObject *ctx;
+ __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
+ if (full_traceback) {
+ Py_XINCREF(old_exc);
+ Py_XINCREF(old_val);
+ Py_XINCREF(old_tb);
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ PyErr_PrintEx(1);
+ }
+ #if PY_MAJOR_VERSION < 3
+ ctx = PyString_FromString(name);
+ #else
+ ctx = PyUnicode_FromString(name);
+ #endif
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ if (!ctx) {
+ PyErr_WriteUnraisable(Py_None);
+ } else {
+ PyErr_WriteUnraisable(ctx);
+ Py_DECREF(ctx);
+ }
+}
+
+static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+#if PY_VERSION_HEX >= 0x02070000
+ PyObject *ob = PyCapsule_New(vtable, 0, 0);
+#else
+ PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
+#endif
+ if (!ob)
+ goto bad;
+ if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
+ goto bad;
+ Py_DECREF(ob);
+ return 0;
+bad:
+ Py_XDECREF(ob);
+ return -1;
+}
+
+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) {
+ if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
+ if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
+ if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
+ if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
+ 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;
+ if (!obj) return;
+ if (PyObject_CheckBuffer(obj)) {
+ PyBuffer_Release(view);
+ return;
+ }
+ if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(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 int __Pyx_BytesContains(PyObject* bytes, char character) {
+ const Py_ssize_t length = PyBytes_GET_SIZE(bytes);
+ char* char_start = PyBytes_AS_STRING(bytes);
+ char* pos;
+ for (pos=char_start; pos < char_start+length; pos++) {
+ if (character == pos[0]) return 1;
+ }
+ return 0;
+}
+
+#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 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;
+ }
+#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;
+ z.real = a.real + b.real;
+ z.imag = a.imag + b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ z.real = a.real - b.real;
+ z.imag = a.imag - b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ z.real = a.real * b.real - a.imag * b.imag;
+ z.imag = a.real * b.imag + a.imag * b.real;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ float denom = b.real * b.real + b.imag * b.imag;
+ z.real = (a.real * b.real + a.imag * b.imag) / denom;
+ z.imag = (a.imag * b.real - a.real * b.imag) / denom;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
+ __pyx_t_float_complex z;
+ z.real = -a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
+ return (a.real == 0) && (a.imag == 0);
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
+ __pyx_t_float_complex z;
+ z.real = a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ #if 1
+ static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
+ #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
+ return sqrtf(z.real*z.real + z.imag*z.imag);
+ #else
+ return hypotf(z.real, z.imag);
+ #endif
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ float r, lnr, theta, z_r, z_theta;
+ if (b.imag == 0 && b.real == (int)b.real) {
+ if (b.real < 0) {
+ float denom = a.real * a.real + a.imag * a.imag;
+ a.real = a.real / denom;
+ a.imag = -a.imag / denom;
+ b.real = -b.real;
+ }
+ switch ((int)b.real) {
+ case 0:
+ z.real = 1;
+ z.imag = 0;
+ return z;
+ case 1:
+ return a;
+ case 2:
+ z = __Pyx_c_prodf(a, a);
+ return __Pyx_c_prodf(a, a);
+ case 3:
+ z = __Pyx_c_prodf(a, a);
+ return __Pyx_c_prodf(z, a);
+ case 4:
+ z = __Pyx_c_prodf(a, a);
+ return __Pyx_c_prodf(z, z);
+ }
+ }
+ if (a.imag == 0) {
+ if (a.real == 0) {
+ return a;
+ }
+ r = a.real;
+ theta = 0;
+ } else {
+ r = __Pyx_c_absf(a);
+ theta = atan2f(a.imag, a.real);
+ }
+ lnr = logf(r);
+ z_r = expf(lnr * b.real - theta * b.imag);
+ z_theta = theta * b.real + lnr * b.imag;
+ z.real = z_r * cosf(z_theta);
+ z.imag = z_r * sinf(z_theta);
+ return z;
+ }
+ #endif
+#endif
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ return ::std::complex< double >(x, y);
+ }
+ #else
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ return x + y*(__pyx_t_double_complex)_Complex_I;
+ }
+ #endif
+#else
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ __pyx_t_double_complex z;
+ z.real = x;
+ z.imag = y;
+ return z;
+ }
+#endif
+
+#if CYTHON_CCOMPLEX
+#else
+ static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ return (a.real == b.real) && (a.imag == b.imag);
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real + b.real;
+ z.imag = a.imag + b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real - b.real;
+ z.imag = a.imag - b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real * b.real - a.imag * b.imag;
+ z.imag = a.real * b.imag + a.imag * b.real;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ double denom = b.real * b.real + b.imag * b.imag;
+ z.real = (a.real * b.real + a.imag * b.imag) / denom;
+ z.imag = (a.imag * b.real - a.real * b.imag) / denom;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
+ __pyx_t_double_complex z;
+ z.real = -a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
+ return (a.real == 0) && (a.imag == 0);
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
+ __pyx_t_double_complex z;
+ z.real = a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ #if 1
+ static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
+ #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
+ return sqrt(z.real*z.real + z.imag*z.imag);
+ #else
+ return hypot(z.real, z.imag);
+ #endif
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ double r, lnr, theta, z_r, z_theta;
+ if (b.imag == 0 && b.real == (int)b.real) {
+ if (b.real < 0) {
+ double denom = a.real * a.real + a.imag * a.imag;
+ a.real = a.real / denom;
+ a.imag = -a.imag / denom;
+ b.real = -b.real;
+ }
+ switch ((int)b.real) {
+ case 0:
+ z.real = 1;
+ z.imag = 0;
+ return z;
+ case 1:
+ 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 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 int
+__pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
+ char order, int ndim)
+{
+ int i, index, step, start;
+ Py_ssize_t itemsize = mvs->memview->view.itemsize;
+ if (order == 'F') {
+ step = 1;
+ start = 0;
+ } else {
+ step = -1;
+ start = ndim - 1;
+ }
+ for (i = 0; i < ndim; i++) {
+ index = start + step * i;
+ if (mvs->suboffsets[index] >= 0 || mvs->strides[index] != itemsize)
+ return 0;
+ itemsize *= mvs->shape[index];
+ }
+ return 1;
+}
+
+static void
+__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
+ void **out_start, void **out_end,
+ int ndim, size_t itemsize)
+{
+ char *start, *end;
+ int i;
+ start = end = slice->data;
+ for (i = 0; i < ndim; i++) {
+ Py_ssize_t stride = slice->strides[i];
+ Py_ssize_t extent = slice->shape[i];
+ if (extent == 0) {
+ *out_start = *out_end = start;
+ return;
+ } else {
+ if (stride > 0)
+ end += stride * (extent - 1);
+ else
+ start += stride * (extent - 1);
+ }
+ }
+ *out_start = start;
+ *out_end = end + itemsize;
+}
+static int
+__pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize)
+{
+ void *start1, *end1, *start2, *end2;
+ __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
+ __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
+ return (start1 < end2) && (start2 < end1);
+}
+
+static __Pyx_memviewslice
+__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
+ const char *mode, int ndim,
+ size_t sizeof_dtype, int contig_flag,
+ int dtype_is_object)
+{
+ __Pyx_RefNannyDeclarations
+ int i;
+ __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
+ struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
+ Py_buffer *buf = &from_memview->view;
+ PyObject *shape_tuple = NULL;
+ PyObject *temp_int = NULL;
+ struct __pyx_array_obj *array_obj = NULL;
+ struct __pyx_memoryview_obj *memview_obj = NULL;
+ __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
+ for (i = 0; i < ndim; i++) {
+ if (from_mvs->suboffsets[i] >= 0) {
+ PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
+ "indirect dimensions (axis %d)", i);
+ goto fail;
+ }
+ }
+ shape_tuple = PyTuple_New(ndim);
+ if (unlikely(!shape_tuple)) {
+ goto fail;
+ }
+ __Pyx_GOTREF(shape_tuple);
+ for(i = 0; i < ndim; i++) {
+ temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
+ if(unlikely(!temp_int)) {
+ goto fail;
+ } else {
+ PyTuple_SET_ITEM(shape_tuple, i, temp_int);
+ temp_int = NULL;
+ }
+ }
+ array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
+ if (unlikely(!array_obj)) {
+ goto fail;
+ }
+ __Pyx_GOTREF(array_obj);
+ memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
+ (PyObject *) array_obj, contig_flag,
+ dtype_is_object,
+ from_mvs->memview->typeinfo);
+ if (unlikely(!memview_obj))
+ goto fail;
+ if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
+ goto fail;
+ if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
+ dtype_is_object) < 0))
+ goto fail;
+ goto no_fail;
+fail:
+ __Pyx_XDECREF(new_mvs.memview);
+ new_mvs.memview = NULL;
+ new_mvs.data = NULL;
+no_fail:
+ __Pyx_XDECREF(shape_tuple);
+ __Pyx_XDECREF(temp_int);
+ __Pyx_XDECREF(array_obj);
+ __Pyx_RefNannyFinishContext();
+ return new_mvs;
+}
+
+static CYTHON_INLINE PyObject *
+__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
+{
+ PyObject *cobj;
+#if PY_VERSION_HEX >= 0x02070000
+ cobj = PyCapsule_New(p, sig, NULL);
+#else
+ cobj = PyCObject_FromVoidPtr(p, NULL);
+#endif
+ return cobj;
+}
+
+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);
+ }
+}
+
+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;
+}
+
+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
+ 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
+ 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;
+}
+
+static int
+__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
+{
+ int i;
+ if (!a || !b)
+ return 0;
+ if (a == b)
+ return 1;
+ if (a->size != b->size || a->typegroup != b->typegroup ||
+ a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
+ if (a->typegroup == 'H' || b->typegroup == 'H') {
+ return a->size == b->size;
+ } else {
+ return 0;
+ }
+ }
+ if (a->ndim) {
+ for (i = 0; i < a->ndim; i++)
+ if (a->arraysize[i] != b->arraysize[i])
+ return 0;
+ }
+ if (a->typegroup == 'S') {
+ if (a->flags != b->flags)
+ return 0;
+ if (a->fields || b->fields) {
+ if (!(a->fields && b->fields))
+ return 0;
+ for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
+ __Pyx_StructField *field_a = a->fields + i;
+ __Pyx_StructField *field_b = b->fields + i;
+ if (field_a->offset != field_b->offset ||
+ !__pyx_typeinfo_cmp(field_a->type, field_b->type))
+ return 0;
+ }
+ return !a->fields[i].type && !b->fields[i].type;
+ }
+ }
+ return 1;
+}
+
+static int
+__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
+{
+ if (buf->shape[dim] <= 1)
+ return 1;
+ if (buf->strides) {
+ if (spec & __Pyx_MEMVIEW_CONTIG) {
+ if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
+ if (buf->strides[dim] != sizeof(void *)) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer is not indirectly contiguous "
+ "in dimension %d.", dim);
+ goto fail;
+ }
+ } else if (buf->strides[dim] != buf->itemsize) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer and memoryview are not contiguous "
+ "in the same dimension.");
+ goto fail;
+ }
+ }
+ if (spec & __Pyx_MEMVIEW_FOLLOW) {
+ Py_ssize_t stride = buf->strides[dim];
+ if (stride < 0)
+ stride = -stride;
+ if (stride < buf->itemsize) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer and memoryview are not contiguous "
+ "in the same dimension.");
+ goto fail;
+ }
+ }
+ } else {
+ if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
+ PyErr_Format(PyExc_ValueError,
+ "C-contiguous buffer is not contiguous in "
+ "dimension %d", dim);
+ goto fail;
+ } else if (spec & (__Pyx_MEMVIEW_PTR)) {
+ PyErr_Format(PyExc_ValueError,
+ "C-contiguous buffer is not indirect in "
+ "dimension %d", dim);
+ goto fail;
+ } else if (buf->suboffsets) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer exposes suboffsets but no strides");
+ goto fail;
+ }
+ }
+ return 1;
+fail:
+ return 0;
+}
+static int
+__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
+{
+ if (spec & __Pyx_MEMVIEW_DIRECT) {
+ if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer not compatible with direct access "
+ "in dimension %d.", dim);
+ goto fail;
+ }
+ }
+ if (spec & __Pyx_MEMVIEW_PTR) {
+ if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer is not indirectly accessible "
+ "in dimension %d.", dim);
+ goto fail;
+ }
+ }
+ return 1;
+fail:
+ return 0;
+}
+static int
+__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
+{
+ int i;
+ if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
+ Py_ssize_t stride = 1;
+ for (i = 0; i < ndim; i++) {
+ if (stride * buf->itemsize != buf->strides[i] &&
+ buf->shape[i] > 1)
+ {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer not fortran contiguous.");
+ goto fail;
+ }
+ stride = stride * buf->shape[i];
+ }
+ } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
+ Py_ssize_t stride = 1;
+ for (i = ndim - 1; i >- 1; i--) {
+ if (stride * buf->itemsize != buf->strides[i] &&
+ buf->shape[i] > 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer not C contiguous.");
+ goto fail;
+ }
+ stride = stride * buf->shape[i];
+ }
+ }
+ return 1;
+fail:
+ return 0;
+}
+static int __Pyx_ValidateAndInit_memviewslice(
+ int *axes_specs,
+ int c_or_f_flag,
+ int buf_flags,
+ int ndim,
+ __Pyx_TypeInfo *dtype,
+ __Pyx_BufFmt_StackElem stack[],
+ __Pyx_memviewslice *memviewslice,
+ PyObject *original_obj)
+{
+ struct __pyx_memoryview_obj *memview, *new_memview;
+ __Pyx_RefNannyDeclarations
+ Py_buffer *buf;
+ int i, spec = 0, retval = -1;
+ __Pyx_BufFmt_Context ctx;
+ int from_memoryview = __pyx_memoryview_check(original_obj);
+ __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
+ if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
+ original_obj)->typeinfo)) {
+ memview = (struct __pyx_memoryview_obj *) original_obj;
+ new_memview = NULL;
+ } else {
+ memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
+ original_obj, buf_flags, 0, dtype);
+ new_memview = memview;
+ if (unlikely(!memview))
+ goto fail;
+ }
+ buf = &memview->view;
+ if (buf->ndim != ndim) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer has wrong number of dimensions (expected %d, got %d)",
+ ndim, buf->ndim);
+ goto fail;
+ }
+ if (new_memview) {
+ __Pyx_BufFmt_Init(&ctx, stack, dtype);
+ if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
+ }
+ if ((unsigned) buf->itemsize != dtype->size) {
+ PyErr_Format(PyExc_ValueError,
+ "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
+ "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
+ buf->itemsize,
+ (buf->itemsize > 1) ? "s" : "",
+ dtype->name,
+ dtype->size,
+ (dtype->size > 1) ? "s" : "");
+ goto fail;
+ }
+ for (i = 0; i < ndim; i++) {
+ spec = axes_specs[i];
+ if (!__pyx_check_strides(buf, i, ndim, spec))
+ goto fail;
+ if (!__pyx_check_suboffsets(buf, i, ndim, spec))
+ goto fail;
+ }
+ if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
+ goto fail;
+ if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
+ new_memview != NULL) == -1)) {
+ goto fail;
+ }
+ retval = 0;
+ goto no_fail;
+fail:
+ Py_XDECREF(new_memview);
+ retval = -1;
+no_fail:
+ __Pyx_RefNannyFinishContext();
+ return retval;
+}
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_char(PyObject *obj) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
+ PyBUF_RECORDS, 1,
+ &__Pyx_TypeInfo_unsigned_char, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+static int __Pyx_check_binary_version(void) {
+ char ctversion[4], rtversion[4];
+ PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
+ if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
+ char message[200];
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+#ifndef __PYX_HAVE_RT_ImportModule
+#define __PYX_HAVE_RT_ImportModule
+static PyObject *__Pyx_ImportModule(const char *name) {
+ PyObject *py_name = 0;
+ PyObject *py_module = 0;
+ py_name = __Pyx_PyIdentifier_FromString(name);
+ if (!py_name)
+ goto bad;
+ py_module = PyImport_Import(py_name);
+ Py_DECREF(py_name);
+ return py_module;
+bad:
+ Py_XDECREF(py_name);
+ return 0;
+}
+#endif
+
+#ifndef __PYX_HAVE_RT_ImportType
+#define __PYX_HAVE_RT_ImportType
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
+ size_t size, int strict)
+{
+ PyObject *py_module = 0;
+ PyObject *result = 0;
+ PyObject *py_name = 0;
+ char warning[200];
+ Py_ssize_t basicsize;
+#ifdef Py_LIMITED_API
+ PyObject *py_basicsize;
+#endif
+ py_module = __Pyx_ImportModule(module_name);
+ if (!py_module)
+ goto bad;
+ py_name = __Pyx_PyIdentifier_FromString(class_name);
+ if (!py_name)
+ goto bad;
+ result = PyObject_GetAttr(py_module, py_name);
+ Py_DECREF(py_name);
+ py_name = 0;
+ Py_DECREF(py_module);
+ py_module = 0;
+ if (!result)
+ goto bad;
+ if (!PyType_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.%.200s is not a type object",
+ module_name, class_name);
+ goto bad;
+ }
+#ifndef Py_LIMITED_API
+ basicsize = ((PyTypeObject *)result)->tp_basicsize;
+#else
+ py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
+ if (!py_basicsize)
+ goto bad;
+ basicsize = PyLong_AsSsize_t(py_basicsize);
+ Py_DECREF(py_basicsize);
+ py_basicsize = 0;
+ if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
+ goto bad;
+#endif
+ if (!strict && (size_t)basicsize > size) {
+ PyOS_snprintf(warning, sizeof(warning),
+ "%s.%s size changed, may indicate binary incompatibility",
+ module_name, class_name);
+ if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
+ }
+ else if ((size_t)basicsize != size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s has the wrong size, try recompiling",
+ module_name, class_name);
+ goto bad;
+ }
+ return (PyTypeObject *)result;
+bad:
+ Py_XDECREF(py_module);
+ Py_XDECREF(result);
+ return NULL;
+}
+#endif
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __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;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+ PyNumberMethods *m;
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (PyInt_Check(x) || PyLong_Check(x))
+#else
+ if (PyLong_Check(x))
+#endif
+ return Py_INCREF(x), x;
+ m = Py_TYPE(x)->tp_as_number;
+#if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = PyNumber_Long(x);
+ }
+#else
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Long(x);
+ }
+#endif
+ if (res) {
+#if PY_MAJOR_VERSION < 3
+ if (!PyInt_Check(res) && !PyLong_Check(res)) {
+#else
+ if (!PyLong_Check(res)) {
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ name, name, Py_TYPE(res)->tp_name);
+ Py_DECREF(res);
+ return NULL;
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b)))
+ 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) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/fabio/ext/_cif.pyx b/fabio/ext/_cif.pyx
new file mode 100644
index 0000000..868d0b2
--- /dev/null
+++ b/fabio/ext/_cif.pyx
@@ -0,0 +1,149 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/kif/fabio
+#
+# Copyright (C) 2015 European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+"""Cif parser helper functions"""
+
+__author__ = "Jerome Kieffer"
+__contact__ = "jerome.kieffer@esrf.eu"
+__license__ = "MIT"
+__copyright__ = "2014, European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "25/07/2017"
+
+cimport numpy
+import numpy
+import cython
+
+
+@cython.boundscheck(False)
+def split_tokens(bytes_text):
+ """
+ Separate the text representing a CIF file into a list of tokens.
+
+ :param bytes_text: the content of the CIF - file
+ :type bytes_text: 8-bit string (str in python2 or bytes in python3)
+ :return: list of all the fields of the CIF
+ :rtype: list
+ """
+ cdef:
+ unsigned char[:] ary = bytearray(bytes_text)
+ bint in_comment = False, in_single_quote = False
+ bint in_double_quote = False, multiline = False, go_on = True
+ int i = -1, start = -1, end = -1, imax
+ char prev, next, cur = b"\n"
+ bytes EOL = b'\r\n'
+ bytes BLANK = b" \t\r\n"
+ unsigned char SINGLE_QUOTE = b"'"
+ unsigned char DOUBLE_QUOTE = b'"'
+ unsigned char SEMICOLUMN = b';'
+ unsigned char HASH = b"#"
+ unsigned char UNDERSCORE = b"_"
+ unsigned char DASH = b"-"
+ unsigned char QUESTIONMARK = b"?"
+ bytes BINARY_MARKER = b"--CIF-BINARY-FORMAT-SECTION--"
+ int lbms = len(BINARY_MARKER)
+ next = ary[0]
+ imax = len(bytes_text) - 1
+ fields = []
+ while go_on:
+ i += 1
+ prev = cur
+ cur = next
+ if i < imax:
+ next = ary[i + 1]
+ else:
+ next = b"\n"
+ go_on = False
+ # print(i,chr(prev),chr(cur),chr(next),in_comment,in_single_quote,in_double_quote,multiline, start, cur ==SINGLE_QUOTE)
+ # Skip comments
+ if in_comment:
+ if cur in EOL:
+ in_comment = False
+ continue
+
+ if prev in EOL:
+ if cur == HASH:
+ in_comment = True
+ continue
+ if cur == SEMICOLUMN:
+ if multiline:
+ fields.append(bytes_text[start:i].strip())
+ start = -1
+ multiline = False
+ else:
+ multiline = True
+ start = i + 1
+ continue
+
+ if multiline:
+ # Handle CBF
+ if cur == DASH:
+ if bytes_text[i:i + lbms] == BINARY_MARKER:
+ end = bytes_text[i + lbms:].find(BINARY_MARKER)
+ i += end + 2 * lbms
+ cur = ary[i]
+ next = ary[i + 1]
+ continue
+
+ # Handle single quote
+ if cur == SINGLE_QUOTE:
+ if (not in_single_quote) and (not in_double_quote) and (start < 0) and (prev in BLANK):
+ start = i + 1
+ in_single_quote = True
+ continue
+ if (in_single_quote) and (not in_double_quote) and (start >= 0) and (next in BLANK):
+ fields.append(bytes_text[start:i].strip())
+ start = -1
+ in_single_quote = False
+ continue
+ if in_single_quote:
+ continue
+
+ # Handle double quote
+ if cur == DOUBLE_QUOTE:
+ if (not in_single_quote) and (not in_double_quote) and (start < 0) and (prev in BLANK):
+ start = i + 1
+ in_double_quote = True
+ continue
+ if (not in_single_quote) and (in_double_quote) and (start >= 0) and (next in BLANK):
+ fields.append(bytes_text[start:i].strip())
+ start = -1
+ in_double_quote = False
+ continue
+ if in_double_quote:
+ continue
+
+ # Normal fields
+ if cur in BLANK:
+ if start >= 0:
+ fields.append(bytes_text[start:i].strip())
+ start = -1
+ else:
+ if start < 0:
+ start = i
+ if start >= 0:
+ fields.append(bytes_text[start:].strip())
+ return fields
diff --git a/fabio/ext/byte_offset.c b/fabio/ext/byte_offset.c
new file mode 100644
index 0000000..e3ba569
--- /dev/null
+++ b/fabio/ext/byte_offset.c
@@ -0,0 +1,22778 @@
+/* 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 < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+ #error Cython requires Python 2.6+ or Python 3.2+.
+#else
+#define CYTHON_ABI "0_21_1"
+#include <stddef.h>
+#ifndef offsetof
+#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+#define CYTHON_COMPILING_IN_PYPY 1
+#define CYTHON_COMPILING_IN_CPYTHON 0
+#else
+#define CYTHON_COMPILING_IN_PYPY 0
+#define CYTHON_COMPILING_IN_CPYTHON 1
+#endif
+#if 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+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define Py_TPFLAGS_CHECKTYPES 0
+ #define Py_TPFLAGS_HAVE_INDEX 0
+ #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_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
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t PyInt_AsLong
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#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_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
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+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
+
+
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+#define _USE_MATH_DEFINES
+#endif
+#include <math.h>
+#define __PYX_HAVE__fabio__ext__byte_offset
+#define __PYX_HAVE_API__fabio__ext__byte_offset
+#include "string.h"
+#include "stdio.h"
+#include "stdlib.h"
+#include "numpy/arrayobject.h"
+#include "numpy/ufuncobject.h"
+#include "pythread.h"
+#include "pystate.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#ifdef PYREX_WITHOUT_ASSERTIONS
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+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);
+#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
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+#if !defined(CYTHON_CCOMPLEX)
+ #if defined(__cplusplus)
+ #define CYTHON_CCOMPLEX 1
+ #elif defined(_Complex_I)
+ #define CYTHON_CCOMPLEX 1
+ #else
+ #define CYTHON_CCOMPLEX 0
+ #endif
+#endif
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ #include <complex>
+ #else
+ #include <complex.h>
+ #endif
+#endif
+#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
+ #undef _Complex_I
+ #define _Complex_I 1.0fj
+#endif
+
+
+static const char *__pyx_f[] = {
+ "fabio/ext/byte_offset.pyx",
+ "__init__.pxd",
+ "stringsource",
+ "type.pxd",
+};
+struct __pyx_memoryview_obj;
+typedef struct {
+ struct __pyx_memoryview_obj *memview;
+ char *data;
+ Py_ssize_t shape[8];
+ Py_ssize_t strides[8];
+ Py_ssize_t suboffsets[8];
+} __Pyx_memviewslice;
+
+#define IS_UNSIGNED(type) (((type) -1) > 0)
+struct __Pyx_StructField_;
+#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
+typedef struct {
+ const char* name;
+ struct __Pyx_StructField_* fields;
+ size_t size;
+ size_t arraysize[8];
+ int ndim;
+ char typegroup;
+ char is_unsigned;
+ int flags;
+} __Pyx_TypeInfo;
+typedef struct __Pyx_StructField_ {
+ __Pyx_TypeInfo* type;
+ const char* name;
+ size_t offset;
+} __Pyx_StructField;
+typedef struct {
+ __Pyx_StructField* field;
+ size_t parent_offset;
+} __Pyx_BufFmt_StackElem;
+typedef struct {
+ __Pyx_StructField root;
+ __Pyx_BufFmt_StackElem* head;
+ size_t fmt_offset;
+ size_t new_count, enc_count;
+ size_t struct_alignment;
+ int is_complex;
+ char enc_type;
+ char new_packmode;
+ char enc_packmode;
+ char is_valid_array;
+} __Pyx_BufFmt_Context;
+
+#include <pythread.h>
+#ifndef CYTHON_ATOMICS
+ #define CYTHON_ATOMICS 1
+#endif
+#define __pyx_atomic_int_type int
+#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 || \
+ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) && \
+ !defined(__i386__)
+ #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
+ #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Using GNU atomics"
+ #endif
+#elif CYTHON_ATOMICS && MSC_VER
+ #include <Windows.h>
+ #define __pyx_atomic_int_type LONG
+ #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
+ #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Using MSVC atomics"
+ #endif
+#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
+ #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
+ #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Using Intel atomics"
+ #endif
+#else
+ #undef CYTHON_ATOMICS
+ #define CYTHON_ATOMICS 0
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Not using atomics"
+ #endif
+#endif
+typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
+#if CYTHON_ATOMICS
+ #define __pyx_add_acquisition_count(memview) \
+ __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
+ #define __pyx_sub_acquisition_count(memview) \
+ __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
+#else
+ #define __pyx_add_acquisition_count(memview) \
+ __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
+ #define __pyx_sub_acquisition_count(memview) \
+ __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
+#endif
+
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":723
+ * # in Cython to enable them only on the right systems.
+ *
+ * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t
+ */
+typedef npy_int8 __pyx_t_5numpy_int8_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724
+ *
+ * ctypedef npy_int8 int8_t
+ * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int32 int32_t
+ * ctypedef npy_int64 int64_t
+ */
+typedef npy_int16 __pyx_t_5numpy_int16_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
+ * ctypedef npy_int8 int8_t
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int64 int64_t
+ * #ctypedef npy_int96 int96_t
+ */
+typedef npy_int32 __pyx_t_5numpy_int32_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t
+ * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_int96 int96_t
+ * #ctypedef npy_int128 int128_t
+ */
+typedef npy_int64 __pyx_t_5numpy_int64_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730
+ * #ctypedef npy_int128 int128_t
+ *
+ * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t
+ */
+typedef npy_uint8 __pyx_t_5numpy_uint8_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731
+ *
+ * ctypedef npy_uint8 uint8_t
+ * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint32 uint32_t
+ * ctypedef npy_uint64 uint64_t
+ */
+typedef npy_uint16 __pyx_t_5numpy_uint16_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
+ * ctypedef npy_uint8 uint8_t
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint64 uint64_t
+ * #ctypedef npy_uint96 uint96_t
+ */
+typedef npy_uint32 __pyx_t_5numpy_uint32_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t
+ * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_uint96 uint96_t
+ * #ctypedef npy_uint128 uint128_t
+ */
+typedef npy_uint64 __pyx_t_5numpy_uint64_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737
+ * #ctypedef npy_uint128 uint128_t
+ *
+ * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_float64 float64_t
+ * #ctypedef npy_float80 float80_t
+ */
+typedef npy_float32 __pyx_t_5numpy_float32_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738
+ *
+ * ctypedef npy_float32 float32_t
+ * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_float80 float80_t
+ * #ctypedef npy_float128 float128_t
+ */
+typedef npy_float64 __pyx_t_5numpy_float64_t;
+
+/* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * ctypedef npy_longlong long_t
+ * ctypedef npy_longlong longlong_t
+ */
+typedef npy_long __pyx_t_5numpy_int_t;
+
+/* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * ctypedef npy_longlong longlong_t
+ *
+ */
+typedef npy_longlong __pyx_t_5numpy_long_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
+ * ctypedef npy_long int_t
+ * ctypedef npy_longlong long_t
+ * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_ulong uint_t
+ */
+typedef npy_longlong __pyx_t_5numpy_longlong_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
+ * ctypedef npy_longlong longlong_t
+ *
+ * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
+ * ctypedef npy_ulonglong ulong_t
+ * ctypedef npy_ulonglong ulonglong_t
+ */
+typedef npy_ulong __pyx_t_5numpy_uint_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752
+ *
+ * ctypedef npy_ulong uint_t
+ * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
+ * ctypedef npy_ulonglong ulonglong_t
+ *
+ */
+typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
+ * ctypedef npy_ulong uint_t
+ * ctypedef npy_ulonglong ulong_t
+ * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_intp intp_t
+ */
+typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
+ * ctypedef npy_ulonglong ulonglong_t
+ *
+ * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uintp uintp_t
+ *
+ */
+typedef npy_intp __pyx_t_5numpy_intp_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756
+ *
+ * ctypedef npy_intp intp_t
+ * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_double float_t
+ */
+typedef npy_uintp __pyx_t_5numpy_uintp_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
+ * ctypedef npy_uintp uintp_t
+ *
+ * ctypedef npy_double float_t # <<<<<<<<<<<<<<
+ * ctypedef npy_double double_t
+ * ctypedef npy_longdouble longdouble_t
+ */
+typedef npy_double __pyx_t_5numpy_float_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759
+ *
+ * ctypedef npy_double float_t
+ * ctypedef npy_double double_t # <<<<<<<<<<<<<<
+ * ctypedef npy_longdouble longdouble_t
+ *
+ */
+typedef npy_double __pyx_t_5numpy_double_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
+ * ctypedef npy_double float_t
+ * ctypedef npy_double double_t
+ * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_cfloat cfloat_t
+ */
+typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ typedef ::std::complex< float > __pyx_t_float_complex;
+ #else
+ typedef float _Complex __pyx_t_float_complex;
+ #endif
+#else
+ typedef struct { float real, imag; } __pyx_t_float_complex;
+#endif
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ typedef ::std::complex< double > __pyx_t_double_complex;
+ #else
+ typedef double _Complex __pyx_t_double_complex;
+ #endif
+#else
+ typedef struct { double real, imag; } __pyx_t_double_complex;
+#endif
+
+
+/*--- Type declarations ---*/
+struct __pyx_array_obj;
+struct __pyx_MemviewEnum_obj;
+struct __pyx_memoryview_obj;
+struct __pyx_memoryviewslice_obj;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762
+ * ctypedef npy_longdouble longdouble_t
+ *
+ * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
+ * ctypedef npy_cdouble cdouble_t
+ * ctypedef npy_clongdouble clongdouble_t
+ */
+typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763
+ *
+ * ctypedef npy_cfloat cfloat_t
+ * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
+ * ctypedef npy_clongdouble clongdouble_t
+ *
+ */
+typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
+ * ctypedef npy_cfloat cfloat_t
+ * ctypedef npy_cdouble cdouble_t
+ * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_cdouble complex_t
+ */
+typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
+ * ctypedef npy_clongdouble clongdouble_t
+ *
+ * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew1(a):
+ */
+typedef npy_cdouble __pyx_t_5numpy_complex_t;
+
+/* "View.MemoryView":99
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+struct __pyx_array_obj {
+ PyObject_HEAD
+ char *data;
+ Py_ssize_t len;
+ char *format;
+ int ndim;
+ Py_ssize_t *_shape;
+ Py_ssize_t *_strides;
+ Py_ssize_t itemsize;
+ PyObject *mode;
+ PyObject *_format;
+ void (*callback_free_data)(void *);
+ int free_data;
+ int dtype_is_object;
+};
+
+
+/* "View.MemoryView":269
+ *
+ * @cname('__pyx_MemviewEnum')
+ * cdef class Enum(object): # <<<<<<<<<<<<<<
+ * cdef object name
+ * def __init__(self, name):
+ */
+struct __pyx_MemviewEnum_obj {
+ PyObject_HEAD
+ PyObject *name;
+};
+
+
+/* "View.MemoryView":302
+ *
+ * @cname('__pyx_memoryview')
+ * cdef class memoryview(object): # <<<<<<<<<<<<<<
+ *
+ * cdef object obj
+ */
+struct __pyx_memoryview_obj {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_memoryview *__pyx_vtab;
+ PyObject *obj;
+ PyObject *_size;
+ PyObject *_array_interface;
+ PyThread_type_lock lock;
+ __pyx_atomic_int acquisition_count[2];
+ __pyx_atomic_int *acquisition_count_aligned_p;
+ Py_buffer view;
+ int flags;
+ int dtype_is_object;
+ __Pyx_TypeInfo *typeinfo;
+};
+
+
+/* "View.MemoryView":922
+ *
+ * @cname('__pyx_memoryviewslice')
+ * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
+ * "Internal class for passing memoryview slices to Python"
+ *
+ */
+struct __pyx_memoryviewslice_obj {
+ struct __pyx_memoryview_obj __pyx_base;
+ __Pyx_memviewslice from_slice;
+ PyObject *from_object;
+ PyObject *(*to_object_func)(char *);
+ int (*to_dtype_func)(char *, PyObject *);
+};
+
+
+
+/* "View.MemoryView":302
+ *
+ * @cname('__pyx_memoryview')
+ * cdef class memoryview(object): # <<<<<<<<<<<<<<
+ *
+ * cdef object obj
+ */
+
+struct __pyx_vtabstruct_memoryview {
+ char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
+ PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
+ PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
+ PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
+};
+static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
+
+
+/* "View.MemoryView":922
+ *
+ * @cname('__pyx_memoryviewslice')
+ * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
+ * "Internal class for passing memoryview slices to Python"
+ *
+ */
+
+struct __pyx_vtabstruct__memoryviewslice {
+ struct __pyx_vtabstruct_memoryview __pyx_base;
+};
+static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ if (acquire_gil) { \
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ PyGILState_Release(__pyx_gilstate_save); \
+ } else { \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext() \
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_XDECREF(tmp); \
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_DECREF(tmp); \
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+static CYTHON_INLINE 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
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
+#else
+#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
+ PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
+ PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
+ int has_cstart, int has_cstop, int wraparound);
+
+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_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
+#define __Pyx_MEMVIEW_DIRECT 1
+#define __Pyx_MEMVIEW_PTR 2
+#define __Pyx_MEMVIEW_FULL 4
+#define __Pyx_MEMVIEW_CONTIG 8
+#define __Pyx_MEMVIEW_STRIDED 16
+#define __Pyx_MEMVIEW_FOLLOW 32
+#define __Pyx_IS_C_CONTIG 1
+#define __Pyx_IS_F_CONTIG 2
+static int __Pyx_init_memviewslice(
+ struct __pyx_memoryview_obj *memview,
+ int ndim,
+ __Pyx_memviewslice *memviewslice,
+ int memview_is_new_reference);
+static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
+ __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
+static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
+ __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
+#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
+#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
+#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
+#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
+static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
+static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
+
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+ const char* function_name);
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+ const char *name, int exact);
+
+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 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);
+
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+
+static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+
+#include <string.h>
+
+static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
+
+static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
+#else
+#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
+#endif
+
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */
+
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
+
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+
+static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+ const char* cstring, Py_ssize_t start, Py_ssize_t stop,
+ const char* encoding, const char* errors,
+ PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
+
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
+static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+
+#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_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
+ PyListObject* L = (PyListObject*) list;
+ Py_ssize_t len = Py_SIZE(list);
+ if (likely(L->allocated > len)) {
+ Py_INCREF(x);
+ PyList_SET_ITEM(list, len, x);
+ Py_SIZE(list) = len+1;
+ return 0;
+ }
+ return PyList_Append(list, x);
+}
+#else
+#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
+#endif
+
+static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/
+static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject* none = _PyList_Extend((PyListObject*)L, v);
+ if (unlikely(!none))
+ return -1;
+ Py_DECREF(none);
+ return 0;
+#else
+ return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
+#endif
+}
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
+ PyListObject* L = (PyListObject*) list;
+ Py_ssize_t len = Py_SIZE(list);
+ if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
+ Py_INCREF(x);
+ PyList_SET_ITEM(list, len, x);
+ Py_SIZE(list) = len+1;
+ return 0;
+ }
+ return PyList_Append(list, x);
+}
+#else
+#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
+#endif
+
+static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
+
+static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
+
+static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
+static void __Pyx_WriteUnraisable(const char *name, int clineno,
+ int lineno, const char *filename,
+ int full_traceback);
+
+static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+
+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);
+
+typedef struct {
+ Py_ssize_t shape, strides, suboffsets;
+} __Pyx_Buf_DimInfo;
+typedef struct {
+ size_t refcount;
+ Py_buffer pybuffer;
+} __Pyx_Buffer;
+typedef struct {
+ __Pyx_Buffer *rcbuffer;
+ char *data;
+ __Pyx_Buf_DimInfo diminfo[8];
+} __Pyx_LocalBuf_ND;
+
+#if PY_MAJOR_VERSION < 3
+ static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
+ static void __Pyx_ReleaseBuffer(Py_buffer *view);
+#else
+ #define __Pyx_GetBuffer PyObject_GetBuffer
+ #define __Pyx_ReleaseBuffer PyBuffer_Release
+#endif
+
+
+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);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
+
+static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
+
+static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int32_t(const char *itemp);
+static int __pyx_memview_set_nn___pyx_t_5numpy_int32_t(const char *itemp, PyObject *obj);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int8(npy_int8 value);
+
+static CYTHON_INLINE npy_int8 __Pyx_PyInt_As_npy_int8(PyObject *);
+
+static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int8_t(const char *itemp);
+static int __pyx_memview_set_nn___pyx_t_5numpy_int8_t(const char *itemp, PyObject *obj);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value);
+
+static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *);
+
+static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp);
+static int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj);
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ #define __Pyx_CREAL(z) ((z).real())
+ #define __Pyx_CIMAG(z) ((z).imag())
+ #else
+ #define __Pyx_CREAL(z) (__real__(z))
+ #define __Pyx_CIMAG(z) (__imag__(z))
+ #endif
+#else
+ #define __Pyx_CREAL(z) ((z).real)
+ #define __Pyx_CIMAG(z) ((z).imag)
+#endif
+#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
+ #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
+ #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
+#endif
+
+static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
+
+#if CYTHON_CCOMPLEX
+ #define __Pyx_c_eqf(a, b) ((a)==(b))
+ #define __Pyx_c_sumf(a, b) ((a)+(b))
+ #define __Pyx_c_difff(a, b) ((a)-(b))
+ #define __Pyx_c_prodf(a, b) ((a)*(b))
+ #define __Pyx_c_quotf(a, b) ((a)/(b))
+ #define __Pyx_c_negf(a) (-(a))
+ #ifdef __cplusplus
+ #define __Pyx_c_is_zerof(z) ((z)==(float)0)
+ #define __Pyx_c_conjf(z) (::std::conj(z))
+ #if 1
+ #define __Pyx_c_absf(z) (::std::abs(z))
+ #define __Pyx_c_powf(a, b) (::std::pow(a, b))
+ #endif
+ #else
+ #define __Pyx_c_is_zerof(z) ((z)==0)
+ #define __Pyx_c_conjf(z) (conjf(z))
+ #if 1
+ #define __Pyx_c_absf(z) (cabsf(z))
+ #define __Pyx_c_powf(a, b) (cpowf(a, b))
+ #endif
+ #endif
+#else
+ static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
+ #if 1
+ static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
+ #endif
+#endif
+
+static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
+
+#if CYTHON_CCOMPLEX
+ #define __Pyx_c_eq(a, b) ((a)==(b))
+ #define __Pyx_c_sum(a, b) ((a)+(b))
+ #define __Pyx_c_diff(a, b) ((a)-(b))
+ #define __Pyx_c_prod(a, b) ((a)*(b))
+ #define __Pyx_c_quot(a, b) ((a)/(b))
+ #define __Pyx_c_neg(a) (-(a))
+ #ifdef __cplusplus
+ #define __Pyx_c_is_zero(z) ((z)==(double)0)
+ #define __Pyx_c_conj(z) (::std::conj(z))
+ #if 1
+ #define __Pyx_c_abs(z) (::std::abs(z))
+ #define __Pyx_c_pow(a, b) (::std::pow(a, b))
+ #endif
+ #else
+ #define __Pyx_c_is_zero(z) ((z)==0)
+ #define __Pyx_c_conj(z) (conj(z))
+ #if 1
+ #define __Pyx_c_abs(z) (cabs(z))
+ #define __Pyx_c_pow(a, b) (cpow(a, b))
+ #endif
+ #endif
+#else
+ static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
+ #if 1
+ static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
+ #endif
+#endif
+
+static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
+ char order, int ndim);
+
+static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize);
+
+static __Pyx_memviewslice
+__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
+ const char *mode, int ndim,
+ size_t sizeof_dtype, int contig_flag,
+ int dtype_is_object);
+
+static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
+
+static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
+
+static int __Pyx_ValidateAndInit_memviewslice(
+ int *axes_specs,
+ int c_or_f_flag,
+ int buf_flags,
+ int ndim,
+ __Pyx_TypeInfo *dtype,
+ __Pyx_BufFmt_StackElem stack[],
+ __Pyx_memviewslice *memviewslice,
+ PyObject *original_obj);
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(PyObject *);
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int8_t(PyObject *);
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(PyObject *);
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *);
+
+static int __Pyx_check_binary_version(void);
+
+#if !defined(__Pyx_PyIdentifier_FromString)
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
+#else
+ #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
+#endif
+#endif
+
+static PyObject *__Pyx_ImportModule(const char *name);
+
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
+static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
+static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
+static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
+static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
+static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
+static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
+static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
+static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
+
+/* Module declarations from 'cpython.buffer' */
+
+/* Module declarations from 'cpython.ref' */
+
+/* Module declarations from 'libc.string' */
+
+/* Module declarations from 'libc.stdio' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.type' */
+static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
+
+/* Module declarations from 'libc.stdlib' */
+
+/* Module declarations from 'numpy' */
+
+/* Module declarations from 'numpy' */
+static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
+static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
+static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
+static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
+static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
+static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
+
+/* Module declarations from 'cython.view' */
+
+/* Module declarations from 'cython' */
+
+/* Module declarations from 'fabio.ext.byte_offset' */
+static PyTypeObject *__pyx_array_type = 0;
+static PyTypeObject *__pyx_MemviewEnum_type = 0;
+static PyTypeObject *__pyx_memoryview_type = 0;
+static PyTypeObject *__pyx_memoryviewslice_type = 0;
+static PyObject *generic = 0;
+static PyObject *strided = 0;
+static PyObject *indirect = 0;
+static PyObject *contiguous = 0;
+static PyObject *indirect_contiguous = 0;
+static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
+static void *__pyx_align_pointer(void *, size_t); /*proto*/
+static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
+static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
+static PyObject *_unellipsify(PyObject *, int); /*proto*/
+static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
+static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
+static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
+static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
+static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
+static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
+static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
+static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
+static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
+static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
+static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
+static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
+static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
+static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
+static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
+static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
+static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
+static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
+static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
+static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
+static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
+static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
+static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
+static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t = { "int8_t", NULL, sizeof(__pyx_t_5numpy_int8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int8_t), 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 };
+#define __Pyx_MODULE_NAME "fabio.ext.byte_offset"
+int __pyx_module_is_main_fabio__ext__byte_offset = 0;
+
+/* Implementation of 'fabio.ext.byte_offset' */
+static PyObject *__pyx_builtin_range;
+static PyObject *__pyx_builtin_ValueError;
+static PyObject *__pyx_builtin_RuntimeError;
+static PyObject *__pyx_builtin_MemoryError;
+static PyObject *__pyx_builtin_enumerate;
+static PyObject *__pyx_builtin_Ellipsis;
+static PyObject *__pyx_builtin_TypeError;
+static PyObject *__pyx_builtin_xrange;
+static PyObject *__pyx_builtin_id;
+static PyObject *__pyx_builtin_IndexError;
+static PyObject *__pyx_pf_5fabio_3ext_11byte_offset_comp_cbf32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_11byte_offset_2comp_cbf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_11byte_offset_4dec_cbf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_size); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_11byte_offset_6dec_cbf32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_size); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_11byte_offset_8dec_TY5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_size); /* 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 int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
+static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
+static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
+static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
+static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
+static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
+static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
+static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+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_c[] = "c";
+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_q[] = "q";
+static char __pyx_k_Zd[] = "Zd";
+static char __pyx_k_Zf[] = "Zf";
+static char __pyx_k_Zg[] = "Zg";
+static char __pyx_k_id[] = "id";
+static char __pyx_k_MIT[] = "MIT";
+static char __pyx_k_ary[] = "ary";
+static char __pyx_k_obj[] = "obj";
+static char __pyx_k_base[] = "base";
+static char __pyx_k_data[] = "data";
+static char __pyx_k_date[] = "__date__";
+static char __pyx_k_int8[] = "int8";
+static char __pyx_k_key0[] = "key0";
+static char __pyx_k_key8[] = "key8";
+static char __pyx_k_last[] = "last";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_mode[] = "mode";
+static char __pyx_k_name[] = "name";
+static char __pyx_k_ndim[] = "ndim";
+static char __pyx_k_pack[] = "pack";
+static char __pyx_k_size[] = "size";
+static char __pyx_k_step[] = "step";
+static char __pyx_k_stop[] = "stop";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_tmp8[] = "tmp8";
+static char __pyx_k_class[] = "__class__";
+static char __pyx_k_csize[] = "csize";
+static char __pyx_k_delta[] = "delta";
+static char __pyx_k_dtype[] = "dtype";
+static char __pyx_k_empty[] = "empty";
+static char __pyx_k_error[] = "error";
+static char __pyx_k_flags[] = "flags";
+static char __pyx_k_int32[] = "int32";
+static char __pyx_k_int64[] = "int64";
+static char __pyx_k_numpy[] = "numpy";
+static char __pyx_k_range[] = "range";
+static char __pyx_k_ravel[] = "ravel";
+static char __pyx_k_shape[] = "shape";
+static char __pyx_k_start[] = "start";
+static char __pyx_k_tmp64[] = "tmp64";
+static char __pyx_k_zeros[] = "zeros";
+static char __pyx_k_author[] = "__author__";
+static char __pyx_k_format[] = "format";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_name_2[] = "__name__";
+static char __pyx_k_output[] = "output";
+static char __pyx_k_stream[] = "stream";
+static char __pyx_k_struct[] = "struct";
+static char __pyx_k_tmp32a[] = "tmp32a";
+static char __pyx_k_tmp32b[] = "tmp32b";
+static char __pyx_k_tmp64a[] = "tmp64a";
+static char __pyx_k_tmp64b[] = "tmp64b";
+static char __pyx_k_tmp64c[] = "tmp64c";
+static char __pyx_k_tmp64d[] = "tmp64d";
+static char __pyx_k_tmp64e[] = "tmp64e";
+static char __pyx_k_tmp64f[] = "tmp64f";
+static char __pyx_k_tmp64g[] = "tmp64g";
+static char __pyx_k_unpack[] = "unpack";
+static char __pyx_k_xrange[] = "xrange";
+static char __pyx_k_asarray[] = "asarray";
+static char __pyx_k_contact[] = "__contact__";
+static char __pyx_k_cstream[] = "cstream";
+static char __pyx_k_current[] = "current";
+static char __pyx_k_dataOut[] = "dataOut";
+static char __pyx_k_dec_TY5[] = "dec_TY5";
+static char __pyx_k_dec_cbf[] = "dec_cbf";
+static char __pyx_k_fortran[] = "fortran";
+static char __pyx_k_license[] = "__license__";
+static char __pyx_k_memview[] = "memview";
+static char __pyx_k_Ellipsis[] = "Ellipsis";
+static char __pyx_k_absdelta[] = "absdelta";
+static char __pyx_k_comp_cbf[] = "comp_cbf";
+static char __pyx_k_itemsize[] = "itemsize";
+static char __pyx_k_TypeError[] = "TypeError";
+static char __pyx_k_copyright[] = "__copyright__";
+static char __pyx_k_dec_cbf32[] = "dec_cbf32";
+static char __pyx_k_enumerate[] = "enumerate";
+static char __pyx_k_lenStream[] = "lenStream";
+static char __pyx_k_25_07_2017[] = "25/07/2017";
+static char __pyx_k_IndexError[] = "IndexError";
+static char __pyx_k_ValueError[] = "ValueError";
+static char __pyx_k_comp_cbf32[] = "comp_cbf32";
+static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static char __pyx_k_MemoryError[] = "MemoryError";
+static char __pyx_k_RuntimeError[] = "RuntimeError";
+static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
+static char __pyx_k_Jerome_Kieffer[] = "Jerome Kieffer";
+static char __pyx_k_allocate_buffer[] = "allocate_buffer";
+static char __pyx_k_dtype_is_object[] = "dtype_is_object";
+static char __pyx_k_ascontiguousarray[] = "ascontiguousarray";
+static char __pyx_k_strided_and_direct[] = "<strided and direct>";
+static char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
+static char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
+static char __pyx_k_fabio_ext_byte_offset[] = "fabio.ext.byte_offset";
+static char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
+static char __pyx_k_jerome_kieffer_esrf_eu[] = "jerome.kieffer@esrf.eu";
+static char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
+static char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
+static char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
+static char __pyx_k_getbuffer_obj_view_flags[] = "getbuffer(obj, view, flags)";
+static char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
+static char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
+static char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)";
+static char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)";
+static char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
+static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
+static char __pyx_k_Cif_Binary_Files_images_are_2D[] = "\nCif Binary Files images are 2D images written by the Pilatus detector and others.\nThey use a modified (simplified) byte-offset algorithm. This file contains the\ndecompression function from a string to an int64 numpy array.\n";
+static char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
+static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static char __pyx_k_workspace_valls_fabio_git_fabio[] = "/workspace/valls/fabio.git/fabio/ext/byte_offset.pyx";
+static char __pyx_k_2010_2016_European_Synchrotron_R[] = "2010-2016, European Synchrotron Radiation Facility, Grenoble, France";
+static char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
+static char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
+static char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
+static char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
+static char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
+static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
+static char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
+static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
+static char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
+static char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
+static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
+static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static PyObject *__pyx_kp_s_2010_2016_European_Synchrotron_R;
+static PyObject *__pyx_kp_s_25_07_2017;
+static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
+static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
+static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
+static PyObject *__pyx_n_s_Ellipsis;
+static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
+static PyObject *__pyx_n_s_IndexError;
+static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
+static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
+static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
+static PyObject *__pyx_kp_s_Jerome_Kieffer;
+static PyObject *__pyx_n_s_MIT;
+static PyObject *__pyx_n_s_MemoryError;
+static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
+static PyObject *__pyx_kp_s_MemoryView_of_r_object;
+static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
+static PyObject *__pyx_n_b_O;
+static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
+static PyObject *__pyx_n_s_RuntimeError;
+static PyObject *__pyx_n_s_TypeError;
+static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_n_s_absdelta;
+static PyObject *__pyx_n_s_allocate_buffer;
+static PyObject *__pyx_n_s_ary;
+static PyObject *__pyx_n_s_asarray;
+static PyObject *__pyx_n_s_ascontiguousarray;
+static PyObject *__pyx_n_s_author;
+static PyObject *__pyx_n_s_base;
+static PyObject *__pyx_n_s_c;
+static PyObject *__pyx_n_u_c;
+static PyObject *__pyx_n_s_class;
+static PyObject *__pyx_n_s_comp_cbf;
+static PyObject *__pyx_n_s_comp_cbf32;
+static PyObject *__pyx_n_s_contact;
+static PyObject *__pyx_kp_s_contiguous_and_direct;
+static PyObject *__pyx_kp_s_contiguous_and_indirect;
+static PyObject *__pyx_n_s_copyright;
+static PyObject *__pyx_n_s_csize;
+static PyObject *__pyx_n_s_cstream;
+static PyObject *__pyx_n_s_current;
+static PyObject *__pyx_n_s_data;
+static PyObject *__pyx_n_s_dataOut;
+static PyObject *__pyx_n_s_date;
+static PyObject *__pyx_n_s_dec_TY5;
+static PyObject *__pyx_n_s_dec_cbf;
+static PyObject *__pyx_n_s_dec_cbf32;
+static PyObject *__pyx_n_s_delta;
+static PyObject *__pyx_n_s_dtype;
+static PyObject *__pyx_n_s_dtype_is_object;
+static PyObject *__pyx_n_s_empty;
+static PyObject *__pyx_n_s_enumerate;
+static PyObject *__pyx_n_s_error;
+static PyObject *__pyx_n_s_fabio_ext_byte_offset;
+static PyObject *__pyx_n_s_flags;
+static PyObject *__pyx_n_s_format;
+static PyObject *__pyx_n_s_fortran;
+static PyObject *__pyx_n_u_fortran;
+static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
+static PyObject *__pyx_n_s_i;
+static PyObject *__pyx_n_s_id;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_int32;
+static PyObject *__pyx_n_s_int64;
+static PyObject *__pyx_n_s_int8;
+static PyObject *__pyx_n_s_itemsize;
+static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
+static PyObject *__pyx_n_s_j;
+static PyObject *__pyx_kp_s_jerome_kieffer_esrf_eu;
+static PyObject *__pyx_n_s_key0;
+static PyObject *__pyx_n_s_key8;
+static PyObject *__pyx_n_s_last;
+static PyObject *__pyx_n_s_lenStream;
+static PyObject *__pyx_n_s_license;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_memview;
+static PyObject *__pyx_n_s_mode;
+static PyObject *__pyx_n_s_name;
+static PyObject *__pyx_n_s_name_2;
+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_ndim;
+static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_n_s_obj;
+static PyObject *__pyx_n_s_output;
+static PyObject *__pyx_n_s_pack;
+static PyObject *__pyx_n_s_pyx_getbuffer;
+static PyObject *__pyx_n_s_pyx_vtable;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_ravel;
+static PyObject *__pyx_n_s_shape;
+static PyObject *__pyx_n_s_size;
+static PyObject *__pyx_n_s_start;
+static PyObject *__pyx_n_s_step;
+static PyObject *__pyx_n_s_stop;
+static PyObject *__pyx_n_s_stream;
+static PyObject *__pyx_kp_s_strided_and_direct;
+static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
+static PyObject *__pyx_kp_s_strided_and_indirect;
+static PyObject *__pyx_n_s_struct;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_tmp32a;
+static PyObject *__pyx_n_s_tmp32b;
+static PyObject *__pyx_n_s_tmp64;
+static PyObject *__pyx_n_s_tmp64a;
+static PyObject *__pyx_n_s_tmp64b;
+static PyObject *__pyx_n_s_tmp64c;
+static PyObject *__pyx_n_s_tmp64d;
+static PyObject *__pyx_n_s_tmp64e;
+static PyObject *__pyx_n_s_tmp64f;
+static PyObject *__pyx_n_s_tmp64g;
+static PyObject *__pyx_n_s_tmp8;
+static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
+static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
+static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
+static PyObject *__pyx_n_s_unpack;
+static PyObject *__pyx_kp_s_workspace_valls_fabio_git_fabio;
+static PyObject *__pyx_n_s_xrange;
+static PyObject *__pyx_n_s_zeros;
+static PyObject *__pyx_int_0;
+static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_2147483648;
+static PyObject *__pyx_int_neg_1;
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_tuple__2;
+static PyObject *__pyx_tuple__3;
+static PyObject *__pyx_tuple__4;
+static PyObject *__pyx_tuple__5;
+static PyObject *__pyx_tuple__6;
+static PyObject *__pyx_tuple__7;
+static PyObject *__pyx_tuple__8;
+static PyObject *__pyx_tuple__9;
+static PyObject *__pyx_slice__14;
+static PyObject *__pyx_slice__15;
+static PyObject *__pyx_slice__16;
+static PyObject *__pyx_tuple__10;
+static PyObject *__pyx_tuple__11;
+static PyObject *__pyx_tuple__12;
+static PyObject *__pyx_tuple__13;
+static PyObject *__pyx_tuple__17;
+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__29;
+static PyObject *__pyx_tuple__30;
+static PyObject *__pyx_tuple__31;
+static PyObject *__pyx_tuple__32;
+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;
+
+/* "fabio/ext/byte_offset.pyx":48
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def comp_cbf32(data not None): # <<<<<<<<<<<<<<
+ * """Compress a dataset using the byte-offset described for Pilatus
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_11byte_offset_1comp_cbf32(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
+static char __pyx_doc_5fabio_3ext_11byte_offset_comp_cbf32[] = "Compress a dataset using the byte-offset described for Pilatus\n\n :param data: array of integers\n :return: numpy array of chars\n ";
+static PyMethodDef __pyx_mdef_5fabio_3ext_11byte_offset_1comp_cbf32 = {"comp_cbf32", (PyCFunction)__pyx_pw_5fabio_3ext_11byte_offset_1comp_cbf32, METH_O, __pyx_doc_5fabio_3ext_11byte_offset_comp_cbf32};
+static PyObject *__pyx_pw_5fabio_3ext_11byte_offset_1comp_cbf32(PyObject *__pyx_self, PyObject *__pyx_v_data) {
+ 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("comp_cbf32 (wrapper)", 0);
+ if (unlikely(((PyObject *)__pyx_v_data) == Py_None)) {
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "data"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_r = __pyx_pf_5fabio_3ext_11byte_offset_comp_cbf32(__pyx_self, ((PyObject *)__pyx_v_data));
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_11byte_offset_comp_cbf32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
+ __Pyx_memviewslice __pyx_v_ary = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_size;
+ int __pyx_v_i;
+ int __pyx_v_j;
+ __Pyx_memviewslice __pyx_v_output = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __pyx_t_5numpy_int32_t __pyx_v_last;
+ __pyx_t_5numpy_int32_t __pyx_v_current;
+ __pyx_t_5numpy_int32_t __pyx_v_delta;
+ __pyx_t_5numpy_int32_t __pyx_v_absdelta;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_t_7;
+ __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_t_9;
+ int __pyx_t_10;
+ int __pyx_t_11;
+ int __pyx_t_12;
+ long __pyx_t_13;
+ long __pyx_t_14;
+ long __pyx_t_15;
+ long __pyx_t_16;
+ long __pyx_t_17;
+ long __pyx_t_18;
+ int __pyx_t_19;
+ long __pyx_t_20;
+ long __pyx_t_21;
+ int __pyx_t_22;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("comp_cbf32", 0);
+
+ /* "fabio/ext/byte_offset.pyx":55
+ * """
+ * cdef:
+ * numpy.int32_t[::1] ary = numpy.ascontiguousarray(data.ravel(), dtype=numpy.int32) # <<<<<<<<<<<<<<
+ * int size = ary.size, i = 0, j = 0
+ * numpy.int8_t[::1] output = numpy.zeros(size * 7, dtype=numpy.int8)
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (__pyx_t_4) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else {
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 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 = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __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 = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(__pyx_t_5);
+ if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_ary = __pyx_t_6;
+ __pyx_t_6.memview = NULL;
+ __pyx_t_6.data = NULL;
+
+ /* "fabio/ext/byte_offset.pyx":56
+ * cdef:
+ * numpy.int32_t[::1] ary = numpy.ascontiguousarray(data.ravel(), dtype=numpy.int32)
+ * int size = ary.size, i = 0, j = 0 # <<<<<<<<<<<<<<
+ * numpy.int8_t[::1] output = numpy.zeros(size * 7, dtype=numpy.int8)
+ * numpy.int32_t last, current, delta, absdelta
+ */
+ __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_ary, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_size = __pyx_t_7;
+ __pyx_v_i = 0;
+ __pyx_v_j = 0;
+
+ /* "fabio/ext/byte_offset.pyx":57
+ * numpy.int32_t[::1] ary = numpy.ascontiguousarray(data.ravel(), dtype=numpy.int32)
+ * int size = ary.size, i = 0, j = 0
+ * numpy.int8_t[::1] output = numpy.zeros(size * 7, dtype=numpy.int8) # <<<<<<<<<<<<<<
+ * numpy.int32_t last, current, delta, absdelta
+ * last = 0
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_size * 7)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __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 = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 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 = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __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, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int8_t(__pyx_t_4);
+ if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_output = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
+
+ /* "fabio/ext/byte_offset.pyx":59
+ * numpy.int8_t[::1] output = numpy.zeros(size * 7, dtype=numpy.int8)
+ * numpy.int32_t last, current, delta, absdelta
+ * last = 0 # <<<<<<<<<<<<<<
+ * for i in range(size):
+ * current = ary[i]
+ */
+ __pyx_v_last = 0;
+
+ /* "fabio/ext/byte_offset.pyx":60
+ * numpy.int32_t last, current, delta, absdelta
+ * last = 0
+ * for i in range(size): # <<<<<<<<<<<<<<
+ * current = ary[i]
+ * delta = current - last
+ */
+ __pyx_t_7 = __pyx_v_size;
+ for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_7; __pyx_t_9+=1) {
+ __pyx_v_i = __pyx_t_9;
+
+ /* "fabio/ext/byte_offset.pyx":61
+ * last = 0
+ * for i in range(size):
+ * current = ary[i] # <<<<<<<<<<<<<<
+ * delta = current - last
+ * absdelta = delta if delta > 0 else -delta
+ */
+ __pyx_t_10 = __pyx_v_i;
+ __pyx_v_current = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_ary.data) + __pyx_t_10)) )));
+
+ /* "fabio/ext/byte_offset.pyx":62
+ * for i in range(size):
+ * current = ary[i]
+ * delta = current - last # <<<<<<<<<<<<<<
+ * absdelta = delta if delta > 0 else -delta
+ * if absdelta >= 1 << 15:
+ */
+ __pyx_v_delta = (__pyx_v_current - __pyx_v_last);
+
+ /* "fabio/ext/byte_offset.pyx":63
+ * current = ary[i]
+ * delta = current - last
+ * absdelta = delta if delta > 0 else -delta # <<<<<<<<<<<<<<
+ * if absdelta >= 1 << 15:
+ * output[j] = -128
+ */
+ if (((__pyx_v_delta > 0) != 0)) {
+ __pyx_t_11 = __pyx_v_delta;
+ } else {
+ __pyx_t_11 = (-__pyx_v_delta);
+ }
+ __pyx_v_absdelta = __pyx_t_11;
+
+ /* "fabio/ext/byte_offset.pyx":64
+ * delta = current - last
+ * absdelta = delta if delta > 0 else -delta
+ * if absdelta >= 1 << 15: # <<<<<<<<<<<<<<
+ * output[j] = -128
+ * output[j + 1] = 0
+ */
+ __pyx_t_12 = ((__pyx_v_absdelta >= 32768) != 0);
+ if (__pyx_t_12) {
+
+ /* "fabio/ext/byte_offset.pyx":65
+ * absdelta = delta if delta > 0 else -delta
+ * if absdelta >= 1 << 15:
+ * output[j] = -128 # <<<<<<<<<<<<<<
+ * output[j + 1] = 0
+ * output[j + 2] = -128
+ */
+ __pyx_t_11 = __pyx_v_j;
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_11)) )) = -128;
+
+ /* "fabio/ext/byte_offset.pyx":66
+ * if absdelta >= 1 << 15:
+ * output[j] = -128
+ * output[j + 1] = 0 # <<<<<<<<<<<<<<
+ * output[j + 2] = -128
+ * output[j + 3] = (delta & 255)
+ */
+ __pyx_t_13 = (__pyx_v_j + 1);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_13)) )) = 0;
+
+ /* "fabio/ext/byte_offset.pyx":67
+ * output[j] = -128
+ * output[j + 1] = 0
+ * output[j + 2] = -128 # <<<<<<<<<<<<<<
+ * output[j + 3] = (delta & 255)
+ * output[j + 4] = (delta >> 8) & 255
+ */
+ __pyx_t_14 = (__pyx_v_j + 2);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_14)) )) = -128;
+
+ /* "fabio/ext/byte_offset.pyx":68
+ * output[j + 1] = 0
+ * output[j + 2] = -128
+ * output[j + 3] = (delta & 255) # <<<<<<<<<<<<<<
+ * output[j + 4] = (delta >> 8) & 255
+ * output[j + 5] = (delta >> 16) & 255
+ */
+ __pyx_t_15 = (__pyx_v_j + 3);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_15)) )) = (__pyx_v_delta & 255);
+
+ /* "fabio/ext/byte_offset.pyx":69
+ * output[j + 2] = -128
+ * output[j + 3] = (delta & 255)
+ * output[j + 4] = (delta >> 8) & 255 # <<<<<<<<<<<<<<
+ * output[j + 5] = (delta >> 16) & 255
+ * output[j + 6] = (delta >> 24)
+ */
+ __pyx_t_16 = (__pyx_v_j + 4);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_16)) )) = ((__pyx_v_delta >> 8) & 255);
+
+ /* "fabio/ext/byte_offset.pyx":70
+ * output[j + 3] = (delta & 255)
+ * output[j + 4] = (delta >> 8) & 255
+ * output[j + 5] = (delta >> 16) & 255 # <<<<<<<<<<<<<<
+ * output[j + 6] = (delta >> 24)
+ * j += 7
+ */
+ __pyx_t_17 = (__pyx_v_j + 5);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_17)) )) = ((__pyx_v_delta >> 16) & 255);
+
+ /* "fabio/ext/byte_offset.pyx":71
+ * output[j + 4] = (delta >> 8) & 255
+ * output[j + 5] = (delta >> 16) & 255
+ * output[j + 6] = (delta >> 24) # <<<<<<<<<<<<<<
+ * j += 7
+ * elif absdelta >= 1 << 7:
+ */
+ __pyx_t_18 = (__pyx_v_j + 6);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_18)) )) = (__pyx_v_delta >> 24);
+
+ /* "fabio/ext/byte_offset.pyx":72
+ * output[j + 5] = (delta >> 16) & 255
+ * output[j + 6] = (delta >> 24)
+ * j += 7 # <<<<<<<<<<<<<<
+ * elif absdelta >= 1 << 7:
+ * output[j] = -128
+ */
+ __pyx_v_j = (__pyx_v_j + 7);
+ goto __pyx_L5;
+ }
+
+ /* "fabio/ext/byte_offset.pyx":73
+ * output[j + 6] = (delta >> 24)
+ * j += 7
+ * elif absdelta >= 1 << 7: # <<<<<<<<<<<<<<
+ * output[j] = -128
+ * output[j + 1] = delta & 255
+ */
+ __pyx_t_12 = ((__pyx_v_absdelta >= 128) != 0);
+ if (__pyx_t_12) {
+
+ /* "fabio/ext/byte_offset.pyx":74
+ * j += 7
+ * elif absdelta >= 1 << 7:
+ * output[j] = -128 # <<<<<<<<<<<<<<
+ * output[j + 1] = delta & 255
+ * output[j + 2] = (delta >> 8) & 255
+ */
+ __pyx_t_19 = __pyx_v_j;
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_19)) )) = -128;
+
+ /* "fabio/ext/byte_offset.pyx":75
+ * elif absdelta >= 1 << 7:
+ * output[j] = -128
+ * output[j + 1] = delta & 255 # <<<<<<<<<<<<<<
+ * output[j + 2] = (delta >> 8) & 255
+ * j += 3
+ */
+ __pyx_t_20 = (__pyx_v_j + 1);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_20)) )) = (__pyx_v_delta & 255);
+
+ /* "fabio/ext/byte_offset.pyx":76
+ * output[j] = -128
+ * output[j + 1] = delta & 255
+ * output[j + 2] = (delta >> 8) & 255 # <<<<<<<<<<<<<<
+ * j += 3
+ * else:
+ */
+ __pyx_t_21 = (__pyx_v_j + 2);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_21)) )) = ((__pyx_v_delta >> 8) & 255);
+
+ /* "fabio/ext/byte_offset.pyx":77
+ * output[j + 1] = delta & 255
+ * output[j + 2] = (delta >> 8) & 255
+ * j += 3 # <<<<<<<<<<<<<<
+ * else:
+ * output[j] = delta
+ */
+ __pyx_v_j = (__pyx_v_j + 3);
+ goto __pyx_L5;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/byte_offset.pyx":79
+ * j += 3
+ * else:
+ * output[j] = delta # <<<<<<<<<<<<<<
+ * j += 1
+ * last = current
+ */
+ __pyx_t_22 = __pyx_v_j;
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_22)) )) = __pyx_v_delta;
+
+ /* "fabio/ext/byte_offset.pyx":80
+ * else:
+ * output[j] = delta
+ * j += 1 # <<<<<<<<<<<<<<
+ * last = current
+ * return numpy.asarray(output)[:j]
+ */
+ __pyx_v_j = (__pyx_v_j + 1);
+ }
+ __pyx_L5:;
+
+ /* "fabio/ext/byte_offset.pyx":81
+ * output[j] = delta
+ * j += 1
+ * last = current # <<<<<<<<<<<<<<
+ * return numpy.asarray(output)[:j]
+ *
+ */
+ __pyx_v_last = __pyx_v_current;
+ }
+
+ /* "fabio/ext/byte_offset.pyx":82
+ * j += 1
+ * last = current
+ * return numpy.asarray(output)[:j] # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_output, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (!__pyx_t_5) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else {
+ __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __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_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, __pyx_v_j, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "fabio/ext/byte_offset.pyx":48
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def comp_cbf32(data not None): # <<<<<<<<<<<<<<
+ * """Compress a dataset using the byte-offset described for Pilatus
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
+ __Pyx_AddTraceback("fabio.ext.byte_offset.comp_cbf32", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_ary, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_output, 1);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/byte_offset.pyx":87
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def comp_cbf(data not None): # <<<<<<<<<<<<<<
+ * """Compress a dataset using the byte-offset described for any int64
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_11byte_offset_3comp_cbf(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
+static char __pyx_doc_5fabio_3ext_11byte_offset_2comp_cbf[] = "Compress a dataset using the byte-offset described for any int64\n\n :param data: array of integers\n :return: numpy array of chars\n ";
+static PyMethodDef __pyx_mdef_5fabio_3ext_11byte_offset_3comp_cbf = {"comp_cbf", (PyCFunction)__pyx_pw_5fabio_3ext_11byte_offset_3comp_cbf, METH_O, __pyx_doc_5fabio_3ext_11byte_offset_2comp_cbf};
+static PyObject *__pyx_pw_5fabio_3ext_11byte_offset_3comp_cbf(PyObject *__pyx_self, PyObject *__pyx_v_data) {
+ 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("comp_cbf (wrapper)", 0);
+ if (unlikely(((PyObject *)__pyx_v_data) == Py_None)) {
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "data"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_r = __pyx_pf_5fabio_3ext_11byte_offset_2comp_cbf(__pyx_self, ((PyObject *)__pyx_v_data));
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_11byte_offset_2comp_cbf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
+ __Pyx_memviewslice __pyx_v_ary = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_size;
+ int __pyx_v_i;
+ int __pyx_v_j;
+ __Pyx_memviewslice __pyx_v_output = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __pyx_t_5numpy_int64_t __pyx_v_last;
+ __pyx_t_5numpy_int64_t __pyx_v_current;
+ __pyx_t_5numpy_int64_t __pyx_v_delta;
+ __pyx_t_5numpy_int64_t __pyx_v_absdelta;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_t_7;
+ __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_t_9;
+ int __pyx_t_10;
+ __pyx_t_5numpy_int64_t __pyx_t_11;
+ int __pyx_t_12;
+ int __pyx_t_13;
+ long __pyx_t_14;
+ long __pyx_t_15;
+ long __pyx_t_16;
+ long __pyx_t_17;
+ long __pyx_t_18;
+ long __pyx_t_19;
+ long __pyx_t_20;
+ long __pyx_t_21;
+ long __pyx_t_22;
+ long __pyx_t_23;
+ long __pyx_t_24;
+ long __pyx_t_25;
+ long __pyx_t_26;
+ long __pyx_t_27;
+ int __pyx_t_28;
+ long __pyx_t_29;
+ long __pyx_t_30;
+ long __pyx_t_31;
+ long __pyx_t_32;
+ long __pyx_t_33;
+ long __pyx_t_34;
+ int __pyx_t_35;
+ long __pyx_t_36;
+ long __pyx_t_37;
+ int __pyx_t_38;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("comp_cbf", 0);
+
+ /* "fabio/ext/byte_offset.pyx":94
+ * """
+ * cdef:
+ * numpy.int64_t[::1] ary = numpy.ascontiguousarray(data.ravel(), dtype=numpy.int64) # <<<<<<<<<<<<<<
+ * int size = ary.size, i = 0, j = 0
+ * numpy.int8_t[::1] output = numpy.zeros(size * 15, dtype=numpy.int8)
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (__pyx_t_4) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else {
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 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 = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __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 = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_5);
+ if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_ary = __pyx_t_6;
+ __pyx_t_6.memview = NULL;
+ __pyx_t_6.data = NULL;
+
+ /* "fabio/ext/byte_offset.pyx":95
+ * cdef:
+ * numpy.int64_t[::1] ary = numpy.ascontiguousarray(data.ravel(), dtype=numpy.int64)
+ * int size = ary.size, i = 0, j = 0 # <<<<<<<<<<<<<<
+ * numpy.int8_t[::1] output = numpy.zeros(size * 15, dtype=numpy.int8)
+ * numpy.int64_t last, current, delta, absdelta
+ */
+ __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_ary, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_size = __pyx_t_7;
+ __pyx_v_i = 0;
+ __pyx_v_j = 0;
+
+ /* "fabio/ext/byte_offset.pyx":96
+ * numpy.int64_t[::1] ary = numpy.ascontiguousarray(data.ravel(), dtype=numpy.int64)
+ * int size = ary.size, i = 0, j = 0
+ * numpy.int8_t[::1] output = numpy.zeros(size * 15, dtype=numpy.int8) # <<<<<<<<<<<<<<
+ * numpy.int64_t last, current, delta, absdelta
+ * last = 0
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_size * 15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __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 = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 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 = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __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, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int8_t(__pyx_t_4);
+ if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_output = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
+
+ /* "fabio/ext/byte_offset.pyx":98
+ * numpy.int8_t[::1] output = numpy.zeros(size * 15, dtype=numpy.int8)
+ * numpy.int64_t last, current, delta, absdelta
+ * last = 0 # <<<<<<<<<<<<<<
+ * for i in range(size):
+ * current = ary[i]
+ */
+ __pyx_v_last = 0;
+
+ /* "fabio/ext/byte_offset.pyx":99
+ * numpy.int64_t last, current, delta, absdelta
+ * last = 0
+ * for i in range(size): # <<<<<<<<<<<<<<
+ * current = ary[i]
+ * delta = current - last
+ */
+ __pyx_t_7 = __pyx_v_size;
+ for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_7; __pyx_t_9+=1) {
+ __pyx_v_i = __pyx_t_9;
+
+ /* "fabio/ext/byte_offset.pyx":100
+ * last = 0
+ * for i in range(size):
+ * current = ary[i] # <<<<<<<<<<<<<<
+ * delta = current - last
+ * absdelta = delta if delta > 0 else -delta
+ */
+ __pyx_t_10 = __pyx_v_i;
+ __pyx_v_current = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int64_t *) __pyx_v_ary.data) + __pyx_t_10)) )));
+
+ /* "fabio/ext/byte_offset.pyx":101
+ * for i in range(size):
+ * current = ary[i]
+ * delta = current - last # <<<<<<<<<<<<<<
+ * absdelta = delta if delta > 0 else -delta
+ * if absdelta >= 1 << 31:
+ */
+ __pyx_v_delta = (__pyx_v_current - __pyx_v_last);
+
+ /* "fabio/ext/byte_offset.pyx":102
+ * current = ary[i]
+ * delta = current - last
+ * absdelta = delta if delta > 0 else -delta # <<<<<<<<<<<<<<
+ * if absdelta >= 1 << 31:
+ * output[j] = -128
+ */
+ if (((__pyx_v_delta > 0) != 0)) {
+ __pyx_t_11 = __pyx_v_delta;
+ } else {
+ __pyx_t_11 = (-__pyx_v_delta);
+ }
+ __pyx_v_absdelta = __pyx_t_11;
+
+ /* "fabio/ext/byte_offset.pyx":103
+ * delta = current - last
+ * absdelta = delta if delta > 0 else -delta
+ * if absdelta >= 1 << 31: # <<<<<<<<<<<<<<
+ * output[j] = -128
+ * output[j + 1] = 0
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_absdelta); 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_1 = PyObject_RichCompare(__pyx_t_4, __pyx_int_2147483648, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__pyx_t_12) {
+
+ /* "fabio/ext/byte_offset.pyx":104
+ * absdelta = delta if delta > 0 else -delta
+ * if absdelta >= 1 << 31:
+ * output[j] = -128 # <<<<<<<<<<<<<<
+ * output[j + 1] = 0
+ * output[j + 2] = -128
+ */
+ __pyx_t_13 = __pyx_v_j;
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_13)) )) = -128;
+
+ /* "fabio/ext/byte_offset.pyx":105
+ * if absdelta >= 1 << 31:
+ * output[j] = -128
+ * output[j + 1] = 0 # <<<<<<<<<<<<<<
+ * output[j + 2] = -128
+ * output[j + 3] = 0
+ */
+ __pyx_t_14 = (__pyx_v_j + 1);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_14)) )) = 0;
+
+ /* "fabio/ext/byte_offset.pyx":106
+ * output[j] = -128
+ * output[j + 1] = 0
+ * output[j + 2] = -128 # <<<<<<<<<<<<<<
+ * output[j + 3] = 0
+ * output[j + 4] = 0
+ */
+ __pyx_t_15 = (__pyx_v_j + 2);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_15)) )) = -128;
+
+ /* "fabio/ext/byte_offset.pyx":107
+ * output[j + 1] = 0
+ * output[j + 2] = -128
+ * output[j + 3] = 0 # <<<<<<<<<<<<<<
+ * output[j + 4] = 0
+ * output[j + 5] = 0
+ */
+ __pyx_t_16 = (__pyx_v_j + 3);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_16)) )) = 0;
+
+ /* "fabio/ext/byte_offset.pyx":108
+ * output[j + 2] = -128
+ * output[j + 3] = 0
+ * output[j + 4] = 0 # <<<<<<<<<<<<<<
+ * output[j + 5] = 0
+ * output[j + 6] = -128
+ */
+ __pyx_t_17 = (__pyx_v_j + 4);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_17)) )) = 0;
+
+ /* "fabio/ext/byte_offset.pyx":109
+ * output[j + 3] = 0
+ * output[j + 4] = 0
+ * output[j + 5] = 0 # <<<<<<<<<<<<<<
+ * output[j + 6] = -128
+ * output[j + 7] = (delta & 255)
+ */
+ __pyx_t_18 = (__pyx_v_j + 5);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_18)) )) = 0;
+
+ /* "fabio/ext/byte_offset.pyx":110
+ * output[j + 4] = 0
+ * output[j + 5] = 0
+ * output[j + 6] = -128 # <<<<<<<<<<<<<<
+ * output[j + 7] = (delta & 255)
+ * output[j + 8] = (delta >> 8) & 255
+ */
+ __pyx_t_19 = (__pyx_v_j + 6);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_19)) )) = -128;
+
+ /* "fabio/ext/byte_offset.pyx":111
+ * output[j + 5] = 0
+ * output[j + 6] = -128
+ * output[j + 7] = (delta & 255) # <<<<<<<<<<<<<<
+ * output[j + 8] = (delta >> 8) & 255
+ * output[j + 9] = (delta >> 16) & 255
+ */
+ __pyx_t_20 = (__pyx_v_j + 7);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_20)) )) = (__pyx_v_delta & 255);
+
+ /* "fabio/ext/byte_offset.pyx":112
+ * output[j + 6] = -128
+ * output[j + 7] = (delta & 255)
+ * output[j + 8] = (delta >> 8) & 255 # <<<<<<<<<<<<<<
+ * output[j + 9] = (delta >> 16) & 255
+ * output[j + 10] = (delta >> 24) & 255
+ */
+ __pyx_t_21 = (__pyx_v_j + 8);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_21)) )) = ((__pyx_v_delta >> 8) & 255);
+
+ /* "fabio/ext/byte_offset.pyx":113
+ * output[j + 7] = (delta & 255)
+ * output[j + 8] = (delta >> 8) & 255
+ * output[j + 9] = (delta >> 16) & 255 # <<<<<<<<<<<<<<
+ * output[j + 10] = (delta >> 24) & 255
+ * output[j + 11] = (delta >> 32) & 255
+ */
+ __pyx_t_22 = (__pyx_v_j + 9);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_22)) )) = ((__pyx_v_delta >> 16) & 255);
+
+ /* "fabio/ext/byte_offset.pyx":114
+ * output[j + 8] = (delta >> 8) & 255
+ * output[j + 9] = (delta >> 16) & 255
+ * output[j + 10] = (delta >> 24) & 255 # <<<<<<<<<<<<<<
+ * output[j + 11] = (delta >> 32) & 255
+ * output[j + 12] = (delta >> 40) & 255
+ */
+ __pyx_t_23 = (__pyx_v_j + 10);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_23)) )) = ((__pyx_v_delta >> 24) & 255);
+
+ /* "fabio/ext/byte_offset.pyx":115
+ * output[j + 9] = (delta >> 16) & 255
+ * output[j + 10] = (delta >> 24) & 255
+ * output[j + 11] = (delta >> 32) & 255 # <<<<<<<<<<<<<<
+ * output[j + 12] = (delta >> 40) & 255
+ * output[j + 13] = (delta >> 48) & 255
+ */
+ __pyx_t_24 = (__pyx_v_j + 11);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_24)) )) = ((__pyx_v_delta >> 32) & 255);
+
+ /* "fabio/ext/byte_offset.pyx":116
+ * output[j + 10] = (delta >> 24) & 255
+ * output[j + 11] = (delta >> 32) & 255
+ * output[j + 12] = (delta >> 40) & 255 # <<<<<<<<<<<<<<
+ * output[j + 13] = (delta >> 48) & 255
+ * output[j + 14] = (delta >> 56) & 255
+ */
+ __pyx_t_25 = (__pyx_v_j + 12);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_25)) )) = ((__pyx_v_delta >> 40) & 255);
+
+ /* "fabio/ext/byte_offset.pyx":117
+ * output[j + 11] = (delta >> 32) & 255
+ * output[j + 12] = (delta >> 40) & 255
+ * output[j + 13] = (delta >> 48) & 255 # <<<<<<<<<<<<<<
+ * output[j + 14] = (delta >> 56) & 255
+ * j += 15
+ */
+ __pyx_t_26 = (__pyx_v_j + 13);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_26)) )) = ((__pyx_v_delta >> 48) & 255);
+
+ /* "fabio/ext/byte_offset.pyx":118
+ * output[j + 12] = (delta >> 40) & 255
+ * output[j + 13] = (delta >> 48) & 255
+ * output[j + 14] = (delta >> 56) & 255 # <<<<<<<<<<<<<<
+ * j += 15
+ * elif absdelta >= 1 << 15:
+ */
+ __pyx_t_27 = (__pyx_v_j + 14);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_27)) )) = ((__pyx_v_delta >> 56) & 255);
+
+ /* "fabio/ext/byte_offset.pyx":119
+ * output[j + 13] = (delta >> 48) & 255
+ * output[j + 14] = (delta >> 56) & 255
+ * j += 15 # <<<<<<<<<<<<<<
+ * elif absdelta >= 1 << 15:
+ * output[j] = -128
+ */
+ __pyx_v_j = (__pyx_v_j + 15);
+ goto __pyx_L5;
+ }
+
+ /* "fabio/ext/byte_offset.pyx":120
+ * output[j + 14] = (delta >> 56) & 255
+ * j += 15
+ * elif absdelta >= 1 << 15: # <<<<<<<<<<<<<<
+ * output[j] = -128
+ * output[j + 1] = 0
+ */
+ __pyx_t_12 = ((__pyx_v_absdelta >= 32768) != 0);
+ if (__pyx_t_12) {
+
+ /* "fabio/ext/byte_offset.pyx":121
+ * j += 15
+ * elif absdelta >= 1 << 15:
+ * output[j] = -128 # <<<<<<<<<<<<<<
+ * output[j + 1] = 0
+ * output[j + 2] = -128
+ */
+ __pyx_t_28 = __pyx_v_j;
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_28)) )) = -128;
+
+ /* "fabio/ext/byte_offset.pyx":122
+ * elif absdelta >= 1 << 15:
+ * output[j] = -128
+ * output[j + 1] = 0 # <<<<<<<<<<<<<<
+ * output[j + 2] = -128
+ * output[j + 3] = (delta & 255)
+ */
+ __pyx_t_29 = (__pyx_v_j + 1);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_29)) )) = 0;
+
+ /* "fabio/ext/byte_offset.pyx":123
+ * output[j] = -128
+ * output[j + 1] = 0
+ * output[j + 2] = -128 # <<<<<<<<<<<<<<
+ * output[j + 3] = (delta & 255)
+ * output[j + 4] = (delta >> 8) & 255
+ */
+ __pyx_t_30 = (__pyx_v_j + 2);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_30)) )) = -128;
+
+ /* "fabio/ext/byte_offset.pyx":124
+ * output[j + 1] = 0
+ * output[j + 2] = -128
+ * output[j + 3] = (delta & 255) # <<<<<<<<<<<<<<
+ * output[j + 4] = (delta >> 8) & 255
+ * output[j + 5] = (delta >> 16) & 255
+ */
+ __pyx_t_31 = (__pyx_v_j + 3);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_31)) )) = (__pyx_v_delta & 255);
+
+ /* "fabio/ext/byte_offset.pyx":125
+ * output[j + 2] = -128
+ * output[j + 3] = (delta & 255)
+ * output[j + 4] = (delta >> 8) & 255 # <<<<<<<<<<<<<<
+ * output[j + 5] = (delta >> 16) & 255
+ * output[j + 6] = (delta >> 24)
+ */
+ __pyx_t_32 = (__pyx_v_j + 4);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_32)) )) = ((__pyx_v_delta >> 8) & 255);
+
+ /* "fabio/ext/byte_offset.pyx":126
+ * output[j + 3] = (delta & 255)
+ * output[j + 4] = (delta >> 8) & 255
+ * output[j + 5] = (delta >> 16) & 255 # <<<<<<<<<<<<<<
+ * output[j + 6] = (delta >> 24)
+ * j += 7
+ */
+ __pyx_t_33 = (__pyx_v_j + 5);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_33)) )) = ((__pyx_v_delta >> 16) & 255);
+
+ /* "fabio/ext/byte_offset.pyx":127
+ * output[j + 4] = (delta >> 8) & 255
+ * output[j + 5] = (delta >> 16) & 255
+ * output[j + 6] = (delta >> 24) # <<<<<<<<<<<<<<
+ * j += 7
+ * elif absdelta >= 1 << 7:
+ */
+ __pyx_t_34 = (__pyx_v_j + 6);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_34)) )) = (__pyx_v_delta >> 24);
+
+ /* "fabio/ext/byte_offset.pyx":128
+ * output[j + 5] = (delta >> 16) & 255
+ * output[j + 6] = (delta >> 24)
+ * j += 7 # <<<<<<<<<<<<<<
+ * elif absdelta >= 1 << 7:
+ * output[j] = -128
+ */
+ __pyx_v_j = (__pyx_v_j + 7);
+ goto __pyx_L5;
+ }
+
+ /* "fabio/ext/byte_offset.pyx":129
+ * output[j + 6] = (delta >> 24)
+ * j += 7
+ * elif absdelta >= 1 << 7: # <<<<<<<<<<<<<<
+ * output[j] = -128
+ * output[j + 1] = delta & 255
+ */
+ __pyx_t_12 = ((__pyx_v_absdelta >= 128) != 0);
+ if (__pyx_t_12) {
+
+ /* "fabio/ext/byte_offset.pyx":130
+ * j += 7
+ * elif absdelta >= 1 << 7:
+ * output[j] = -128 # <<<<<<<<<<<<<<
+ * output[j + 1] = delta & 255
+ * output[j + 2] = (delta >> 8) & 255
+ */
+ __pyx_t_35 = __pyx_v_j;
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_35)) )) = -128;
+
+ /* "fabio/ext/byte_offset.pyx":131
+ * elif absdelta >= 1 << 7:
+ * output[j] = -128
+ * output[j + 1] = delta & 255 # <<<<<<<<<<<<<<
+ * output[j + 2] = (delta >> 8) & 255
+ * j += 3
+ */
+ __pyx_t_36 = (__pyx_v_j + 1);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_36)) )) = (__pyx_v_delta & 255);
+
+ /* "fabio/ext/byte_offset.pyx":132
+ * output[j] = -128
+ * output[j + 1] = delta & 255
+ * output[j + 2] = (delta >> 8) & 255 # <<<<<<<<<<<<<<
+ * j += 3
+ * else:
+ */
+ __pyx_t_37 = (__pyx_v_j + 2);
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_37)) )) = ((__pyx_v_delta >> 8) & 255);
+
+ /* "fabio/ext/byte_offset.pyx":133
+ * output[j + 1] = delta & 255
+ * output[j + 2] = (delta >> 8) & 255
+ * j += 3 # <<<<<<<<<<<<<<
+ * else:
+ * output[j] = delta
+ */
+ __pyx_v_j = (__pyx_v_j + 3);
+ goto __pyx_L5;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/byte_offset.pyx":135
+ * j += 3
+ * else:
+ * output[j] = delta # <<<<<<<<<<<<<<
+ * j += 1
+ * last = current
+ */
+ __pyx_t_38 = __pyx_v_j;
+ *((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_output.data) + __pyx_t_38)) )) = __pyx_v_delta;
+
+ /* "fabio/ext/byte_offset.pyx":136
+ * else:
+ * output[j] = delta
+ * j += 1 # <<<<<<<<<<<<<<
+ * last = current
+ * return numpy.asarray(output)[:j]
+ */
+ __pyx_v_j = (__pyx_v_j + 1);
+ }
+ __pyx_L5:;
+
+ /* "fabio/ext/byte_offset.pyx":137
+ * output[j] = delta
+ * j += 1
+ * last = current # <<<<<<<<<<<<<<
+ * return numpy.asarray(output)[:j]
+ *
+ */
+ __pyx_v_last = __pyx_v_current;
+ }
+
+ /* "fabio/ext/byte_offset.pyx":138
+ * j += 1
+ * last = current
+ * return numpy.asarray(output)[:j] # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_output, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (!__pyx_t_5) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, __pyx_v_j, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "fabio/ext/byte_offset.pyx":87
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def comp_cbf(data not None): # <<<<<<<<<<<<<<
+ * """Compress a dataset using the byte-offset described for any int64
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
+ __Pyx_AddTraceback("fabio.ext.byte_offset.comp_cbf", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_ary, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_output, 1);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/byte_offset.pyx":143
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def dec_cbf(bytes stream not None, size=None): # <<<<<<<<<<<<<<
+ * """
+ * Analyze a stream of char with any length of exception (2,4, or 8 bytes integers)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_11byte_offset_5dec_cbf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_5fabio_3ext_11byte_offset_4dec_cbf[] = "\n Analyze a stream of char with any length of exception (2,4, or 8 bytes integers)\n @param stream: bytes (string) representing the compressed data\n @param size: the size of the output array (of longInts)\n @return : int64 ndArrays\n ";
+static PyMethodDef __pyx_mdef_5fabio_3ext_11byte_offset_5dec_cbf = {"dec_cbf", (PyCFunction)__pyx_pw_5fabio_3ext_11byte_offset_5dec_cbf, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_11byte_offset_4dec_cbf};
+static PyObject *__pyx_pw_5fabio_3ext_11byte_offset_5dec_cbf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_stream = 0;
+ PyObject *__pyx_v_size = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("dec_cbf (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_size,0};
+ PyObject* values[2] = {0,0};
+ values[1] = ((PyObject *)Py_None);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dec_cbf") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_stream = ((PyObject*)values[0]);
+ __pyx_v_size = values[1];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("dec_cbf", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.byte_offset.dec_cbf", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stream), (&PyBytes_Type), 0, "stream", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_r = __pyx_pf_5fabio_3ext_11byte_offset_4dec_cbf(__pyx_self, __pyx_v_stream, __pyx_v_size);
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_11byte_offset_4dec_cbf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_size) {
+ int __pyx_v_i;
+ int __pyx_v_j;
+ CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_tmp8;
+ __pyx_t_5numpy_int64_t __pyx_v_last;
+ __pyx_t_5numpy_int64_t __pyx_v_current;
+ __pyx_t_5numpy_int64_t __pyx_v_tmp64;
+ __pyx_t_5numpy_int64_t __pyx_v_tmp64a;
+ __pyx_t_5numpy_int64_t __pyx_v_tmp64b;
+ __pyx_t_5numpy_int64_t __pyx_v_tmp64c;
+ __pyx_t_5numpy_int64_t __pyx_v_tmp64d;
+ __pyx_t_5numpy_int64_t __pyx_v_tmp64e;
+ __pyx_t_5numpy_int64_t __pyx_v_tmp64f;
+ __pyx_t_5numpy_int64_t __pyx_v_tmp64g;
+ __pyx_t_5numpy_uint8_t __pyx_v_key8;
+ __pyx_t_5numpy_uint8_t __pyx_v_key0;
+ int __pyx_v_csize;
+ int __pyx_v_lenStream;
+ __Pyx_memviewslice __pyx_v_cstream = { 0, 0, { 0 }, { 0 }, { 0 } };
+ PyArrayObject *__pyx_v_dataOut = 0;
+ __Pyx_LocalBuf_ND __pyx_pybuffernd_dataOut;
+ __Pyx_Buffer __pyx_pybuffer_dataOut;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ PyArrayObject *__pyx_t_11 = NULL;
+ long __pyx_t_12;
+ long __pyx_t_13;
+ long __pyx_t_14;
+ long __pyx_t_15;
+ long __pyx_t_16;
+ long __pyx_t_17;
+ long __pyx_t_18;
+ long __pyx_t_19;
+ long __pyx_t_20;
+ long __pyx_t_21;
+ long __pyx_t_22;
+ long __pyx_t_23;
+ long __pyx_t_24;
+ long __pyx_t_25;
+ long __pyx_t_26;
+ long __pyx_t_27;
+ long __pyx_t_28;
+ long __pyx_t_29;
+ long __pyx_t_30;
+ long __pyx_t_31;
+ int __pyx_t_32;
+ int __pyx_t_33;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("dec_cbf", 0);
+ __pyx_pybuffer_dataOut.pybuffer.buf = NULL;
+ __pyx_pybuffer_dataOut.refcount = 0;
+ __pyx_pybuffernd_dataOut.data = NULL;
+ __pyx_pybuffernd_dataOut.rcbuffer = &__pyx_pybuffer_dataOut;
+
+ /* "fabio/ext/byte_offset.pyx":151
+ * """
+ * cdef:
+ * int i = 0 # <<<<<<<<<<<<<<
+ * int j = 0
+ * numpy.uint8_t tmp8 = 0
+ */
+ __pyx_v_i = 0;
+
+ /* "fabio/ext/byte_offset.pyx":152
+ * cdef:
+ * int i = 0
+ * int j = 0 # <<<<<<<<<<<<<<
+ * numpy.uint8_t tmp8 = 0
+ *
+ */
+ __pyx_v_j = 0;
+
+ /* "fabio/ext/byte_offset.pyx":153
+ * int i = 0
+ * int j = 0
+ * numpy.uint8_t tmp8 = 0 # <<<<<<<<<<<<<<
+ *
+ * numpy.int64_t last = 0
+ */
+ __pyx_v_tmp8 = 0;
+
+ /* "fabio/ext/byte_offset.pyx":155
+ * numpy.uint8_t tmp8 = 0
+ *
+ * numpy.int64_t last = 0 # <<<<<<<<<<<<<<
+ * numpy.int64_t current = 0
+ * numpy.int64_t tmp64 = 0
+ */
+ __pyx_v_last = 0;
+
+ /* "fabio/ext/byte_offset.pyx":156
+ *
+ * numpy.int64_t last = 0
+ * numpy.int64_t current = 0 # <<<<<<<<<<<<<<
+ * numpy.int64_t tmp64 = 0
+ * numpy.int64_t tmp64a = 0
+ */
+ __pyx_v_current = 0;
+
+ /* "fabio/ext/byte_offset.pyx":157
+ * numpy.int64_t last = 0
+ * numpy.int64_t current = 0
+ * numpy.int64_t tmp64 = 0 # <<<<<<<<<<<<<<
+ * numpy.int64_t tmp64a = 0
+ * numpy.int64_t tmp64b = 0
+ */
+ __pyx_v_tmp64 = 0;
+
+ /* "fabio/ext/byte_offset.pyx":158
+ * numpy.int64_t current = 0
+ * numpy.int64_t tmp64 = 0
+ * numpy.int64_t tmp64a = 0 # <<<<<<<<<<<<<<
+ * numpy.int64_t tmp64b = 0
+ * numpy.int64_t tmp64c = 0
+ */
+ __pyx_v_tmp64a = 0;
+
+ /* "fabio/ext/byte_offset.pyx":159
+ * numpy.int64_t tmp64 = 0
+ * numpy.int64_t tmp64a = 0
+ * numpy.int64_t tmp64b = 0 # <<<<<<<<<<<<<<
+ * numpy.int64_t tmp64c = 0
+ * numpy.int64_t tmp64d = 0
+ */
+ __pyx_v_tmp64b = 0;
+
+ /* "fabio/ext/byte_offset.pyx":160
+ * numpy.int64_t tmp64a = 0
+ * numpy.int64_t tmp64b = 0
+ * numpy.int64_t tmp64c = 0 # <<<<<<<<<<<<<<
+ * numpy.int64_t tmp64d = 0
+ * numpy.int64_t tmp64e = 0
+ */
+ __pyx_v_tmp64c = 0;
+
+ /* "fabio/ext/byte_offset.pyx":161
+ * numpy.int64_t tmp64b = 0
+ * numpy.int64_t tmp64c = 0
+ * numpy.int64_t tmp64d = 0 # <<<<<<<<<<<<<<
+ * numpy.int64_t tmp64e = 0
+ * numpy.int64_t tmp64f = 0
+ */
+ __pyx_v_tmp64d = 0;
+
+ /* "fabio/ext/byte_offset.pyx":162
+ * numpy.int64_t tmp64c = 0
+ * numpy.int64_t tmp64d = 0
+ * numpy.int64_t tmp64e = 0 # <<<<<<<<<<<<<<
+ * numpy.int64_t tmp64f = 0
+ * numpy.int64_t tmp64g = 0
+ */
+ __pyx_v_tmp64e = 0;
+
+ /* "fabio/ext/byte_offset.pyx":163
+ * numpy.int64_t tmp64d = 0
+ * numpy.int64_t tmp64e = 0
+ * numpy.int64_t tmp64f = 0 # <<<<<<<<<<<<<<
+ * numpy.int64_t tmp64g = 0
+ *
+ */
+ __pyx_v_tmp64f = 0;
+
+ /* "fabio/ext/byte_offset.pyx":164
+ * numpy.int64_t tmp64e = 0
+ * numpy.int64_t tmp64f = 0
+ * numpy.int64_t tmp64g = 0 # <<<<<<<<<<<<<<
+ *
+ * numpy.uint8_t key8 = 0x80
+ */
+ __pyx_v_tmp64g = 0;
+
+ /* "fabio/ext/byte_offset.pyx":166
+ * numpy.int64_t tmp64g = 0
+ *
+ * numpy.uint8_t key8 = 0x80 # <<<<<<<<<<<<<<
+ * numpy.uint8_t key0 = 0x00
+ *
+ */
+ __pyx_v_key8 = 0x80;
+
+ /* "fabio/ext/byte_offset.pyx":167
+ *
+ * numpy.uint8_t key8 = 0x80
+ * numpy.uint8_t key0 = 0x00 # <<<<<<<<<<<<<<
+ *
+ * int csize
+ */
+ __pyx_v_key0 = 0x00;
+
+ /* "fabio/ext/byte_offset.pyx":170
+ *
+ * int csize
+ * int lenStream = < int > len(stream) # <<<<<<<<<<<<<<
+ * numpy.uint8_t[:] cstream = bytearray(stream)
+ * if size is None:
+ */
+ __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_stream); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_lenStream = ((int)__pyx_t_1);
+
+ /* "fabio/ext/byte_offset.pyx":171
+ * int csize
+ * int lenStream = < int > len(stream)
+ * numpy.uint8_t[:] cstream = bytearray(stream) # <<<<<<<<<<<<<<
+ * if size is None:
+ * csize = lenStream
+ */
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_stream);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
+ __Pyx_GIVEREF(__pyx_v_stream);
+ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyByteArray_Type))), __pyx_t_2, 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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
+ if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_cstream = __pyx_t_4;
+ __pyx_t_4.memview = NULL;
+ __pyx_t_4.data = NULL;
+
+ /* "fabio/ext/byte_offset.pyx":172
+ * int lenStream = < int > len(stream)
+ * numpy.uint8_t[:] cstream = bytearray(stream)
+ * if size is None: # <<<<<<<<<<<<<<
+ * csize = lenStream
+ * else:
+ */
+ __pyx_t_5 = (__pyx_v_size == Py_None);
+ __pyx_t_6 = (__pyx_t_5 != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/byte_offset.pyx":173
+ * numpy.uint8_t[:] cstream = bytearray(stream)
+ * if size is None:
+ * csize = lenStream # <<<<<<<<<<<<<<
+ * else:
+ * csize = < int > size
+ */
+ __pyx_v_csize = __pyx_v_lenStream;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/byte_offset.pyx":175
+ * csize = lenStream
+ * else:
+ * csize = < int > size # <<<<<<<<<<<<<<
+ * cdef numpy.ndarray[numpy.int64_t, ndim = 1] dataOut = numpy.empty(csize, dtype=numpy.int64)
+ * with nogil:
+ */
+ __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_csize = ((int)__pyx_t_7);
+ }
+ __pyx_L3:;
+
+ /* "fabio/ext/byte_offset.pyx":176
+ * else:
+ * csize = < int > size
+ * cdef numpy.ndarray[numpy.int64_t, ndim = 1] dataOut = numpy.empty(csize, dtype=numpy.int64) # <<<<<<<<<<<<<<
+ * with nogil:
+ * while (i < lenStream) and (j < csize):
+ */
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); 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_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_csize); 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_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_8, 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 = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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 = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = ((PyArrayObject *)__pyx_t_10);
+ {
+ __Pyx_BufFmt_StackElem __pyx_stack[1];
+ if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dataOut.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+ __pyx_v_dataOut = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_dataOut.rcbuffer->pybuffer.buf = NULL;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ } else {__pyx_pybuffernd_dataOut.diminfo[0].strides = __pyx_pybuffernd_dataOut.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dataOut.diminfo[0].shape = __pyx_pybuffernd_dataOut.rcbuffer->pybuffer.shape[0];
+ }
+ }
+ __pyx_t_11 = 0;
+ __pyx_v_dataOut = ((PyArrayObject *)__pyx_t_10);
+ __pyx_t_10 = 0;
+
+ /* "fabio/ext/byte_offset.pyx":177
+ * csize = < int > size
+ * cdef numpy.ndarray[numpy.int64_t, ndim = 1] dataOut = numpy.empty(csize, dtype=numpy.int64)
+ * with nogil: # <<<<<<<<<<<<<<
+ * while (i < lenStream) and (j < csize):
+ * if (cstream[i] == key8):
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "fabio/ext/byte_offset.pyx":178
+ * cdef numpy.ndarray[numpy.int64_t, ndim = 1] dataOut = numpy.empty(csize, dtype=numpy.int64)
+ * with nogil:
+ * while (i < lenStream) and (j < csize): # <<<<<<<<<<<<<<
+ * if (cstream[i] == key8):
+ * if ((cstream[i + 1] == key0) and (cstream[i + 2] == key8)):
+ */
+ while (1) {
+ __pyx_t_5 = ((__pyx_v_i < __pyx_v_lenStream) != 0);
+ if (__pyx_t_5) {
+ } else {
+ __pyx_t_6 = __pyx_t_5;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_5 = ((__pyx_v_j < __pyx_v_csize) != 0);
+ __pyx_t_6 = __pyx_t_5;
+ __pyx_L9_bool_binop_done:;
+ if (!__pyx_t_6) break;
+
+ /* "fabio/ext/byte_offset.pyx":179
+ * with nogil:
+ * while (i < lenStream) and (j < csize):
+ * if (cstream[i] == key8): # <<<<<<<<<<<<<<
+ * if ((cstream[i + 1] == key0) and (cstream[i + 2] == key8)):
+ * if (cstream[i + 3] == key0) and (cstream[i + 4] == key0) and (cstream[i + 5] == key0) and (cstream[i + 6] == key8):
+ */
+ __pyx_t_7 = __pyx_v_i;
+ __pyx_t_6 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_7 * __pyx_v_cstream.strides[0]) ))) == __pyx_v_key8) != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/byte_offset.pyx":180
+ * while (i < lenStream) and (j < csize):
+ * if (cstream[i] == key8):
+ * if ((cstream[i + 1] == key0) and (cstream[i + 2] == key8)): # <<<<<<<<<<<<<<
+ * if (cstream[i + 3] == key0) and (cstream[i + 4] == key0) and (cstream[i + 5] == key0) and (cstream[i + 6] == key8):
+ * # Retrieve the interesting Bytes of data
+ */
+ __pyx_t_12 = (__pyx_v_i + 1);
+ __pyx_t_5 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_12 * __pyx_v_cstream.strides[0]) ))) == __pyx_v_key0) != 0);
+ if (__pyx_t_5) {
+ } else {
+ __pyx_t_6 = __pyx_t_5;
+ goto __pyx_L13_bool_binop_done;
+ }
+ __pyx_t_13 = (__pyx_v_i + 2);
+ __pyx_t_5 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_13 * __pyx_v_cstream.strides[0]) ))) == __pyx_v_key8) != 0);
+ __pyx_t_6 = __pyx_t_5;
+ __pyx_L13_bool_binop_done:;
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/byte_offset.pyx":181
+ * if (cstream[i] == key8):
+ * if ((cstream[i + 1] == key0) and (cstream[i + 2] == key8)):
+ * if (cstream[i + 3] == key0) and (cstream[i + 4] == key0) and (cstream[i + 5] == key0) and (cstream[i + 6] == key8): # <<<<<<<<<<<<<<
+ * # Retrieve the interesting Bytes of data
+ * tmp64g = cstream[i + 7]
+ */
+ __pyx_t_14 = (__pyx_v_i + 3);
+ __pyx_t_5 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_14 * __pyx_v_cstream.strides[0]) ))) == __pyx_v_key0) != 0);
+ if (__pyx_t_5) {
+ } else {
+ __pyx_t_6 = __pyx_t_5;
+ goto __pyx_L16_bool_binop_done;
+ }
+ __pyx_t_15 = (__pyx_v_i + 4);
+ __pyx_t_5 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_15 * __pyx_v_cstream.strides[0]) ))) == __pyx_v_key0) != 0);
+ if (__pyx_t_5) {
+ } else {
+ __pyx_t_6 = __pyx_t_5;
+ goto __pyx_L16_bool_binop_done;
+ }
+ __pyx_t_16 = (__pyx_v_i + 5);
+ __pyx_t_5 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_16 * __pyx_v_cstream.strides[0]) ))) == __pyx_v_key0) != 0);
+ if (__pyx_t_5) {
+ } else {
+ __pyx_t_6 = __pyx_t_5;
+ goto __pyx_L16_bool_binop_done;
+ }
+ __pyx_t_17 = (__pyx_v_i + 6);
+ __pyx_t_5 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_17 * __pyx_v_cstream.strides[0]) ))) == __pyx_v_key8) != 0);
+ __pyx_t_6 = __pyx_t_5;
+ __pyx_L16_bool_binop_done:;
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/byte_offset.pyx":183
+ * if (cstream[i + 3] == key0) and (cstream[i + 4] == key0) and (cstream[i + 5] == key0) and (cstream[i + 6] == key8):
+ * # Retrieve the interesting Bytes of data
+ * tmp64g = cstream[i + 7] # <<<<<<<<<<<<<<
+ * tmp64f = cstream[i + 8]
+ * tmp64e = cstream[i + 9]
+ */
+ __pyx_t_18 = (__pyx_v_i + 7);
+ __pyx_v_tmp64g = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_18 * __pyx_v_cstream.strides[0]) )));
+
+ /* "fabio/ext/byte_offset.pyx":184
+ * # Retrieve the interesting Bytes of data
+ * tmp64g = cstream[i + 7]
+ * tmp64f = cstream[i + 8] # <<<<<<<<<<<<<<
+ * tmp64e = cstream[i + 9]
+ * tmp64d = cstream[i + 10]
+ */
+ __pyx_t_19 = (__pyx_v_i + 8);
+ __pyx_v_tmp64f = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_19 * __pyx_v_cstream.strides[0]) )));
+
+ /* "fabio/ext/byte_offset.pyx":185
+ * tmp64g = cstream[i + 7]
+ * tmp64f = cstream[i + 8]
+ * tmp64e = cstream[i + 9] # <<<<<<<<<<<<<<
+ * tmp64d = cstream[i + 10]
+ * tmp64c = cstream[i + 11]
+ */
+ __pyx_t_20 = (__pyx_v_i + 9);
+ __pyx_v_tmp64e = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_20 * __pyx_v_cstream.strides[0]) )));
+
+ /* "fabio/ext/byte_offset.pyx":186
+ * tmp64f = cstream[i + 8]
+ * tmp64e = cstream[i + 9]
+ * tmp64d = cstream[i + 10] # <<<<<<<<<<<<<<
+ * tmp64c = cstream[i + 11]
+ * tmp64b = cstream[i + 12]
+ */
+ __pyx_t_21 = (__pyx_v_i + 10);
+ __pyx_v_tmp64d = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_21 * __pyx_v_cstream.strides[0]) )));
+
+ /* "fabio/ext/byte_offset.pyx":187
+ * tmp64e = cstream[i + 9]
+ * tmp64d = cstream[i + 10]
+ * tmp64c = cstream[i + 11] # <<<<<<<<<<<<<<
+ * tmp64b = cstream[i + 12]
+ * tmp64a = cstream[i + 13]
+ */
+ __pyx_t_22 = (__pyx_v_i + 11);
+ __pyx_v_tmp64c = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_22 * __pyx_v_cstream.strides[0]) )));
+
+ /* "fabio/ext/byte_offset.pyx":188
+ * tmp64d = cstream[i + 10]
+ * tmp64c = cstream[i + 11]
+ * tmp64b = cstream[i + 12] # <<<<<<<<<<<<<<
+ * tmp64a = cstream[i + 13]
+ * tmp64 = <numpy.int8_t> cstream[i + 14]
+ */
+ __pyx_t_23 = (__pyx_v_i + 12);
+ __pyx_v_tmp64b = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_23 * __pyx_v_cstream.strides[0]) )));
+
+ /* "fabio/ext/byte_offset.pyx":189
+ * tmp64c = cstream[i + 11]
+ * tmp64b = cstream[i + 12]
+ * tmp64a = cstream[i + 13] # <<<<<<<<<<<<<<
+ * tmp64 = <numpy.int8_t> cstream[i + 14]
+ * # Assemble data into a 64 bits integer
+ */
+ __pyx_t_24 = (__pyx_v_i + 13);
+ __pyx_v_tmp64a = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_24 * __pyx_v_cstream.strides[0]) )));
+
+ /* "fabio/ext/byte_offset.pyx":190
+ * tmp64b = cstream[i + 12]
+ * tmp64a = cstream[i + 13]
+ * tmp64 = <numpy.int8_t> cstream[i + 14] # <<<<<<<<<<<<<<
+ * # Assemble data into a 64 bits integer
+ * current = (tmp64 << 56) | (tmp64a << 48) | (tmp64b << 40) | (tmp64c << 32) | (tmp64d << 24) | (tmp64e << 16) | (tmp64f << 8) | (tmp64g)
+ */
+ __pyx_t_25 = (__pyx_v_i + 14);
+ __pyx_v_tmp64 = ((__pyx_t_5numpy_int8_t)(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_25 * __pyx_v_cstream.strides[0]) ))));
+
+ /* "fabio/ext/byte_offset.pyx":192
+ * tmp64 = <numpy.int8_t> cstream[i + 14]
+ * # Assemble data into a 64 bits integer
+ * current = (tmp64 << 56) | (tmp64a << 48) | (tmp64b << 40) | (tmp64c << 32) | (tmp64d << 24) | (tmp64e << 16) | (tmp64f << 8) | (tmp64g) # <<<<<<<<<<<<<<
+ * i += 15
+ * else:
+ */
+ __pyx_v_current = ((((((((__pyx_v_tmp64 << 56) | (__pyx_v_tmp64a << 48)) | (__pyx_v_tmp64b << 40)) | (__pyx_v_tmp64c << 32)) | (__pyx_v_tmp64d << 24)) | (__pyx_v_tmp64e << 16)) | (__pyx_v_tmp64f << 8)) | __pyx_v_tmp64g);
+
+ /* "fabio/ext/byte_offset.pyx":193
+ * # Assemble data into a 64 bits integer
+ * current = (tmp64 << 56) | (tmp64a << 48) | (tmp64b << 40) | (tmp64c << 32) | (tmp64d << 24) | (tmp64e << 16) | (tmp64f << 8) | (tmp64g)
+ * i += 15 # <<<<<<<<<<<<<<
+ * else:
+ * # Retrieve the interesting Bytes of data
+ */
+ __pyx_v_i = (__pyx_v_i + 15);
+ goto __pyx_L15;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/byte_offset.pyx":196
+ * else:
+ * # Retrieve the interesting Bytes of data
+ * tmp64c = cstream[i + 3] # <<<<<<<<<<<<<<
+ * tmp64b = cstream[i + 4]
+ * tmp64a = cstream[i + 5]
+ */
+ __pyx_t_26 = (__pyx_v_i + 3);
+ __pyx_v_tmp64c = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_26 * __pyx_v_cstream.strides[0]) )));
+
+ /* "fabio/ext/byte_offset.pyx":197
+ * # Retrieve the interesting Bytes of data
+ * tmp64c = cstream[i + 3]
+ * tmp64b = cstream[i + 4] # <<<<<<<<<<<<<<
+ * tmp64a = cstream[i + 5]
+ * tmp64 = <numpy.int8_t> cstream[i + 6]
+ */
+ __pyx_t_27 = (__pyx_v_i + 4);
+ __pyx_v_tmp64b = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_27 * __pyx_v_cstream.strides[0]) )));
+
+ /* "fabio/ext/byte_offset.pyx":198
+ * tmp64c = cstream[i + 3]
+ * tmp64b = cstream[i + 4]
+ * tmp64a = cstream[i + 5] # <<<<<<<<<<<<<<
+ * tmp64 = <numpy.int8_t> cstream[i + 6]
+ * # Assemble data into a 64 bits integer
+ */
+ __pyx_t_28 = (__pyx_v_i + 5);
+ __pyx_v_tmp64a = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_28 * __pyx_v_cstream.strides[0]) )));
+
+ /* "fabio/ext/byte_offset.pyx":199
+ * tmp64b = cstream[i + 4]
+ * tmp64a = cstream[i + 5]
+ * tmp64 = <numpy.int8_t> cstream[i + 6] # <<<<<<<<<<<<<<
+ * # Assemble data into a 64 bits integer
+ * current = (tmp64 << 24) | (tmp64a << 16) | (tmp64b << 8) | (tmp64c)
+ */
+ __pyx_t_29 = (__pyx_v_i + 6);
+ __pyx_v_tmp64 = ((__pyx_t_5numpy_int8_t)(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_29 * __pyx_v_cstream.strides[0]) ))));
+
+ /* "fabio/ext/byte_offset.pyx":201
+ * tmp64 = <numpy.int8_t> cstream[i + 6]
+ * # Assemble data into a 64 bits integer
+ * current = (tmp64 << 24) | (tmp64a << 16) | (tmp64b << 8) | (tmp64c) # <<<<<<<<<<<<<<
+ * i += 7
+ * else:
+ */
+ __pyx_v_current = ((((__pyx_v_tmp64 << 24) | (__pyx_v_tmp64a << 16)) | (__pyx_v_tmp64b << 8)) | __pyx_v_tmp64c);
+
+ /* "fabio/ext/byte_offset.pyx":202
+ * # Assemble data into a 64 bits integer
+ * current = (tmp64 << 24) | (tmp64a << 16) | (tmp64b << 8) | (tmp64c)
+ * i += 7 # <<<<<<<<<<<<<<
+ * else:
+ * tmp64a = cstream[i + 1]
+ */
+ __pyx_v_i = (__pyx_v_i + 7);
+ }
+ __pyx_L15:;
+ goto __pyx_L12;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/byte_offset.pyx":204
+ * i += 7
+ * else:
+ * tmp64a = cstream[i + 1] # <<<<<<<<<<<<<<
+ * tmp64 = <numpy.int8_t> cstream[i + 2]
+ *
+ */
+ __pyx_t_30 = (__pyx_v_i + 1);
+ __pyx_v_tmp64a = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_30 * __pyx_v_cstream.strides[0]) )));
+
+ /* "fabio/ext/byte_offset.pyx":205
+ * else:
+ * tmp64a = cstream[i + 1]
+ * tmp64 = <numpy.int8_t> cstream[i + 2] # <<<<<<<<<<<<<<
+ *
+ * current = (tmp64 << 8) | (tmp64a)
+ */
+ __pyx_t_31 = (__pyx_v_i + 2);
+ __pyx_v_tmp64 = ((__pyx_t_5numpy_int8_t)(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_31 * __pyx_v_cstream.strides[0]) ))));
+
+ /* "fabio/ext/byte_offset.pyx":207
+ * tmp64 = <numpy.int8_t> cstream[i + 2]
+ *
+ * current = (tmp64 << 8) | (tmp64a) # <<<<<<<<<<<<<<
+ * i += 3
+ * else:
+ */
+ __pyx_v_current = ((__pyx_v_tmp64 << 8) | __pyx_v_tmp64a);
+
+ /* "fabio/ext/byte_offset.pyx":208
+ *
+ * current = (tmp64 << 8) | (tmp64a)
+ * i += 3 # <<<<<<<<<<<<<<
+ * else:
+ * current = (<numpy.int8_t> cstream[i])
+ */
+ __pyx_v_i = (__pyx_v_i + 3);
+ }
+ __pyx_L12:;
+ goto __pyx_L11;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/byte_offset.pyx":210
+ * i += 3
+ * else:
+ * current = (<numpy.int8_t> cstream[i]) # <<<<<<<<<<<<<<
+ * i += 1
+ * last += current
+ */
+ __pyx_t_32 = __pyx_v_i;
+ __pyx_v_current = ((__pyx_t_5numpy_int8_t)(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_32 * __pyx_v_cstream.strides[0]) ))));
+
+ /* "fabio/ext/byte_offset.pyx":211
+ * else:
+ * current = (<numpy.int8_t> cstream[i])
+ * i += 1 # <<<<<<<<<<<<<<
+ * last += current
+ * dataOut[j] = last
+ */
+ __pyx_v_i = (__pyx_v_i + 1);
+ }
+ __pyx_L11:;
+
+ /* "fabio/ext/byte_offset.pyx":212
+ * current = (<numpy.int8_t> cstream[i])
+ * i += 1
+ * last += current # <<<<<<<<<<<<<<
+ * dataOut[j] = last
+ * j += 1
+ */
+ __pyx_v_last = (__pyx_v_last + __pyx_v_current);
+
+ /* "fabio/ext/byte_offset.pyx":213
+ * i += 1
+ * last += current
+ * dataOut[j] = last # <<<<<<<<<<<<<<
+ * j += 1
+ *
+ */
+ __pyx_t_33 = __pyx_v_j;
+ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_dataOut.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_dataOut.diminfo[0].strides) = __pyx_v_last;
+
+ /* "fabio/ext/byte_offset.pyx":214
+ * last += current
+ * dataOut[j] = last
+ * j += 1 # <<<<<<<<<<<<<<
+ *
+ * return dataOut[:j]
+ */
+ __pyx_v_j = (__pyx_v_j + 1);
+ }
+ }
+
+ /* "fabio/ext/byte_offset.pyx":177
+ * csize = < int > size
+ * cdef numpy.ndarray[numpy.int64_t, ndim = 1] dataOut = numpy.empty(csize, dtype=numpy.int64)
+ * with nogil: # <<<<<<<<<<<<<<
+ * while (i < lenStream) and (j < csize):
+ * if (cstream[i] == key8):
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+ }
+ }
+
+ /* "fabio/ext/byte_offset.pyx":216
+ * j += 1
+ *
+ * return dataOut[:j] # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_10 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_dataOut), 0, __pyx_v_j, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_r = __pyx_t_10;
+ __pyx_t_10 = 0;
+ goto __pyx_L0;
+
+ /* "fabio/ext/byte_offset.pyx":143
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def dec_cbf(bytes stream not None, size=None): # <<<<<<<<<<<<<<
+ * """
+ * Analyze a stream of char with any length of exception (2,4, or 8 bytes integers)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
+ { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
+ __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dataOut.rcbuffer->pybuffer);
+ __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
+ __Pyx_AddTraceback("fabio.ext.byte_offset.dec_cbf", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ goto __pyx_L2;
+ __pyx_L0:;
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dataOut.rcbuffer->pybuffer);
+ __pyx_L2:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_cstream, 1);
+ __Pyx_XDECREF((PyObject *)__pyx_v_dataOut);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/byte_offset.pyx":220
+ *
+ * @cython.boundscheck(False)
+ * def dec_cbf32(bytes stream not None, size=None): # <<<<<<<<<<<<<<
+ * """
+ * Analyze a stream of char with any length of exception (2 or 4 bytes integers)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_11byte_offset_7dec_cbf32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_5fabio_3ext_11byte_offset_6dec_cbf32[] = "\n Analyze a stream of char with any length of exception (2 or 4 bytes integers)\n Optimized for int32 decompression\n\n @param stream: bytes (string) representing the compressed data\n @param size: the size of the output array (of longInts)\n @return : int64 ndArrays\n ";
+static PyMethodDef __pyx_mdef_5fabio_3ext_11byte_offset_7dec_cbf32 = {"dec_cbf32", (PyCFunction)__pyx_pw_5fabio_3ext_11byte_offset_7dec_cbf32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_11byte_offset_6dec_cbf32};
+static PyObject *__pyx_pw_5fabio_3ext_11byte_offset_7dec_cbf32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_stream = 0;
+ PyObject *__pyx_v_size = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("dec_cbf32 (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_size,0};
+ PyObject* values[2] = {0,0};
+ values[1] = ((PyObject *)Py_None);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dec_cbf32") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_stream = ((PyObject*)values[0]);
+ __pyx_v_size = values[1];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("dec_cbf32", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.byte_offset.dec_cbf32", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stream), (&PyBytes_Type), 0, "stream", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_r = __pyx_pf_5fabio_3ext_11byte_offset_6dec_cbf32(__pyx_self, __pyx_v_stream, __pyx_v_size);
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_11byte_offset_6dec_cbf32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_size) {
+ int __pyx_v_i;
+ int __pyx_v_j;
+ CYTHON_UNUSED __pyx_t_5numpy_uint8_t __pyx_v_tmp8;
+ __pyx_t_5numpy_int32_t __pyx_v_last;
+ __pyx_t_5numpy_int32_t __pyx_v_current;
+ __pyx_t_5numpy_int32_t __pyx_v_tmp64;
+ __pyx_t_5numpy_int32_t __pyx_v_tmp64a;
+ __pyx_t_5numpy_int32_t __pyx_v_tmp64b;
+ __pyx_t_5numpy_int32_t __pyx_v_tmp64c;
+ __pyx_t_5numpy_uint8_t __pyx_v_key8;
+ __pyx_t_5numpy_uint8_t __pyx_v_key0;
+ int __pyx_v_csize;
+ int __pyx_v_lenStream;
+ __Pyx_memviewslice __pyx_v_cstream = { 0, 0, { 0 }, { 0 }, { 0 } };
+ PyArrayObject *__pyx_v_dataOut = 0;
+ __Pyx_LocalBuf_ND __pyx_pybuffernd_dataOut;
+ __Pyx_Buffer __pyx_pybuffer_dataOut;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ PyArrayObject *__pyx_t_11 = NULL;
+ long __pyx_t_12;
+ long __pyx_t_13;
+ long __pyx_t_14;
+ long __pyx_t_15;
+ long __pyx_t_16;
+ long __pyx_t_17;
+ long __pyx_t_18;
+ long __pyx_t_19;
+ int __pyx_t_20;
+ int __pyx_t_21;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("dec_cbf32", 0);
+ __pyx_pybuffer_dataOut.pybuffer.buf = NULL;
+ __pyx_pybuffer_dataOut.refcount = 0;
+ __pyx_pybuffernd_dataOut.data = NULL;
+ __pyx_pybuffernd_dataOut.rcbuffer = &__pyx_pybuffer_dataOut;
+
+ /* "fabio/ext/byte_offset.pyx":230
+ * """
+ * cdef:
+ * int i = 0 # <<<<<<<<<<<<<<
+ * int j = 0
+ * numpy.uint8_t tmp8 = 0
+ */
+ __pyx_v_i = 0;
+
+ /* "fabio/ext/byte_offset.pyx":231
+ * cdef:
+ * int i = 0
+ * int j = 0 # <<<<<<<<<<<<<<
+ * numpy.uint8_t tmp8 = 0
+ *
+ */
+ __pyx_v_j = 0;
+
+ /* "fabio/ext/byte_offset.pyx":232
+ * int i = 0
+ * int j = 0
+ * numpy.uint8_t tmp8 = 0 # <<<<<<<<<<<<<<
+ *
+ * numpy.int32_t last = 0
+ */
+ __pyx_v_tmp8 = 0;
+
+ /* "fabio/ext/byte_offset.pyx":234
+ * numpy.uint8_t tmp8 = 0
+ *
+ * numpy.int32_t last = 0 # <<<<<<<<<<<<<<
+ * numpy.int32_t current = 0
+ * numpy.int32_t tmp64 = 0
+ */
+ __pyx_v_last = 0;
+
+ /* "fabio/ext/byte_offset.pyx":235
+ *
+ * numpy.int32_t last = 0
+ * numpy.int32_t current = 0 # <<<<<<<<<<<<<<
+ * numpy.int32_t tmp64 = 0
+ * numpy.int32_t tmp64a = 0
+ */
+ __pyx_v_current = 0;
+
+ /* "fabio/ext/byte_offset.pyx":236
+ * numpy.int32_t last = 0
+ * numpy.int32_t current = 0
+ * numpy.int32_t tmp64 = 0 # <<<<<<<<<<<<<<
+ * numpy.int32_t tmp64a = 0
+ * numpy.int32_t tmp64b = 0
+ */
+ __pyx_v_tmp64 = 0;
+
+ /* "fabio/ext/byte_offset.pyx":237
+ * numpy.int32_t current = 0
+ * numpy.int32_t tmp64 = 0
+ * numpy.int32_t tmp64a = 0 # <<<<<<<<<<<<<<
+ * numpy.int32_t tmp64b = 0
+ * numpy.int32_t tmp64c = 0
+ */
+ __pyx_v_tmp64a = 0;
+
+ /* "fabio/ext/byte_offset.pyx":238
+ * numpy.int32_t tmp64 = 0
+ * numpy.int32_t tmp64a = 0
+ * numpy.int32_t tmp64b = 0 # <<<<<<<<<<<<<<
+ * numpy.int32_t tmp64c = 0
+ *
+ */
+ __pyx_v_tmp64b = 0;
+
+ /* "fabio/ext/byte_offset.pyx":239
+ * numpy.int32_t tmp64a = 0
+ * numpy.int32_t tmp64b = 0
+ * numpy.int32_t tmp64c = 0 # <<<<<<<<<<<<<<
+ *
+ * numpy.uint8_t key8 = 0x80
+ */
+ __pyx_v_tmp64c = 0;
+
+ /* "fabio/ext/byte_offset.pyx":241
+ * numpy.int32_t tmp64c = 0
+ *
+ * numpy.uint8_t key8 = 0x80 # <<<<<<<<<<<<<<
+ * numpy.uint8_t key0 = 0x00
+ *
+ */
+ __pyx_v_key8 = 0x80;
+
+ /* "fabio/ext/byte_offset.pyx":242
+ *
+ * numpy.uint8_t key8 = 0x80
+ * numpy.uint8_t key0 = 0x00 # <<<<<<<<<<<<<<
+ *
+ * int csize
+ */
+ __pyx_v_key0 = 0x00;
+
+ /* "fabio/ext/byte_offset.pyx":245
+ *
+ * int csize
+ * int lenStream = < int > len(stream) # <<<<<<<<<<<<<<
+ * numpy.uint8_t[:] cstream = bytearray(stream)
+ * if size is None:
+ */
+ __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_stream); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_lenStream = ((int)__pyx_t_1);
+
+ /* "fabio/ext/byte_offset.pyx":246
+ * int csize
+ * int lenStream = < int > len(stream)
+ * numpy.uint8_t[:] cstream = bytearray(stream) # <<<<<<<<<<<<<<
+ * if size is None:
+ * csize = lenStream
+ */
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_stream);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
+ __Pyx_GIVEREF(__pyx_v_stream);
+ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyByteArray_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
+ if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_cstream = __pyx_t_4;
+ __pyx_t_4.memview = NULL;
+ __pyx_t_4.data = NULL;
+
+ /* "fabio/ext/byte_offset.pyx":247
+ * int lenStream = < int > len(stream)
+ * numpy.uint8_t[:] cstream = bytearray(stream)
+ * if size is None: # <<<<<<<<<<<<<<
+ * csize = lenStream
+ * else:
+ */
+ __pyx_t_5 = (__pyx_v_size == Py_None);
+ __pyx_t_6 = (__pyx_t_5 != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/byte_offset.pyx":248
+ * numpy.uint8_t[:] cstream = bytearray(stream)
+ * if size is None:
+ * csize = lenStream # <<<<<<<<<<<<<<
+ * else:
+ * csize = < int > size
+ */
+ __pyx_v_csize = __pyx_v_lenStream;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/byte_offset.pyx":250
+ * csize = lenStream
+ * else:
+ * csize = < int > size # <<<<<<<<<<<<<<
+ * cdef numpy.ndarray[numpy.int32_t, ndim = 1] dataOut = numpy.empty(csize, dtype=numpy.int32)
+ * with nogil:
+ */
+ __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_csize = ((int)__pyx_t_7);
+ }
+ __pyx_L3:;
+
+ /* "fabio/ext/byte_offset.pyx":251
+ * else:
+ * csize = < int > size
+ * cdef numpy.ndarray[numpy.int32_t, ndim = 1] dataOut = numpy.empty(csize, dtype=numpy.int32) # <<<<<<<<<<<<<<
+ * with nogil:
+ * while (i < lenStream) and (j < csize):
+ */
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_csize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_8, 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 = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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 = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = ((PyArrayObject *)__pyx_t_10);
+ {
+ __Pyx_BufFmt_StackElem __pyx_stack[1];
+ if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dataOut.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+ __pyx_v_dataOut = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_dataOut.rcbuffer->pybuffer.buf = NULL;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ } else {__pyx_pybuffernd_dataOut.diminfo[0].strides = __pyx_pybuffernd_dataOut.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dataOut.diminfo[0].shape = __pyx_pybuffernd_dataOut.rcbuffer->pybuffer.shape[0];
+ }
+ }
+ __pyx_t_11 = 0;
+ __pyx_v_dataOut = ((PyArrayObject *)__pyx_t_10);
+ __pyx_t_10 = 0;
+
+ /* "fabio/ext/byte_offset.pyx":252
+ * csize = < int > size
+ * cdef numpy.ndarray[numpy.int32_t, ndim = 1] dataOut = numpy.empty(csize, dtype=numpy.int32)
+ * with nogil: # <<<<<<<<<<<<<<
+ * while (i < lenStream) and (j < csize):
+ * if (cstream[i] == key8):
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "fabio/ext/byte_offset.pyx":253
+ * cdef numpy.ndarray[numpy.int32_t, ndim = 1] dataOut = numpy.empty(csize, dtype=numpy.int32)
+ * with nogil:
+ * while (i < lenStream) and (j < csize): # <<<<<<<<<<<<<<
+ * if (cstream[i] == key8):
+ * if ((cstream[i + 1] == key0) and (cstream[i + 2] == key8)):
+ */
+ while (1) {
+ __pyx_t_5 = ((__pyx_v_i < __pyx_v_lenStream) != 0);
+ if (__pyx_t_5) {
+ } else {
+ __pyx_t_6 = __pyx_t_5;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_5 = ((__pyx_v_j < __pyx_v_csize) != 0);
+ __pyx_t_6 = __pyx_t_5;
+ __pyx_L9_bool_binop_done:;
+ if (!__pyx_t_6) break;
+
+ /* "fabio/ext/byte_offset.pyx":254
+ * with nogil:
+ * while (i < lenStream) and (j < csize):
+ * if (cstream[i] == key8): # <<<<<<<<<<<<<<
+ * if ((cstream[i + 1] == key0) and (cstream[i + 2] == key8)):
+ * # Retrieve the interesting Bytes of data
+ */
+ __pyx_t_7 = __pyx_v_i;
+ if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_cstream.shape[0];
+ __pyx_t_6 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_7 * __pyx_v_cstream.strides[0]) ))) == __pyx_v_key8) != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/byte_offset.pyx":255
+ * while (i < lenStream) and (j < csize):
+ * if (cstream[i] == key8):
+ * if ((cstream[i + 1] == key0) and (cstream[i + 2] == key8)): # <<<<<<<<<<<<<<
+ * # Retrieve the interesting Bytes of data
+ * tmp64c = cstream[i + 3]
+ */
+ __pyx_t_12 = (__pyx_v_i + 1);
+ if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_cstream.shape[0];
+ __pyx_t_5 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_12 * __pyx_v_cstream.strides[0]) ))) == __pyx_v_key0) != 0);
+ if (__pyx_t_5) {
+ } else {
+ __pyx_t_6 = __pyx_t_5;
+ goto __pyx_L13_bool_binop_done;
+ }
+ __pyx_t_13 = (__pyx_v_i + 2);
+ if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_cstream.shape[0];
+ __pyx_t_5 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_13 * __pyx_v_cstream.strides[0]) ))) == __pyx_v_key8) != 0);
+ __pyx_t_6 = __pyx_t_5;
+ __pyx_L13_bool_binop_done:;
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/byte_offset.pyx":257
+ * if ((cstream[i + 1] == key0) and (cstream[i + 2] == key8)):
+ * # Retrieve the interesting Bytes of data
+ * tmp64c = cstream[i + 3] # <<<<<<<<<<<<<<
+ * tmp64b = cstream[i + 4]
+ * tmp64a = cstream[i + 5]
+ */
+ __pyx_t_14 = (__pyx_v_i + 3);
+ if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_cstream.shape[0];
+ __pyx_v_tmp64c = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_14 * __pyx_v_cstream.strides[0]) )));
+
+ /* "fabio/ext/byte_offset.pyx":258
+ * # Retrieve the interesting Bytes of data
+ * tmp64c = cstream[i + 3]
+ * tmp64b = cstream[i + 4] # <<<<<<<<<<<<<<
+ * tmp64a = cstream[i + 5]
+ * tmp64 = <numpy.int8_t> cstream[i + 6]
+ */
+ __pyx_t_15 = (__pyx_v_i + 4);
+ if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_cstream.shape[0];
+ __pyx_v_tmp64b = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_15 * __pyx_v_cstream.strides[0]) )));
+
+ /* "fabio/ext/byte_offset.pyx":259
+ * tmp64c = cstream[i + 3]
+ * tmp64b = cstream[i + 4]
+ * tmp64a = cstream[i + 5] # <<<<<<<<<<<<<<
+ * tmp64 = <numpy.int8_t> cstream[i + 6]
+ * # Assemble data into a 32 bits integer
+ */
+ __pyx_t_16 = (__pyx_v_i + 5);
+ if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_cstream.shape[0];
+ __pyx_v_tmp64a = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_16 * __pyx_v_cstream.strides[0]) )));
+
+ /* "fabio/ext/byte_offset.pyx":260
+ * tmp64b = cstream[i + 4]
+ * tmp64a = cstream[i + 5]
+ * tmp64 = <numpy.int8_t> cstream[i + 6] # <<<<<<<<<<<<<<
+ * # Assemble data into a 32 bits integer
+ * current = (tmp64 << 24) | (tmp64a << 16) | (tmp64b << 8) | (tmp64c)
+ */
+ __pyx_t_17 = (__pyx_v_i + 6);
+ if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_cstream.shape[0];
+ __pyx_v_tmp64 = ((__pyx_t_5numpy_int8_t)(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_17 * __pyx_v_cstream.strides[0]) ))));
+
+ /* "fabio/ext/byte_offset.pyx":262
+ * tmp64 = <numpy.int8_t> cstream[i + 6]
+ * # Assemble data into a 32 bits integer
+ * current = (tmp64 << 24) | (tmp64a << 16) | (tmp64b << 8) | (tmp64c) # <<<<<<<<<<<<<<
+ * i += 7
+ * else:
+ */
+ __pyx_v_current = ((((__pyx_v_tmp64 << 24) | (__pyx_v_tmp64a << 16)) | (__pyx_v_tmp64b << 8)) | __pyx_v_tmp64c);
+
+ /* "fabio/ext/byte_offset.pyx":263
+ * # Assemble data into a 32 bits integer
+ * current = (tmp64 << 24) | (tmp64a << 16) | (tmp64b << 8) | (tmp64c)
+ * i += 7 # <<<<<<<<<<<<<<
+ * else:
+ * tmp64a = cstream[i + 1]
+ */
+ __pyx_v_i = (__pyx_v_i + 7);
+ goto __pyx_L12;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/byte_offset.pyx":265
+ * i += 7
+ * else:
+ * tmp64a = cstream[i + 1] # <<<<<<<<<<<<<<
+ * tmp64 = <numpy.int8_t> cstream[i + 2]
+ *
+ */
+ __pyx_t_18 = (__pyx_v_i + 1);
+ if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_cstream.shape[0];
+ __pyx_v_tmp64a = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_18 * __pyx_v_cstream.strides[0]) )));
+
+ /* "fabio/ext/byte_offset.pyx":266
+ * else:
+ * tmp64a = cstream[i + 1]
+ * tmp64 = <numpy.int8_t> cstream[i + 2] # <<<<<<<<<<<<<<
+ *
+ * current = (tmp64 << 8) | (tmp64a)
+ */
+ __pyx_t_19 = (__pyx_v_i + 2);
+ if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_cstream.shape[0];
+ __pyx_v_tmp64 = ((__pyx_t_5numpy_int8_t)(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_19 * __pyx_v_cstream.strides[0]) ))));
+
+ /* "fabio/ext/byte_offset.pyx":268
+ * tmp64 = <numpy.int8_t> cstream[i + 2]
+ *
+ * current = (tmp64 << 8) | (tmp64a) # <<<<<<<<<<<<<<
+ * i += 3
+ * else:
+ */
+ __pyx_v_current = ((__pyx_v_tmp64 << 8) | __pyx_v_tmp64a);
+
+ /* "fabio/ext/byte_offset.pyx":269
+ *
+ * current = (tmp64 << 8) | (tmp64a)
+ * i += 3 # <<<<<<<<<<<<<<
+ * else:
+ * current = (<numpy.int8_t> cstream[i])
+ */
+ __pyx_v_i = (__pyx_v_i + 3);
+ }
+ __pyx_L12:;
+ goto __pyx_L11;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/byte_offset.pyx":271
+ * i += 3
+ * else:
+ * current = (<numpy.int8_t> cstream[i]) # <<<<<<<<<<<<<<
+ * i += 1
+ * last += current
+ */
+ __pyx_t_20 = __pyx_v_i;
+ if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_v_cstream.shape[0];
+ __pyx_v_current = ((__pyx_t_5numpy_int8_t)(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_20 * __pyx_v_cstream.strides[0]) ))));
+
+ /* "fabio/ext/byte_offset.pyx":272
+ * else:
+ * current = (<numpy.int8_t> cstream[i])
+ * i += 1 # <<<<<<<<<<<<<<
+ * last += current
+ * dataOut[j] = last
+ */
+ __pyx_v_i = (__pyx_v_i + 1);
+ }
+ __pyx_L11:;
+
+ /* "fabio/ext/byte_offset.pyx":273
+ * current = (<numpy.int8_t> cstream[i])
+ * i += 1
+ * last += current # <<<<<<<<<<<<<<
+ * dataOut[j] = last
+ * j += 1
+ */
+ __pyx_v_last = (__pyx_v_last + __pyx_v_current);
+
+ /* "fabio/ext/byte_offset.pyx":274
+ * i += 1
+ * last += current
+ * dataOut[j] = last # <<<<<<<<<<<<<<
+ * j += 1
+ *
+ */
+ __pyx_t_21 = __pyx_v_j;
+ if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_pybuffernd_dataOut.diminfo[0].shape;
+ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_dataOut.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_dataOut.diminfo[0].strides) = __pyx_v_last;
+
+ /* "fabio/ext/byte_offset.pyx":275
+ * last += current
+ * dataOut[j] = last
+ * j += 1 # <<<<<<<<<<<<<<
+ *
+ * return dataOut[:j]
+ */
+ __pyx_v_j = (__pyx_v_j + 1);
+ }
+ }
+
+ /* "fabio/ext/byte_offset.pyx":252
+ * csize = < int > size
+ * cdef numpy.ndarray[numpy.int32_t, ndim = 1] dataOut = numpy.empty(csize, dtype=numpy.int32)
+ * with nogil: # <<<<<<<<<<<<<<
+ * while (i < lenStream) and (j < csize):
+ * if (cstream[i] == key8):
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+ }
+ }
+
+ /* "fabio/ext/byte_offset.pyx":277
+ * j += 1
+ *
+ * return dataOut[:j] # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_10 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_dataOut), 0, __pyx_v_j, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_r = __pyx_t_10;
+ __pyx_t_10 = 0;
+ goto __pyx_L0;
+
+ /* "fabio/ext/byte_offset.pyx":220
+ *
+ * @cython.boundscheck(False)
+ * def dec_cbf32(bytes stream not None, size=None): # <<<<<<<<<<<<<<
+ * """
+ * Analyze a stream of char with any length of exception (2 or 4 bytes integers)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
+ { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
+ __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dataOut.rcbuffer->pybuffer);
+ __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
+ __Pyx_AddTraceback("fabio.ext.byte_offset.dec_cbf32", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ goto __pyx_L2;
+ __pyx_L0:;
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dataOut.rcbuffer->pybuffer);
+ __pyx_L2:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_cstream, 1);
+ __Pyx_XDECREF((PyObject *)__pyx_v_dataOut);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/byte_offset.pyx":281
+ *
+ * @cython.boundscheck(False)
+ * def dec_TY5(bytes stream not None, size=None): # <<<<<<<<<<<<<<
+ * """
+ * Analyze a stream of char with a TY5 compression scheme and exception (2 or 4 bytes integers)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_11byte_offset_9dec_TY5(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_5fabio_3ext_11byte_offset_8dec_TY5[] = "\n Analyze a stream of char with a TY5 compression scheme and exception (2 or 4 bytes integers)\n\n TODO: known broken, FIXME\n\n @param stream: bytes (string) representing the compressed data\n @param size: the size of the output array (of longInts)\n @return : int32 ndArrays\n ";
+static PyMethodDef __pyx_mdef_5fabio_3ext_11byte_offset_9dec_TY5 = {"dec_TY5", (PyCFunction)__pyx_pw_5fabio_3ext_11byte_offset_9dec_TY5, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_11byte_offset_8dec_TY5};
+static PyObject *__pyx_pw_5fabio_3ext_11byte_offset_9dec_TY5(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_stream = 0;
+ PyObject *__pyx_v_size = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("dec_TY5 (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_size,0};
+ PyObject* values[2] = {0,0};
+ values[1] = ((PyObject *)Py_None);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dec_TY5") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_stream = ((PyObject*)values[0]);
+ __pyx_v_size = values[1];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("dec_TY5", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.byte_offset.dec_TY5", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stream), (&PyBytes_Type), 0, "stream", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_r = __pyx_pf_5fabio_3ext_11byte_offset_8dec_TY5(__pyx_self, __pyx_v_stream, __pyx_v_size);
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_11byte_offset_8dec_TY5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_size) {
+ int __pyx_v_i;
+ int __pyx_v_j;
+ __pyx_t_5numpy_int32_t __pyx_v_last;
+ __pyx_t_5numpy_int32_t __pyx_v_current;
+ __pyx_t_5numpy_uint8_t __pyx_v_key8;
+ __pyx_t_5numpy_int32_t __pyx_v_tmp32a;
+ __pyx_t_5numpy_int32_t __pyx_v_tmp32b;
+ int __pyx_v_csize;
+ int __pyx_v_lenStream;
+ __Pyx_memviewslice __pyx_v_cstream = { 0, 0, { 0 }, { 0 }, { 0 } };
+ PyArrayObject *__pyx_v_dataOut = 0;
+ __Pyx_LocalBuf_ND __pyx_pybuffernd_dataOut;
+ __Pyx_Buffer __pyx_pybuffer_dataOut;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ PyArrayObject *__pyx_t_11 = NULL;
+ long __pyx_t_12;
+ long __pyx_t_13;
+ int __pyx_t_14;
+ int __pyx_t_15;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("dec_TY5", 0);
+ __pyx_pybuffer_dataOut.pybuffer.buf = NULL;
+ __pyx_pybuffer_dataOut.refcount = 0;
+ __pyx_pybuffernd_dataOut.data = NULL;
+ __pyx_pybuffernd_dataOut.rcbuffer = &__pyx_pybuffer_dataOut;
+
+ /* "fabio/ext/byte_offset.pyx":293
+ *
+ * cdef:
+ * int i = 0 # <<<<<<<<<<<<<<
+ * int j = 0
+ * numpy.int32_t last = 0
+ */
+ __pyx_v_i = 0;
+
+ /* "fabio/ext/byte_offset.pyx":294
+ * cdef:
+ * int i = 0
+ * int j = 0 # <<<<<<<<<<<<<<
+ * numpy.int32_t last = 0
+ * numpy.int32_t current = 0
+ */
+ __pyx_v_j = 0;
+
+ /* "fabio/ext/byte_offset.pyx":295
+ * int i = 0
+ * int j = 0
+ * numpy.int32_t last = 0 # <<<<<<<<<<<<<<
+ * numpy.int32_t current = 0
+ *
+ */
+ __pyx_v_last = 0;
+
+ /* "fabio/ext/byte_offset.pyx":296
+ * int j = 0
+ * numpy.int32_t last = 0
+ * numpy.int32_t current = 0 # <<<<<<<<<<<<<<
+ *
+ * # numpy.uint8_t tmp8 = 0
+ */
+ __pyx_v_current = 0;
+
+ /* "fabio/ext/byte_offset.pyx":299
+ *
+ * # numpy.uint8_t tmp8 = 0
+ * numpy.uint8_t key8 = 0xfe # 127+127 # <<<<<<<<<<<<<<
+ *
+ * numpy.int32_t tmp32a = 0
+ */
+ __pyx_v_key8 = 0xfe;
+
+ /* "fabio/ext/byte_offset.pyx":301
+ * numpy.uint8_t key8 = 0xfe # 127+127
+ *
+ * numpy.int32_t tmp32a = 0 # <<<<<<<<<<<<<<
+ * numpy.int32_t tmp32b = 0
+ * # numpy.int32_t tmp32c = 0
+ */
+ __pyx_v_tmp32a = 0;
+
+ /* "fabio/ext/byte_offset.pyx":302
+ *
+ * numpy.int32_t tmp32a = 0
+ * numpy.int32_t tmp32b = 0 # <<<<<<<<<<<<<<
+ * # numpy.int32_t tmp32c = 0
+ * # numpy.int32_t tmp32d = 0
+ */
+ __pyx_v_tmp32b = 0;
+
+ /* "fabio/ext/byte_offset.pyx":307
+ *
+ * int csize
+ * int lenStream = len(stream) # <<<<<<<<<<<<<<
+ * numpy.uint8_t[:] cstream = bytearray(stream)
+ * if size is None:
+ */
+ __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_stream); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_lenStream = __pyx_t_1;
+
+ /* "fabio/ext/byte_offset.pyx":308
+ * int csize
+ * int lenStream = len(stream)
+ * numpy.uint8_t[:] cstream = bytearray(stream) # <<<<<<<<<<<<<<
+ * if size is None:
+ * csize = lenStream
+ */
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_stream);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
+ __Pyx_GIVEREF(__pyx_v_stream);
+ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyByteArray_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
+ if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_cstream = __pyx_t_4;
+ __pyx_t_4.memview = NULL;
+ __pyx_t_4.data = NULL;
+
+ /* "fabio/ext/byte_offset.pyx":309
+ * int lenStream = len(stream)
+ * numpy.uint8_t[:] cstream = bytearray(stream)
+ * if size is None: # <<<<<<<<<<<<<<
+ * csize = lenStream
+ * else:
+ */
+ __pyx_t_5 = (__pyx_v_size == Py_None);
+ __pyx_t_6 = (__pyx_t_5 != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/byte_offset.pyx":310
+ * numpy.uint8_t[:] cstream = bytearray(stream)
+ * if size is None:
+ * csize = lenStream # <<<<<<<<<<<<<<
+ * else:
+ * csize = < int > size
+ */
+ __pyx_v_csize = __pyx_v_lenStream;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/byte_offset.pyx":312
+ * csize = lenStream
+ * else:
+ * csize = < int > size # <<<<<<<<<<<<<<
+ *
+ * cdef numpy.ndarray[numpy.int32_t, ndim = 1] dataOut = numpy.zeros(csize, dtype=numpy.int32)
+ */
+ __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_csize = ((int)__pyx_t_7);
+ }
+ __pyx_L3:;
+
+ /* "fabio/ext/byte_offset.pyx":314
+ * csize = < int > size
+ *
+ * cdef numpy.ndarray[numpy.int32_t, ndim = 1] dataOut = numpy.zeros(csize, dtype=numpy.int32) # <<<<<<<<<<<<<<
+ * if True:
+ * while (i < lenStream) and (j < csize):
+ */
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_csize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_8, 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 = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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 = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = ((PyArrayObject *)__pyx_t_10);
+ {
+ __Pyx_BufFmt_StackElem __pyx_stack[1];
+ if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dataOut.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
+ __pyx_v_dataOut = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_dataOut.rcbuffer->pybuffer.buf = NULL;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ } else {__pyx_pybuffernd_dataOut.diminfo[0].strides = __pyx_pybuffernd_dataOut.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dataOut.diminfo[0].shape = __pyx_pybuffernd_dataOut.rcbuffer->pybuffer.shape[0];
+ }
+ }
+ __pyx_t_11 = 0;
+ __pyx_v_dataOut = ((PyArrayObject *)__pyx_t_10);
+ __pyx_t_10 = 0;
+
+ /* "fabio/ext/byte_offset.pyx":316
+ * cdef numpy.ndarray[numpy.int32_t, ndim = 1] dataOut = numpy.zeros(csize, dtype=numpy.int32)
+ * if True:
+ * while (i < lenStream) and (j < csize): # <<<<<<<<<<<<<<
+ * if (cstream[i] == key8):
+ * tmp32a = cstream[i + 1] - 127
+ */
+ while (1) {
+ __pyx_t_5 = ((__pyx_v_i < __pyx_v_lenStream) != 0);
+ if (__pyx_t_5) {
+ } else {
+ __pyx_t_6 = __pyx_t_5;
+ goto __pyx_L6_bool_binop_done;
+ }
+ __pyx_t_5 = ((__pyx_v_j < __pyx_v_csize) != 0);
+ __pyx_t_6 = __pyx_t_5;
+ __pyx_L6_bool_binop_done:;
+ if (!__pyx_t_6) break;
+
+ /* "fabio/ext/byte_offset.pyx":317
+ * if True:
+ * while (i < lenStream) and (j < csize):
+ * if (cstream[i] == key8): # <<<<<<<<<<<<<<
+ * tmp32a = cstream[i + 1] - 127
+ * tmp32b = <numpy.int16_t>( <numpy.int8_t> cstream[i + 2] << 8 )
+ */
+ __pyx_t_7 = __pyx_v_i;
+ if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_cstream.shape[0];
+ __pyx_t_6 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_7 * __pyx_v_cstream.strides[0]) ))) == __pyx_v_key8) != 0);
+ if (__pyx_t_6) {
+
+ /* "fabio/ext/byte_offset.pyx":318
+ * while (i < lenStream) and (j < csize):
+ * if (cstream[i] == key8):
+ * tmp32a = cstream[i + 1] - 127 # <<<<<<<<<<<<<<
+ * tmp32b = <numpy.int16_t>( <numpy.int8_t> cstream[i + 2] << 8 )
+ * # print(tmp32a, tmp32b, (tmp32b|tmp32a))
+ */
+ __pyx_t_12 = (__pyx_v_i + 1);
+ if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_cstream.shape[0];
+ __pyx_v_tmp32a = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_12 * __pyx_v_cstream.strides[0]) ))) - 127);
+
+ /* "fabio/ext/byte_offset.pyx":319
+ * if (cstream[i] == key8):
+ * tmp32a = cstream[i + 1] - 127
+ * tmp32b = <numpy.int16_t>( <numpy.int8_t> cstream[i + 2] << 8 ) # <<<<<<<<<<<<<<
+ * # print(tmp32a, tmp32b, (tmp32b|tmp32a))
+ * current = (tmp32b) | (tmp32a)
+ */
+ __pyx_t_13 = (__pyx_v_i + 2);
+ if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_cstream.shape[0];
+ __pyx_v_tmp32b = ((__pyx_t_5numpy_int16_t)(((__pyx_t_5numpy_int8_t)(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_13 * __pyx_v_cstream.strides[0]) )))) << 8));
+
+ /* "fabio/ext/byte_offset.pyx":321
+ * tmp32b = <numpy.int16_t>( <numpy.int8_t> cstream[i + 2] << 8 )
+ * # print(tmp32a, tmp32b, (tmp32b|tmp32a))
+ * current = (tmp32b) | (tmp32a) # <<<<<<<<<<<<<<
+ * i += 3
+ * else:
+ */
+ __pyx_v_current = (__pyx_v_tmp32b | __pyx_v_tmp32a);
+
+ /* "fabio/ext/byte_offset.pyx":322
+ * # print(tmp32a, tmp32b, (tmp32b|tmp32a))
+ * current = (tmp32b) | (tmp32a)
+ * i += 3 # <<<<<<<<<<<<<<
+ * else:
+ * current = <numpy.int32_t>(<numpy.uint8_t> cstream[i]) - 127
+ */
+ __pyx_v_i = (__pyx_v_i + 3);
+ goto __pyx_L8;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/byte_offset.pyx":324
+ * i += 3
+ * else:
+ * current = <numpy.int32_t>(<numpy.uint8_t> cstream[i]) - 127 # <<<<<<<<<<<<<<
+ * i += 1
+ * last += current
+ */
+ __pyx_t_14 = __pyx_v_i;
+ if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_cstream.shape[0];
+ __pyx_v_current = (((__pyx_t_5numpy_int32_t)((__pyx_t_5numpy_uint8_t)(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cstream.data + __pyx_t_14 * __pyx_v_cstream.strides[0]) ))))) - 127);
+
+ /* "fabio/ext/byte_offset.pyx":325
+ * else:
+ * current = <numpy.int32_t>(<numpy.uint8_t> cstream[i]) - 127
+ * i += 1 # <<<<<<<<<<<<<<
+ * last += current
+ * dataOut[j] = last
+ */
+ __pyx_v_i = (__pyx_v_i + 1);
+ }
+ __pyx_L8:;
+
+ /* "fabio/ext/byte_offset.pyx":326
+ * current = <numpy.int32_t>(<numpy.uint8_t> cstream[i]) - 127
+ * i += 1
+ * last += current # <<<<<<<<<<<<<<
+ * dataOut[j] = last
+ * j += 1
+ */
+ __pyx_v_last = (__pyx_v_last + __pyx_v_current);
+
+ /* "fabio/ext/byte_offset.pyx":327
+ * i += 1
+ * last += current
+ * dataOut[j] = last # <<<<<<<<<<<<<<
+ * j += 1
+ * return dataOut[:j]
+ */
+ __pyx_t_15 = __pyx_v_j;
+ if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_pybuffernd_dataOut.diminfo[0].shape;
+ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_dataOut.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_dataOut.diminfo[0].strides) = __pyx_v_last;
+
+ /* "fabio/ext/byte_offset.pyx":328
+ * last += current
+ * dataOut[j] = last
+ * j += 1 # <<<<<<<<<<<<<<
+ * return dataOut[:j]
+ *
+ */
+ __pyx_v_j = (__pyx_v_j + 1);
+ }
+
+ /* "fabio/ext/byte_offset.pyx":329
+ * dataOut[j] = last
+ * j += 1
+ * return dataOut[:j] # <<<<<<<<<<<<<<
+ *
+ * # # determines the current position in the bitstream
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_10 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_dataOut), 0, __pyx_v_j, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_r = __pyx_t_10;
+ __pyx_t_10 = 0;
+ goto __pyx_L0;
+
+ /* "fabio/ext/byte_offset.pyx":281
+ *
+ * @cython.boundscheck(False)
+ * def dec_TY5(bytes stream not None, size=None): # <<<<<<<<<<<<<<
+ * """
+ * Analyze a stream of char with a TY5 compression scheme and exception (2 or 4 bytes integers)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
+ { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
+ __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dataOut.rcbuffer->pybuffer);
+ __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
+ __Pyx_AddTraceback("fabio.ext.byte_offset.dec_TY5", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ goto __pyx_L2;
+ __pyx_L0:;
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dataOut.rcbuffer->pybuffer);
+ __pyx_L2:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_cstream, 1);
+ __Pyx_XDECREF((PyObject *)__pyx_v_dataOut);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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) {
+ int __pyx_r;
+ __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;
+}
+
+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;
+ int __pyx_v_ndim;
+ int __pyx_v_endian_detector;
+ int __pyx_v_little_endian;
+ int __pyx_v_t;
+ char *__pyx_v_f;
+ PyArray_Descr *__pyx_v_descr = 0;
+ int __pyx_v_offset;
+ int __pyx_v_hasfields;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ char *__pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ if (__pyx_v_info != NULL) {
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_info->obj);
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
+ *
+ * cdef int copy_shape, i, ndim
+ * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ *
+ */
+ __pyx_v_endian_detector = 1;
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ *
+ * ndim = PyArray_NDIM(self)
+ */
+ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ *
+ * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
+ *
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
+ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
+
+ /* "../../../usr/lib/python2.7/dist-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))) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209
+ *
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * copy_shape = 1 # <<<<<<<<<<<<<<
+ * else:
+ * copy_shape = 0
+ */
+ __pyx_v_copy_shape = 1;
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
+ * copy_shape = 1
+ * else:
+ * copy_shape = 0 # <<<<<<<<<<<<<<
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ */
+ __pyx_v_copy_shape = 0;
+ }
+ __pyx_L4:;
+
+ /* "../../../usr/lib/python2.7/dist-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_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/lib/python2.7/dist-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) != 0)) != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L6_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-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_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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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) {
+
+ /* "../../../usr/lib/python2.7/dist-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_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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
+ * raise ValueError(u"ndarray is not Fortran contiguous")
+ *
+ * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
+ * info.ndim = ndim
+ * if copy_shape:
+ */
+ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
+ *
+ * info.buf = PyArray_DATA(self)
+ * info.ndim = ndim # <<<<<<<<<<<<<<
+ * if copy_shape:
+ * # Allocate new buffer for strides and shape info.
+ */
+ __pyx_v_info->ndim = __pyx_v_ndim;
+
+ /* "../../../usr/lib/python2.7/dist-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.
+ */
+ __pyx_t_1 = (__pyx_v_copy_shape != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ * info.shape = info.strides + ndim
+ * for i in range(ndim):
+ */
+ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
+
+ /* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i]
+ */
+ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229
+ * info.shape = info.strides + ndim
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ * else:
+ */
+ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
+
+ /* "../../../usr/lib/python2.7/dist-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] # <<<<<<<<<<<<<<
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ */
+ (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
+ }
+ goto __pyx_L11;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ * info.suboffsets = NULL
+ */
+ __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ */
+ __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
+ }
+ __pyx_L11:;
+
+ /* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ * info.readonly = not PyArray_ISWRITEABLE(self)
+ */
+ __pyx_v_info->suboffsets = NULL;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
+ * info.readonly = not PyArray_ISWRITEABLE(self)
+ *
+ */
+ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
+
+ /* "../../../usr/lib/python2.7/dist-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) != 0));
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
+ *
+ * cdef int t
+ * cdef char* f = NULL # <<<<<<<<<<<<<<
+ * cdef dtype descr = self.descr
+ * cdef list stack
+ */
+ __pyx_v_f = NULL;
+
+ /* "../../../usr/lib/python2.7/dist-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_3 = ((PyObject *)__pyx_v_self->descr);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":244
+ * cdef int offset
+ *
+ * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
+ *
+ * if not hasfields and not copy_shape:
+ */
+ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
+
+ /* "../../../usr/lib/python2.7/dist-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 != 0)) != 0);
+ if (__pyx_t_2) {
+ } 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) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
+ * if not hasfields and not copy_shape:
+ * # do not call releasebuffer
+ * info.obj = None # <<<<<<<<<<<<<<
+ * else:
+ * # need to call releasebuffer
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = Py_None;
+ goto __pyx_L14;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251
+ * else:
+ * # need to call releasebuffer
+ * info.obj = self # <<<<<<<<<<<<<<
+ *
+ * if not hasfields:
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
+ }
+ __pyx_L14:;
+
+ /* "../../../usr/lib/python2.7/dist-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 != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-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_4 = __pyx_v_descr->type_num;
+ __pyx_v_t = __pyx_t_4;
+
+ /* "../../../usr/lib/python2.7/dist-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_2 = ((__pyx_v_descr->byteorder == '>') != 0);
+ if (!__pyx_t_2) {
+ goto __pyx_L20_next_or;
+ } else {
+ }
+ __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:;
+
+ /* "../../../usr/lib/python2.7/dist-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_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) {
+
+ /* "../../../usr/lib/python2.7/dist-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_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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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/lib/python2.7/dist-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"
+ */
+ case NPY_BYTE:
+ __pyx_v_f = __pyx_k_b;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_UBYTE:
+ __pyx_v_f = __pyx_k_B;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_SHORT:
+ __pyx_v_f = __pyx_k_h;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_USHORT:
+ __pyx_v_f = __pyx_k_H;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_INT:
+ __pyx_v_f = __pyx_k_i;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_UINT:
+ __pyx_v_f = __pyx_k_I;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_LONG:
+ __pyx_v_f = __pyx_k_l;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_ULONG:
+ __pyx_v_f = __pyx_k_L;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_LONGLONG:
+ __pyx_v_f = __pyx_k_q;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_ULONGLONG:
+ __pyx_v_f = __pyx_k_Q;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_FLOAT:
+ __pyx_v_f = __pyx_k_f;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_DOUBLE:
+ __pyx_v_f = __pyx_k_d;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_LONGDOUBLE:
+ __pyx_v_f = __pyx_k_g;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_CFLOAT:
+ __pyx_v_f = __pyx_k_Zf;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_CDOUBLE:
+ __pyx_v_f = __pyx_k_Zd;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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:
+ */
+ case NPY_CLONGDOUBLE:
+ __pyx_v_f = __pyx_k_Zg;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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)
+ */
+ case NPY_OBJECT:
+ __pyx_v_f = __pyx_k_O;
+ break;
+ default:
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * info.format = f # <<<<<<<<<<<<<<
+ * return
+ * else:
+ */
+ __pyx_v_info->format = __pyx_v_f;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * info.format = f
+ * return # <<<<<<<<<<<<<<
+ * else:
+ * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
+ * return
+ * else:
+ * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
+ * info.format[0] = c'^' # Native data types, manual alignment
+ * offset = 0
+ */
+ __pyx_v_info->format = ((char *)malloc(255));
+
+ /* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * offset = 0
+ * f = _util_dtypestring(descr, info.format + 1,
+ */
+ (__pyx_v_info->format[0]) = '^';
+
+ /* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * f = _util_dtypestring(descr, info.format + 1,
+ * info.format + _buffer_format_string_len,
+ */
+ __pyx_v_offset = 0;
+
+ /* "../../../usr/lib/python2.7/dist-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)
+ */
+ __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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286
+ * info.format + _buffer_format_string_len,
+ * &offset)
+ * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ */
+ (__pyx_v_f[0]) = '\x00';
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
+ }
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
+ __Pyx_GOTREF(Py_None);
+ __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
+ }
+ __pyx_L2:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_descr);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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();
+}
+
+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);
+
+ /* "../../../usr/lib/python2.7/dist-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) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self):
+ * stdlib.free(info.format) # <<<<<<<<<<<<<<
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * stdlib.free(info.strides)
+ */
+ free(__pyx_v_info->format);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "../../../usr/lib/python2.7/dist-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))) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292
+ * 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
+ *
+ */
+ free(__pyx_v_info->strides);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "../../../usr/lib/python2.7/dist-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();
+}
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
+ * ctypedef npy_cdouble complex_t
+ *
+ * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(1, <void*>a)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":769
+ *
+ * cdef inline object PyArray_MultiIterNew1(a):
+ * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":772
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b):
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ *
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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.
+ */
+
+static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
+ PyArray_Descr *__pyx_v_child = 0;
+ int __pyx_v_endian_detector;
+ int __pyx_v_little_endian;
+ PyObject *__pyx_v_fields = 0;
+ PyObject *__pyx_v_childname = NULL;
+ PyObject *__pyx_v_new_offset = NULL;
+ PyObject *__pyx_v_t = NULL;
+ char *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ 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);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790
+ * cdef int delta_offset
+ * cdef tuple i
+ * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ * cdef tuple fields
+ */
+ __pyx_v_endian_detector = 1;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791
+ * cdef tuple i
+ * cdef int endian_detector = 1
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
+ * cdef tuple fields
+ *
+ */
+ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
+
+ /* "../../../usr/lib/python2.7/dist-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(__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 = __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
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #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_SET(__pyx_v_childname, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "../../../usr/lib/python2.7/dist-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 (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 %.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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":796
+ * for childname in descr.names:
+ * fields = descr.fields[childname]
+ * child, new_offset = fields # <<<<<<<<<<<<<<
+ *
+ * if (end - f) - <int>(new_offset - offset[0]) < 15:
+ */
+ 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
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ #else
+ __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __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 {
+ __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ 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_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
+ __pyx_t_3 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":798
+ * child, new_offset = fields
+ *
+ * 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 = __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 = 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_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_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
+ if (__pyx_t_6) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
+ *
+ * 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_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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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 == '>') != 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_6 = __pyx_t_7;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_L8_next_or:;
+
+ /* "../../../usr/lib/python2.7/dist-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 == '<') != 0);
+ if (__pyx_t_7) {
+ } else {
+ __pyx_t_6 = __pyx_t_7;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
+ __pyx_t_6 = __pyx_t_7;
+ __pyx_L7_bool_binop_done:;
+ if (__pyx_t_6) {
+
+ /* "../../../usr/lib/python2.7/dist-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_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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
+ *
+ * # Output padding bytes
+ * while offset[0] < new_offset: # <<<<<<<<<<<<<<
+ * f[0] = 120 # "x"; pad byte
+ * f += 1
+ */
+ while (1) {
+ __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;
+ __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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":814
+ * # Output padding bytes
+ * while offset[0] < new_offset:
+ * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
+ * f += 1
+ * offset[0] += 1
+ */
+ (__pyx_v_f[0]) = 120;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815
+ * while offset[0] < new_offset:
+ * f[0] = 120 # "x"; pad byte
+ * f += 1 # <<<<<<<<<<<<<<
+ * offset[0] += 1
+ *
+ */
+ __pyx_v_f = (__pyx_v_f + 1);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
+ * f[0] = 120 # "x"; pad byte
+ * f += 1
+ * offset[0] += 1 # <<<<<<<<<<<<<<
+ *
+ * offset[0] += child.itemsize
+ */
+ __pyx_t_8 = 0;
+ (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818
+ * offset[0] += 1
+ *
+ * offset[0] += child.itemsize # <<<<<<<<<<<<<<
+ *
+ * if not PyDataType_HASFIELDS(child):
+ */
+ __pyx_t_8 = 0;
+ (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
+
+ /* "../../../usr/lib/python2.7/dist-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_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
+ if (__pyx_t_6) {
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+
+ /* "../../../usr/lib/python2.7/dist-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_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
+ if (__pyx_t_6) {
+
+ /* "../../../usr/lib/python2.7/dist-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_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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 98;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 104;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 105;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 108;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 113;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 102;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 103;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 90;
+ (__pyx_v_f[1]) = 100;
+ __pyx_v_f = (__pyx_v_f + 1);
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 79;
+ goto __pyx_L15;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-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_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);
+ __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_L15:;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * f += 1 # <<<<<<<<<<<<<<
+ * else:
+ * # Cython ignores struct boundary information ("T{...}"),
+ */
+ __pyx_v_f = (__pyx_v_f + 1);
+ goto __pyx_L13;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-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_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_L13:;
+
+ /* "../../../usr/lib/python2.7/dist-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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850
+ * # so don't output it
+ * f = _util_dtypestring(child, f, end, offset)
+ * return f # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_f;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_child);
+ __Pyx_XDECREF(__pyx_v_fields);
+ __Pyx_XDECREF(__pyx_v_childname);
+ __Pyx_XDECREF(__pyx_v_new_offset);
+ __Pyx_XDECREF(__pyx_v_t);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
+ *
+ *
+ * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
+ * cdef PyObject* baseptr
+ * if base is None:
+ */
+
+static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
+ PyObject *__pyx_v_baseptr;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ __Pyx_RefNannySetupContext("set_array_base", 0);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968
+ * cdef inline void set_array_base(ndarray arr, object base):
+ * cdef PyObject* baseptr
+ * if base is None: # <<<<<<<<<<<<<<
+ * baseptr = NULL
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_base == Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
+ * cdef PyObject* baseptr
+ * if base is None:
+ * baseptr = NULL # <<<<<<<<<<<<<<
+ * else:
+ * Py_INCREF(base) # important to do this before decref below!
+ */
+ __pyx_v_baseptr = NULL;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971
+ * baseptr = NULL
+ * else:
+ * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base)
+ */
+ Py_INCREF(__pyx_v_base);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972
+ * else:
+ * Py_INCREF(base) # important to do this before decref below!
+ * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
+ * Py_XDECREF(arr.base)
+ * arr.base = baseptr
+ */
+ __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
+ }
+ __pyx_L3:;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973
+ * Py_INCREF(base) # important to do this before decref below!
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
+ * arr.base = baseptr
+ *
+ */
+ Py_XDECREF(__pyx_v_arr->base);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base)
+ * arr.base = baseptr # <<<<<<<<<<<<<<
+ *
+ * cdef inline object get_array_base(ndarray arr):
+ */
+ __pyx_v_arr->base = __pyx_v_baseptr;
+
+ /* "../../../usr/lib/python2.7/dist-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();
+}
+
+/* "../../../usr/lib/python2.7/dist-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
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("get_array_base", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":978
+ * cdef inline object get_array_base(ndarray arr):
+ * if arr.base is NULL:
+ * return None # <<<<<<<<<<<<<<
+ * else:
+ * return <object>arr.base
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(Py_None);
+ __pyx_r = Py_None;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
+ * return None
+ * else:
+ * return <object>arr.base # <<<<<<<<<<<<<<
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
+ __pyx_r = ((PyObject *)__pyx_v_arr->base);
+ goto __pyx_L0;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":116
+ * cdef bint dtype_is_object
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
+ * mode="c", bint allocate_buffer=True):
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_shape = 0;
+ Py_ssize_t __pyx_v_itemsize;
+ PyObject *__pyx_v_format = 0;
+ PyObject *__pyx_v_mode = 0;
+ int __pyx_v_allocate_buffer;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
+ PyObject* values[5] = {0,0,0,0,0};
+ values[3] = ((PyObject *)__pyx_n_s_c);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 3:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode);
+ if (value) { values[3] = value; kw_args--; }
+ }
+ case 4:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer);
+ if (value) { values[4] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_shape = ((PyObject*)values[0]);
+ __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_format = values[2];
+ __pyx_v_mode = values[3];
+ if (values[4]) {
+ __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+
+ /* "View.MemoryView":117
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
+ * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
+ *
+ * cdef int idx
+ */
+ __pyx_v_allocate_buffer = ((int)1);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_r = __pyx_array_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
+
+ /* "View.MemoryView":116
+ * cdef bint dtype_is_object
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
+ * mode="c", bint allocate_buffer=True):
+ *
+ */
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
+ int __pyx_v_idx;
+ Py_ssize_t __pyx_v_i;
+ Py_ssize_t __pyx_v_dim;
+ PyObject **__pyx_v_p;
+ char __pyx_v_order;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ char *__pyx_t_5;
+ int __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ Py_ssize_t __pyx_t_8;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__cinit__", 0);
+ __Pyx_INCREF(__pyx_v_format);
+
+ /* "View.MemoryView":123
+ * cdef PyObject **p
+ *
+ * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
+ * self.itemsize = itemsize
+ *
+ */
+ if (unlikely(__pyx_v_shape == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_self->ndim = ((int)__pyx_t_1);
+
+ /* "View.MemoryView":124
+ *
+ * self.ndim = <int> len(shape)
+ * self.itemsize = itemsize # <<<<<<<<<<<<<<
+ *
+ * if not self.ndim:
+ */
+ __pyx_v_self->itemsize = __pyx_v_itemsize;
+
+ /* "View.MemoryView":126
+ * self.itemsize = itemsize
+ *
+ * if not self.ndim: # <<<<<<<<<<<<<<
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":127
+ *
+ * if not self.ndim:
+ * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if itemsize <= 0:
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __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[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":129
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":130
+ *
+ * if itemsize <= 0:
+ * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if isinstance(format, unicode):
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __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[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":132
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ * if isinstance(format, unicode): # <<<<<<<<<<<<<<
+ * format = (<unicode>format).encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ */
+ __pyx_t_2 = PyUnicode_Check(__pyx_v_format);
+ __pyx_t_4 = (__pyx_t_2 != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":133
+ *
+ * if isinstance(format, unicode):
+ * format = (<unicode>format).encode('ASCII') # <<<<<<<<<<<<<<
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format
+ */
+ if (unlikely(__pyx_v_format == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "encode");
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_3 = PyUnicode_AsASCIIString(((PyObject*)__pyx_v_format)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
+ __pyx_t_3 = 0;
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":134
+ * if isinstance(format, unicode):
+ * format = (<unicode>format).encode('ASCII')
+ * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
+ * self.format = self._format
+ *
+ */
+ if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_v_format;
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_v_self->_format);
+ __Pyx_DECREF(__pyx_v_self->_format);
+ __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":135
+ * format = (<unicode>format).encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_self->format = __pyx_t_5;
+
+ /* "View.MemoryView":138
+ *
+ *
+ * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
+ * self._strides = self._shape + self.ndim
+ *
+ */
+ __pyx_v_self->_shape = ((Py_ssize_t *)PyMem_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
+
+ /* "View.MemoryView":139
+ *
+ * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
+ * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
+ *
+ * if not self._shape:
+ */
+ __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
+
+ /* "View.MemoryView":141
+ * self._strides = self._shape + self.ndim
+ *
+ * if not self._shape: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate shape and strides.")
+ *
+ */
+ __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":142
+ *
+ * if not self._shape:
+ * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __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[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":145
+ *
+ *
+ * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ */
+ __pyx_t_6 = 0;
+ __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
+ for (;;) {
+ if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_v_dim = __pyx_t_8;
+ __pyx_v_idx = __pyx_t_6;
+ __pyx_t_6 = (__pyx_t_6 + 1);
+
+ /* "View.MemoryView":146
+ *
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim
+ */
+ __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":147
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
+ * self._shape[idx] = dim
+ *
+ */
+ __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_9);
+ __pyx_t_7 = 0;
+ __pyx_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __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_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_Raise(__pyx_t_9, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":148
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim # <<<<<<<<<<<<<<
+ *
+ * cdef char order
+ */
+ (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
+
+ /* "View.MemoryView":145
+ *
+ *
+ * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ */
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "View.MemoryView":151
+ *
+ * cdef char order
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
+ * order = b'F'
+ * self.mode = u'fortran'
+ */
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":152
+ * cdef char order
+ * if mode == 'fortran':
+ * order = b'F' # <<<<<<<<<<<<<<
+ * self.mode = u'fortran'
+ * elif mode == 'c':
+ */
+ __pyx_v_order = 'F';
+
+ /* "View.MemoryView":153
+ * if mode == 'fortran':
+ * order = b'F'
+ * self.mode = u'fortran' # <<<<<<<<<<<<<<
+ * elif mode == 'c':
+ * order = b'C'
+ */
+ __Pyx_INCREF(__pyx_n_u_fortran);
+ __Pyx_GIVEREF(__pyx_n_u_fortran);
+ __Pyx_GOTREF(__pyx_v_self->mode);
+ __Pyx_DECREF(__pyx_v_self->mode);
+ __pyx_v_self->mode = __pyx_n_u_fortran;
+ goto __pyx_L10;
+ }
+
+ /* "View.MemoryView":154
+ * order = b'F'
+ * self.mode = u'fortran'
+ * elif mode == 'c': # <<<<<<<<<<<<<<
+ * order = b'C'
+ * self.mode = u'c'
+ */
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":155
+ * self.mode = u'fortran'
+ * elif mode == 'c':
+ * order = b'C' # <<<<<<<<<<<<<<
+ * self.mode = u'c'
+ * else:
+ */
+ __pyx_v_order = 'C';
+
+ /* "View.MemoryView":156
+ * elif mode == 'c':
+ * order = b'C'
+ * self.mode = u'c' # <<<<<<<<<<<<<<
+ * else:
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
+ */
+ __Pyx_INCREF(__pyx_n_u_c);
+ __Pyx_GIVEREF(__pyx_n_u_c);
+ __Pyx_GOTREF(__pyx_v_self->mode);
+ __Pyx_DECREF(__pyx_v_self->mode);
+ __pyx_v_self->mode = __pyx_n_u_c;
+ goto __pyx_L10;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":158
+ * self.mode = u'c'
+ * else:
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
+ *
+ * self.len = fill_contig_strides_array(self._shape, self._strides,
+ */
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L10:;
+
+ /* "View.MemoryView":160
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
+ *
+ * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
+ * itemsize, self.ndim, order)
+ *
+ */
+ __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
+
+ /* "View.MemoryView":163
+ * itemsize, self.ndim, order)
+ *
+ * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer:
+ */
+ __pyx_v_self->free_data = __pyx_v_allocate_buffer;
+
+ /* "View.MemoryView":164
+ *
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
+ * if allocate_buffer:
+ *
+ */
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_self->dtype_is_object = __pyx_t_4;
+
+ /* "View.MemoryView":165
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer: # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":168
+ *
+ *
+ * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
+ * if not self.data:
+ * raise MemoryError("unable to allocate array data.")
+ */
+ __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
+
+ /* "View.MemoryView":169
+ *
+ * self.data = <char *>malloc(self.len)
+ * if not self.data: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate array data.")
+ *
+ */
+ __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":170
+ * self.data = <char *>malloc(self.len)
+ * if not self.data:
+ * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
+ *
+ * if self.dtype_is_object:
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __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[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":172
+ * raise MemoryError("unable to allocate array data.")
+ *
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ */
+ __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":173
+ *
+ * if self.dtype_is_object:
+ * p = <PyObject **> self.data # <<<<<<<<<<<<<<
+ * for i in range(self.len / itemsize):
+ * p[i] = Py_None
+ */
+ __pyx_v_p = ((PyObject **)__pyx_v_self->data);
+
+ /* "View.MemoryView":174
+ * if self.dtype_is_object:
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
+ * p[i] = Py_None
+ * Py_INCREF(Py_None)
+ */
+ if (unlikely(__pyx_v_itemsize == 0)) {
+ #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[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
+ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
+ __pyx_v_i = __pyx_t_8;
+
+ /* "View.MemoryView":175
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ * p[i] = Py_None # <<<<<<<<<<<<<<
+ * Py_INCREF(Py_None)
+ *
+ */
+ (__pyx_v_p[__pyx_v_i]) = Py_None;
+
+ /* "View.MemoryView":176
+ * for i in range(self.len / itemsize):
+ * p[i] = Py_None
+ * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
+ *
+ * @cname('getbuffer')
+ */
+ Py_INCREF(Py_None);
+ }
+ goto __pyx_L13;
+ }
+ __pyx_L13:;
+ goto __pyx_L11;
+ }
+ __pyx_L11:;
+
+ /* "View.MemoryView":116
+ * cdef bint dtype_is_object
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
+ * mode="c", bint allocate_buffer=True):
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_format);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":179
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * cdef int bufmode = -1
+ * if self.mode == u"c":
+ */
+
+/* Python wrapper */
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
+ __pyx_r = __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_v_bufmode;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ char *__pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+ int __pyx_t_6;
+ Py_ssize_t *__pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ if (__pyx_v_info != NULL) {
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_info->obj);
+ }
+
+ /* "View.MemoryView":180
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * cdef int bufmode = -1 # <<<<<<<<<<<<<<
+ * if self.mode == u"c":
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ */
+ __pyx_v_bufmode = -1;
+
+ /* "View.MemoryView":181
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * cdef int bufmode = -1
+ * if self.mode == u"c": # <<<<<<<<<<<<<<
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran":
+ */
+ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":182
+ * cdef int bufmode = -1
+ * if self.mode == u"c":
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
+ * elif self.mode == u"fortran":
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ */
+ __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":183
+ * if self.mode == u"c":
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode):
+ */
+ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":184
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran":
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ */
+ __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":185
+ * elif self.mode == u"fortran":
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode): # <<<<<<<<<<<<<<
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ * info.buf = self.data
+ */
+ __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":186
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
+ * info.buf = self.data
+ * info.len = self.len
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __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[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":187
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ * info.buf = self.data # <<<<<<<<<<<<<<
+ * info.len = self.len
+ * info.ndim = self.ndim
+ */
+ __pyx_t_4 = __pyx_v_self->data;
+ __pyx_v_info->buf = __pyx_t_4;
+
+ /* "View.MemoryView":188
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ * info.buf = self.data
+ * info.len = self.len # <<<<<<<<<<<<<<
+ * info.ndim = self.ndim
+ * info.shape = self._shape
+ */
+ __pyx_t_5 = __pyx_v_self->len;
+ __pyx_v_info->len = __pyx_t_5;
+
+ /* "View.MemoryView":189
+ * info.buf = self.data
+ * info.len = self.len
+ * info.ndim = self.ndim # <<<<<<<<<<<<<<
+ * info.shape = self._shape
+ * info.strides = self._strides
+ */
+ __pyx_t_6 = __pyx_v_self->ndim;
+ __pyx_v_info->ndim = __pyx_t_6;
+
+ /* "View.MemoryView":190
+ * info.len = self.len
+ * info.ndim = self.ndim
+ * info.shape = self._shape # <<<<<<<<<<<<<<
+ * info.strides = self._strides
+ * info.suboffsets = NULL
+ */
+ __pyx_t_7 = __pyx_v_self->_shape;
+ __pyx_v_info->shape = __pyx_t_7;
+
+ /* "View.MemoryView":191
+ * info.ndim = self.ndim
+ * info.shape = self._shape
+ * info.strides = self._strides # <<<<<<<<<<<<<<
+ * info.suboffsets = NULL
+ * info.itemsize = self.itemsize
+ */
+ __pyx_t_7 = __pyx_v_self->_strides;
+ __pyx_v_info->strides = __pyx_t_7;
+
+ /* "View.MemoryView":192
+ * info.shape = self._shape
+ * info.strides = self._strides
+ * info.suboffsets = NULL # <<<<<<<<<<<<<<
+ * info.itemsize = self.itemsize
+ * info.readonly = 0
+ */
+ __pyx_v_info->suboffsets = NULL;
+
+ /* "View.MemoryView":193
+ * info.strides = self._strides
+ * info.suboffsets = NULL
+ * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
+ * info.readonly = 0
+ *
+ */
+ __pyx_t_5 = __pyx_v_self->itemsize;
+ __pyx_v_info->itemsize = __pyx_t_5;
+
+ /* "View.MemoryView":194
+ * info.suboffsets = NULL
+ * info.itemsize = self.itemsize
+ * info.readonly = 0 # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_FORMAT:
+ */
+ __pyx_v_info->readonly = 0;
+
+ /* "View.MemoryView":196
+ * info.readonly = 0
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.format
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":197
+ *
+ * if flags & PyBUF_FORMAT:
+ * info.format = self.format # <<<<<<<<<<<<<<
+ * else:
+ * info.format = NULL
+ */
+ __pyx_t_4 = __pyx_v_self->format;
+ __pyx_v_info->format = __pyx_t_4;
+ goto __pyx_L5;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":199
+ * info.format = self.format
+ * else:
+ * info.format = NULL # <<<<<<<<<<<<<<
+ *
+ * info.obj = self
+ */
+ __pyx_v_info->format = NULL;
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":201
+ * info.format = NULL
+ *
+ * info.obj = self # <<<<<<<<<<<<<<
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
+
+ /* "View.MemoryView":179
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * cdef int bufmode = -1
+ * if self.mode == u"c":
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
+ }
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
+ __Pyx_GOTREF(Py_None);
+ __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
+ }
+ __pyx_L2:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":205
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
+ *
+ * def __dealloc__(array self): # <<<<<<<<<<<<<<
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data)
+ */
+
+/* Python wrapper */
+static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_array_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "View.MemoryView":206
+ *
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ */
+ __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":207
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
+ * elif self.free_data:
+ * if self.dtype_is_object:
+ */
+ __pyx_v_self->callback_free_data(__pyx_v_self->data);
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":208
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data)
+ * elif self.free_data: # <<<<<<<<<<<<<<
+ * if self.dtype_is_object:
+ * refcount_objects_in_slice(self.data, self._shape,
+ */
+ __pyx_t_1 = (__pyx_v_self->free_data != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":209
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice(self.data, self._shape,
+ * self._strides, self.ndim, False)
+ */
+ __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":210
+ * elif self.free_data:
+ * if self.dtype_is_object:
+ * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
+ * self._strides, self.ndim, False)
+ * free(self.data)
+ */
+ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":212
+ * refcount_objects_in_slice(self.data, self._shape,
+ * self._strides, self.ndim, False)
+ * free(self.data) # <<<<<<<<<<<<<<
+ * PyMem_Free(self._shape)
+ *
+ */
+ free(__pyx_v_self->data);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":213
+ * self._strides, self.ndim, False)
+ * free(self.data)
+ * PyMem_Free(self._shape) # <<<<<<<<<<<<<<
+ *
+ * property memview:
+ */
+ PyMem_Free(__pyx_v_self->_shape);
+
+ /* "View.MemoryView":205
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
+ *
+ * def __dealloc__(array self): # <<<<<<<<<<<<<<
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data)
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":217
+ * property memview:
+ * @cname('get_memview')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ *
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ */
+
+/* Python wrapper */
+static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/
+static PyObject *get_memview(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = get_memview_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+ int __pyx_v_flags;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":219
+ * def __get__(self):
+ *
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
+ * return memoryview(self, flags, self.dtype_is_object)
+ *
+ */
+ __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
+
+ /* "View.MemoryView":220
+ *
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":217
+ * property memview:
+ * @cname('get_memview')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ *
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":223
+ *
+ *
+ * def __getattr__(self, attr): # <<<<<<<<<<<<<<
+ * return getattr(self.memview, attr)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
+static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
+ __pyx_r = __pyx_array_MemoryView_5array_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getattr__", 0);
+
+ /* "View.MemoryView":224
+ *
+ * def __getattr__(self, attr):
+ * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
+ *
+ * def __getitem__(self, item):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":223
+ *
+ *
+ * def __getattr__(self, attr): # <<<<<<<<<<<<<<
+ * return getattr(self.memview, attr)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":226
+ * return getattr(self.memview, attr)
+ *
+ * def __getitem__(self, item): # <<<<<<<<<<<<<<
+ * return self.memview[item]
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
+ __pyx_r = __pyx_array_MemoryView_5array_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getitem__", 0);
+
+ /* "View.MemoryView":227
+ *
+ * def __getitem__(self, item):
+ * return self.memview[item] # <<<<<<<<<<<<<<
+ *
+ * def __setitem__(self, item, value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":226
+ * return getattr(self.memview, attr)
+ *
+ * def __getitem__(self, item): # <<<<<<<<<<<<<<
+ * return self.memview[item]
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":229
+ * return self.memview[item]
+ *
+ * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
+ * self.memview[item] = value
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
+ __pyx_r = __pyx_array_MemoryView_5array_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__setitem__", 0);
+
+ /* "View.MemoryView":230
+ *
+ * def __setitem__(self, item, value):
+ * self.memview[item] = value # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "View.MemoryView":229
+ * return self.memview[item]
+ *
+ * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
+ * self.memview[item] = value
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":234
+ *
+ * @cname("__pyx_array_new")
+ * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
+ * char *mode, char *buf):
+ * cdef array result
+ */
+
+static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
+ struct __pyx_array_obj *__pyx_v_result = 0;
+ struct __pyx_array_obj *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("array_cwrapper", 0);
+
+ /* "View.MemoryView":238
+ * cdef array result
+ *
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":239
+ *
+ * if buf == NULL:
+ * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
+ */
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
+ __Pyx_GIVEREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 0;
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
+ __pyx_t_4 = 0;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":241
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
+ * allocate_buffer=False)
+ * result.data = buf
+ */
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __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[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
+ __Pyx_GIVEREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_4 = 0;
+ __pyx_t_5 = 0;
+ __pyx_t_3 = 0;
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+
+ /* "View.MemoryView":242
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
+ * allocate_buffer=False) # <<<<<<<<<<<<<<
+ * result.data = buf
+ *
+ */
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":241
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
+ * allocate_buffer=False)
+ * result.data = buf
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":243
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
+ * allocate_buffer=False)
+ * result.data = buf # <<<<<<<<<<<<<<
+ *
+ * return result
+ */
+ __pyx_v_result->data = __pyx_v_buf;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":245
+ * result.data = buf
+ *
+ * return result # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":234
+ *
+ * @cname("__pyx_array_new")
+ * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
+ * char *mode, char *buf):
+ * cdef array result
+ */
+
+ /* 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);
+ __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF((PyObject *)__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":271
+ * cdef class Enum(object):
+ * cdef object name
+ * def __init__(self, name): # <<<<<<<<<<<<<<
+ * self.name = name
+ * def __repr__(self):
+ */
+
+/* Python wrapper */
+static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_name = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
+ PyObject* values[1] = {0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ }
+ __pyx_v_name = values[0];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__", 0);
+
+ /* "View.MemoryView":272
+ * cdef object name
+ * def __init__(self, name):
+ * self.name = name # <<<<<<<<<<<<<<
+ * def __repr__(self):
+ * return self.name
+ */
+ __Pyx_INCREF(__pyx_v_name);
+ __Pyx_GIVEREF(__pyx_v_name);
+ __Pyx_GOTREF(__pyx_v_self->name);
+ __Pyx_DECREF(__pyx_v_self->name);
+ __pyx_v_self->name = __pyx_v_name;
+
+ /* "View.MemoryView":271
+ * cdef class Enum(object):
+ * cdef object name
+ * def __init__(self, name): # <<<<<<<<<<<<<<
+ * self.name = name
+ * def __repr__(self):
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":273
+ * def __init__(self, name):
+ * self.name = name
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return self.name
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+ __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__repr__", 0);
+
+ /* "View.MemoryView":274
+ * self.name = name
+ * def __repr__(self):
+ * return self.name # <<<<<<<<<<<<<<
+ *
+ * cdef generic = Enum("<strided and direct or indirect>")
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->name);
+ __pyx_r = __pyx_v_self->name;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":273
+ * def __init__(self, name):
+ * self.name = name
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return self.name
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":288
+ *
+ * @cname('__pyx_align_pointer')
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
+ * "Align pointer memory on a given boundary"
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
+ */
+
+static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
+ Py_intptr_t __pyx_v_aligned_p;
+ size_t __pyx_v_offset;
+ void *__pyx_r;
+ int __pyx_t_1;
+
+ /* "View.MemoryView":290
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil:
+ * "Align pointer memory on a given boundary"
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
+ * cdef size_t offset
+ *
+ */
+ __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
+
+ /* "View.MemoryView":294
+ *
+ * with cython.cdivision(True):
+ * offset = aligned_p % alignment # <<<<<<<<<<<<<<
+ *
+ * if offset > 0:
+ */
+ __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
+
+ /* "View.MemoryView":296
+ * offset = aligned_p % alignment
+ *
+ * if offset > 0: # <<<<<<<<<<<<<<
+ * aligned_p += alignment - offset
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":297
+ *
+ * if offset > 0:
+ * aligned_p += alignment - offset # <<<<<<<<<<<<<<
+ *
+ * return <void *> aligned_p
+ */
+ __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":299
+ * aligned_p += alignment - offset
+ *
+ * return <void *> aligned_p # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview')
+ */
+ __pyx_r = ((void *)__pyx_v_aligned_p);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":288
+ *
+ * @cname('__pyx_align_pointer')
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
+ * "Align pointer memory on a given boundary"
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":317
+ * cdef __Pyx_TypeInfo *typeinfo
+ *
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
+ * self.obj = obj
+ * self.flags = flags
+ */
+
+/* Python wrapper */
+static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_obj = 0;
+ int __pyx_v_flags;
+ int __pyx_v_dtype_is_object;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object);
+ if (value) { values[2] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_obj = values[0];
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (values[2]) {
+ __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+ __pyx_v_dtype_is_object = ((int)0);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__cinit__", 0);
+
+ /* "View.MemoryView":318
+ *
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
+ * self.obj = obj # <<<<<<<<<<<<<<
+ * self.flags = flags
+ * if type(self) is memoryview or obj is not None:
+ */
+ __Pyx_INCREF(__pyx_v_obj);
+ __Pyx_GIVEREF(__pyx_v_obj);
+ __Pyx_GOTREF(__pyx_v_self->obj);
+ __Pyx_DECREF(__pyx_v_self->obj);
+ __pyx_v_self->obj = __pyx_v_obj;
+
+ /* "View.MemoryView":319
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
+ * self.obj = obj
+ * self.flags = flags # <<<<<<<<<<<<<<
+ * if type(self) is memoryview or obj is not None:
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ */
+ __pyx_v_self->flags = __pyx_v_flags;
+
+ /* "View.MemoryView":320
+ * self.obj = obj
+ * self.flags = flags
+ * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL:
+ */
+ __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)((PyObject *)__pyx_memoryview_type)));
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (!__pyx_t_3) {
+ } else {
+ __pyx_t_1 = __pyx_t_3;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_3 = (__pyx_v_obj != Py_None);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L4_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":321
+ * self.flags = flags
+ * if type(self) is memoryview or obj is not None:
+ * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
+ * if <PyObject *> self.view.obj == NULL:
+ * (<__pyx_buffer *> &self.view).obj = Py_None
+ */
+ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":322
+ * if type(self) is memoryview or obj is not None:
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
+ * (<__pyx_buffer *> &self.view).obj = Py_None
+ * Py_INCREF(Py_None)
+ */
+ __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":323
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL:
+ * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
+ * Py_INCREF(Py_None)
+ *
+ */
+ ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
+
+ /* "View.MemoryView":324
+ * if <PyObject *> self.view.obj == NULL:
+ * (<__pyx_buffer *> &self.view).obj = Py_None
+ * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
+ *
+ * self.lock = PyThread_allocate_lock()
+ */
+ Py_INCREF(Py_None);
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":326
+ * Py_INCREF(Py_None)
+ *
+ * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
+ * if self.lock == NULL:
+ * raise MemoryError
+ */
+ __pyx_v_self->lock = PyThread_allocate_lock();
+
+ /* "View.MemoryView":327
+ *
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":328
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock == NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_FORMAT:
+ */
+ PyErr_NoMemory(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":330
+ * raise MemoryError
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * self.dtype_is_object = self.view.format == b'O'
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":331
+ *
+ * if flags & PyBUF_FORMAT:
+ * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<<
+ * else:
+ * self.dtype_is_object = dtype_is_object
+ */
+ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_v_self->dtype_is_object = __pyx_t_1;
+ goto __pyx_L8;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":333
+ * self.dtype_is_object = self.view.format == b'O'
+ * else:
+ * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
+ *
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
+ */
+ __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
+ }
+ __pyx_L8:;
+
+ /* "View.MemoryView":335
+ * self.dtype_is_object = dtype_is_object
+ *
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
+ * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
+ * self.typeinfo = NULL
+ */
+ __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
+
+ /* "View.MemoryView":337
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
+ * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
+ * self.typeinfo = NULL # <<<<<<<<<<<<<<
+ *
+ * def __dealloc__(memoryview self):
+ */
+ __pyx_v_self->typeinfo = NULL;
+
+ /* "View.MemoryView":317
+ * cdef __Pyx_TypeInfo *typeinfo
+ *
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
+ * self.obj = obj
+ * self.flags = flags
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":339
+ * self.typeinfo = NULL
+ *
+ * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
+ * if self.obj is not None:
+ * __Pyx_ReleaseBuffer(&self.view)
+ */
+
+/* Python wrapper */
+static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "View.MemoryView":340
+ *
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None: # <<<<<<<<<<<<<<
+ * __Pyx_ReleaseBuffer(&self.view)
+ *
+ */
+ __pyx_t_1 = (__pyx_v_self->obj != Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":341
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None:
+ * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
+ *
+ * if self.lock != NULL:
+ */
+ __Pyx_ReleaseBuffer((&__pyx_v_self->view));
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":343
+ * __Pyx_ReleaseBuffer(&self.view)
+ *
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
+ * PyThread_free_lock(self.lock)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":344
+ *
+ * if self.lock != NULL:
+ * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
+ *
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL:
+ */
+ PyThread_free_lock(__pyx_v_self->lock);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":339
+ * self.typeinfo = NULL
+ *
+ * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
+ * if self.obj is not None:
+ * __Pyx_ReleaseBuffer(&self.view)
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":346
+ * PyThread_free_lock(self.lock)
+ *
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dim
+ * cdef char *itemp = <char *> self.view.buf
+ */
+
+static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
+ Py_ssize_t __pyx_v_dim;
+ char *__pyx_v_itemp;
+ PyObject *__pyx_v_idx = NULL;
+ char *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ Py_ssize_t __pyx_t_3;
+ PyObject *(*__pyx_t_4)(PyObject *);
+ PyObject *__pyx_t_5 = NULL;
+ Py_ssize_t __pyx_t_6;
+ char *__pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("get_item_pointer", 0);
+
+ /* "View.MemoryView":348
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL:
+ * cdef Py_ssize_t dim
+ * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
+ *
+ * for dim, idx in enumerate(index):
+ */
+ __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
+
+ /* "View.MemoryView":350
+ * cdef char *itemp = <char *> self.view.buf
+ *
+ * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
+ *
+ */
+ __pyx_t_1 = 0;
+ if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
+ __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
+ __pyx_t_4 = NULL;
+ } else {
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ for (;;) {
+ if (likely(!__pyx_t_4)) {
+ if (likely(PyList_CheckExact(__pyx_t_2))) {
+ if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else {
+ if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ }
+ } else {
+ __pyx_t_5 = __pyx_t_4(__pyx_t_2);
+ if (unlikely(!__pyx_t_5)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_5);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_v_dim = __pyx_t_1;
+ __pyx_t_1 = (__pyx_t_1 + 1);
+
+ /* "View.MemoryView":351
+ *
+ * for dim, idx in enumerate(index):
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
+ *
+ * return itemp
+ */
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_itemp = __pyx_t_7;
+
+ /* "View.MemoryView":350
+ * cdef char *itemp = <char *> self.view.buf
+ *
+ * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
+ *
+ */
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":353
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
+ *
+ * return itemp # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_itemp;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":346
+ * PyThread_free_lock(self.lock)
+ *
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dim
+ * cdef char *itemp = <char *> self.view.buf
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_idx);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":356
+ *
+ *
+ * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
+ * if index is Ellipsis:
+ * return self
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
+static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
+ PyObject *__pyx_v_have_slices = NULL;
+ PyObject *__pyx_v_indices = NULL;
+ char *__pyx_v_itemp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getitem__", 0);
+
+ /* "View.MemoryView":357
+ *
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
+ __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":358
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis:
+ * return self # <<<<<<<<<<<<<<
+ *
+ * have_slices, indices = _unellipsify(index, self.view.ndim)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __pyx_r = ((PyObject *)__pyx_v_self);
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":360
+ * return self
+ *
+ * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * cdef char *itemp
+ */
+ __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (likely(__pyx_t_3 != Py_None)) {
+ PyObject* sequence = __pyx_t_3;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ Py_ssize_t size = Py_SIZE(sequence);
+ #else
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ #else
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ #endif
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else {
+ __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_v_have_slices = __pyx_t_4;
+ __pyx_t_4 = 0;
+ __pyx_v_indices = __pyx_t_5;
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":363
+ *
+ * cdef char *itemp
+ * if have_slices: # <<<<<<<<<<<<<<
+ * return memview_slice(self, indices)
+ * else:
+ */
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":364
+ * cdef char *itemp
+ * if have_slices:
+ * return memview_slice(self, indices) # <<<<<<<<<<<<<<
+ * else:
+ * itemp = self.get_item_pointer(indices)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":366
+ * return memview_slice(self, indices)
+ * else:
+ * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
+ * return self.convert_item_to_object(itemp)
+ *
+ */
+ __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_itemp = __pyx_t_6;
+
+ /* "View.MemoryView":367
+ * else:
+ * itemp = self.get_item_pointer(indices)
+ * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
+ *
+ * def __setitem__(memoryview self, object index, object value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":356
+ *
+ *
+ * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
+ * if index is Ellipsis:
+ * return self
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_have_slices);
+ __Pyx_XDECREF(__pyx_v_indices);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":369
+ * return self.convert_item_to_object(itemp)
+ *
+ * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
+ PyObject *__pyx_v_have_slices = NULL;
+ PyObject *__pyx_v_obj = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__setitem__", 0);
+ __Pyx_INCREF(__pyx_v_index);
+
+ /* "View.MemoryView":370
+ *
+ * def __setitem__(memoryview self, object index, object value):
+ * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * if have_slices:
+ */
+ __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (likely(__pyx_t_1 != Py_None)) {
+ PyObject* sequence = __pyx_t_1;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ Py_ssize_t size = Py_SIZE(sequence);
+ #else
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_3);
+ #else
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ #endif
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else {
+ __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_v_have_slices = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":372
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ * if have_slices: # <<<<<<<<<<<<<<
+ * obj = self.is_slice(value)
+ * if obj:
+ */
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":373
+ *
+ * if have_slices:
+ * obj = self.is_slice(value) # <<<<<<<<<<<<<<
+ * if obj:
+ * self.setitem_slice_assignment(self[index], obj)
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_obj = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":374
+ * if have_slices:
+ * obj = self.is_slice(value)
+ * if obj: # <<<<<<<<<<<<<<
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ */
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":375
+ * obj = self.is_slice(value)
+ * if obj:
+ * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
+ * else:
+ * self.setitem_slice_assign_scalar(self[index], value)
+ */
+ __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":377
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
+ * else:
+ * self.setitem_indexed(index, value)
+ */
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_3);
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
+ __pyx_L4:;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":379
+ * self.setitem_slice_assign_scalar(self[index], value)
+ * else:
+ * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
+ *
+ * cdef is_slice(self, obj):
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":369
+ * return self.convert_item_to_object(itemp)
+ *
+ * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_have_slices);
+ __Pyx_XDECREF(__pyx_v_obj);
+ __Pyx_XDECREF(__pyx_v_index);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":381
+ * self.setitem_indexed(index, value)
+ *
+ * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
+ * if not isinstance(obj, memoryview):
+ * try:
+ */
+
+static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ int __pyx_t_9;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("is_slice", 0);
+ __Pyx_INCREF(__pyx_v_obj);
+
+ /* "View.MemoryView":382
+ *
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, ((PyObject *)__pyx_memoryview_type));
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":383
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ {
+ __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_5);
+ /*try:*/ {
+
+ /* "View.MemoryView":384
+ * if not isinstance(obj, memoryview):
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
+ * self.dtype_is_object)
+ * except TypeError:
+ */
+ __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "View.MemoryView":385
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object) # <<<<<<<<<<<<<<
+ * except TypeError:
+ * return None
+ */
+ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "View.MemoryView":384
+ * if not isinstance(obj, memoryview):
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
+ * self.dtype_is_object)
+ * except TypeError:
+ */
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_INCREF(__pyx_v_obj);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
+ __Pyx_GIVEREF(__pyx_v_obj);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_6 = 0;
+ __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
+ __pyx_t_7 = 0;
+ }
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ goto __pyx_L11_try_end;
+ __pyx_L4_error:;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "View.MemoryView":386
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ * except TypeError: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
+ __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ if (__pyx_t_9) {
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "View.MemoryView":387
+ * self.dtype_is_object)
+ * except TypeError:
+ * return None # <<<<<<<<<<<<<<
+ *
+ * return obj
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(Py_None);
+ __pyx_r = Py_None;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ goto __pyx_L7_except_return;
+ }
+ goto __pyx_L6_except_error;
+ __pyx_L6_except_error:;
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+ goto __pyx_L1_error;
+ __pyx_L7_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+ goto __pyx_L0;
+ __pyx_L11_try_end:;
+ }
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":389
+ * return None
+ *
+ * return obj # <<<<<<<<<<<<<<
+ *
+ * cdef setitem_slice_assignment(self, dst, src):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_obj);
+ __pyx_r = __pyx_v_obj;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":381
+ * self.setitem_indexed(index, value)
+ *
+ * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
+ * if not isinstance(obj, memoryview):
+ * try:
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_obj);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":391
+ * return obj
+ *
+ * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice dst_slice
+ * cdef __Pyx_memviewslice src_slice
+ */
+
+static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
+ __Pyx_memviewslice __pyx_v_dst_slice;
+ __Pyx_memviewslice __pyx_v_src_slice;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
+
+ /* "View.MemoryView":395
+ * cdef __Pyx_memviewslice src_slice
+ *
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
+ * get_slice_from_memview(dst, &dst_slice)[0],
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ */
+ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":396
+ *
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
+ * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ *
+ */
+ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":397
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
+ * get_slice_from_memview(dst, &dst_slice)[0],
+ * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "View.MemoryView":395
+ * cdef __Pyx_memviewslice src_slice
+ *
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
+ * get_slice_from_memview(dst, &dst_slice)[0],
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ */
+ __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":391
+ * return obj
+ *
+ * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice dst_slice
+ * cdef __Pyx_memviewslice src_slice
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":399
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ *
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
+ * cdef int array[128]
+ * cdef void *tmp = NULL
+ */
+
+static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
+ int __pyx_v_array[128];
+ void *__pyx_v_tmp;
+ void *__pyx_v_item;
+ __Pyx_memviewslice *__pyx_v_dst_slice;
+ __Pyx_memviewslice __pyx_v_tmp_slice;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ char const *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ PyObject *__pyx_t_11 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
+
+ /* "View.MemoryView":401
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
+ * cdef int array[128]
+ * cdef void *tmp = NULL # <<<<<<<<<<<<<<
+ * cdef void *item
+ *
+ */
+ __pyx_v_tmp = NULL;
+
+ /* "View.MemoryView":406
+ * cdef __Pyx_memviewslice *dst_slice
+ * cdef __Pyx_memviewslice tmp_slice
+ * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
+ *
+ * if <size_t>self.view.itemsize > sizeof(array):
+ */
+ __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
+
+ /* "View.MemoryView":408
+ * dst_slice = get_slice_from_memview(dst, &tmp_slice)
+ *
+ * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL:
+ */
+ __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":409
+ *
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
+ * if tmp == NULL:
+ * raise MemoryError
+ */
+ __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
+
+ /* "View.MemoryView":410
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ * item = tmp
+ */
+ __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":411
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
+ * item = tmp
+ * else:
+ */
+ PyErr_NoMemory(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":412
+ * if tmp == NULL:
+ * raise MemoryError
+ * item = tmp # <<<<<<<<<<<<<<
+ * else:
+ * item = <void *> array
+ */
+ __pyx_v_item = __pyx_v_tmp;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":414
+ * item = tmp
+ * else:
+ * item = <void *> array # <<<<<<<<<<<<<<
+ *
+ * try:
+ */
+ __pyx_v_item = ((void *)__pyx_v_array);
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":416
+ * item = <void *> array
+ *
+ * try: # <<<<<<<<<<<<<<
+ * if self.dtype_is_object:
+ * (<PyObject **> item)[0] = <PyObject *> value
+ */
+ /*try:*/ {
+
+ /* "View.MemoryView":417
+ *
+ * try:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":418
+ * try:
+ * if self.dtype_is_object:
+ * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
+ * else:
+ * self.assign_item_from_object(<char *> item, value)
+ */
+ (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
+ goto __pyx_L8;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":420
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ __pyx_L8:;
+
+ /* "View.MemoryView":424
+ *
+ *
+ * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":425
+ *
+ * if self.view.suboffsets != NULL:
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
+ * item, self.dtype_is_object)
+ */
+ __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ goto __pyx_L9;
+ }
+ __pyx_L9:;
+
+ /* "View.MemoryView":426
+ * if self.view.suboffsets != NULL:
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
+ * item, self.dtype_is_object)
+ * finally:
+ */
+ __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
+ }
+
+ /* "View.MemoryView":429
+ * item, self.dtype_is_object)
+ * finally:
+ * PyMem_Free(tmp) # <<<<<<<<<<<<<<
+ *
+ * cdef setitem_indexed(self, index, value):
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ PyMem_Free(__pyx_v_tmp);
+ goto __pyx_L7;
+ }
+ /*exception exit:*/{
+ __pyx_L6_error:;
+ __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+ if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
+ __Pyx_XGOTREF(__pyx_t_6);
+ __Pyx_XGOTREF(__pyx_t_7);
+ __Pyx_XGOTREF(__pyx_t_8);
+ __Pyx_XGOTREF(__pyx_t_9);
+ __Pyx_XGOTREF(__pyx_t_10);
+ __Pyx_XGOTREF(__pyx_t_11);
+ __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
+ {
+ PyMem_Free(__pyx_v_tmp);
+ }
+ if (PY_MAJOR_VERSION >= 3) {
+ __Pyx_XGIVEREF(__pyx_t_9);
+ __Pyx_XGIVEREF(__pyx_t_10);
+ __Pyx_XGIVEREF(__pyx_t_11);
+ __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+ }
+ __Pyx_XGIVEREF(__pyx_t_6);
+ __Pyx_XGIVEREF(__pyx_t_7);
+ __Pyx_XGIVEREF(__pyx_t_8);
+ __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+ __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
+ __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
+ goto __pyx_L1_error;
+ }
+ __pyx_L7:;
+ }
+
+ /* "View.MemoryView":399
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ *
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
+ * cdef int array[128]
+ * cdef void *tmp = NULL
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":431
+ * PyMem_Free(tmp)
+ *
+ * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
+ * cdef char *itemp = self.get_item_pointer(index)
+ * self.assign_item_from_object(itemp, value)
+ */
+
+static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
+ char *__pyx_v_itemp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ char *__pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("setitem_indexed", 0);
+
+ /* "View.MemoryView":432
+ *
+ * cdef setitem_indexed(self, index, value):
+ * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
+ * self.assign_item_from_object(itemp, value)
+ *
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_itemp = __pyx_t_1;
+
+ /* "View.MemoryView":433
+ * cdef setitem_indexed(self, index, value):
+ * cdef char *itemp = self.get_item_pointer(index)
+ * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ */
+ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":431
+ * PyMem_Free(tmp)
+ *
+ * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
+ * cdef char *itemp = self.get_item_pointer(index)
+ * self.assign_item_from_object(itemp, value)
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":435
+ * self.assign_item_from_object(itemp, value)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
+ PyObject *__pyx_v_struct = NULL;
+ PyObject *__pyx_v_bytesitem = 0;
+ PyObject *__pyx_v_result = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ Py_ssize_t __pyx_t_8;
+ PyObject *__pyx_t_9 = NULL;
+ size_t __pyx_t_10;
+ int __pyx_t_11;
+ int __pyx_t_12;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("convert_item_to_object", 0);
+
+ /* "View.MemoryView":438
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ * import struct # <<<<<<<<<<<<<<
+ * cdef bytes bytesitem
+ *
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_struct = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":441
+ * cdef bytes bytesitem
+ *
+ * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
+ * try:
+ * result = struct.unpack(self.view.format, bytesitem)
+ */
+ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":442
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ {
+ __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ /*try:*/ {
+
+ /* "View.MemoryView":443
+ * bytesitem = itemp[:self.view.itemsize]
+ * try:
+ * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
+ * except struct.error:
+ * raise ValueError("Unable to convert item to object")
+ */
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = NULL;
+ __pyx_t_8 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_7)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ __pyx_t_8 = 1;
+ }
+ }
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+ }
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_v_bytesitem);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
+ __Pyx_GIVEREF(__pyx_v_bytesitem);
+ __pyx_t_6 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_result = __pyx_t_1;
+ __pyx_t_1 = 0;
+ }
+ /*else:*/ {
+
+ /* "View.MemoryView":447
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
+ * return result[0]
+ * return result
+ */
+ __pyx_t_10 = strlen(__pyx_v_self->view.format);
+ __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
+ if (__pyx_t_11) {
+
+ /* "View.MemoryView":448
+ * else:
+ * if len(self.view.format) == 1:
+ * return result[0] # <<<<<<<<<<<<<<
+ * return result
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;};
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L6_except_return;
+ }
+
+ /* "View.MemoryView":449
+ * if len(self.view.format) == 1:
+ * return result[0]
+ * return result # <<<<<<<<<<<<<<
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_result);
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L6_except_return;
+ }
+ __pyx_L3_error:;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "View.MemoryView":444
+ * try:
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error: # <<<<<<<<<<<<<<
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_12 = PyErr_ExceptionMatches(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__pyx_t_12) {
+ __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_9);
+
+ /* "View.MemoryView":445
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
+ * else:
+ * if len(self.view.format) == 1:
+ */
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L1_error;
+ __pyx_L6_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":435
+ * self.assign_item_from_object(itemp, value)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_struct);
+ __Pyx_XDECREF(__pyx_v_bytesitem);
+ __Pyx_XDECREF(__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":451
+ * return result
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
+ PyObject *__pyx_v_struct = NULL;
+ char __pyx_v_c;
+ PyObject *__pyx_v_bytesvalue = 0;
+ Py_ssize_t __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ Py_ssize_t __pyx_t_7;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ char *__pyx_t_10;
+ char *__pyx_t_11;
+ char *__pyx_t_12;
+ char *__pyx_t_13;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("assign_item_from_object", 0);
+
+ /* "View.MemoryView":454
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ * import struct # <<<<<<<<<<<<<<
+ * cdef char c
+ * cdef bytes bytesvalue
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_struct = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":459
+ * cdef Py_ssize_t i
+ *
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ */
+ __pyx_t_2 = PyTuple_Check(__pyx_v_value);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "View.MemoryView":460
+ *
+ * if isinstance(value, tuple):
+ * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
+ * else:
+ * bytesvalue = struct.pack(self.view.format, value)
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __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_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
+ __pyx_t_4 = 0;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":462
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
+ *
+ * for i, c in enumerate(bytesvalue):
+ */
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = NULL;
+ __pyx_t_7 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ __pyx_t_7 = 1;
+ }
+ }
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ if (__pyx_t_5) {
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ }
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __pyx_t_1 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
+ __pyx_t_4 = 0;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":464
+ * bytesvalue = struct.pack(self.view.format, value)
+ *
+ * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
+ * itemp[i] = c
+ *
+ */
+ __pyx_t_7 = 0;
+ if (unlikely(__pyx_v_bytesvalue == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_INCREF(__pyx_v_bytesvalue);
+ __pyx_t_9 = __pyx_v_bytesvalue;
+ __pyx_t_11 = PyBytes_AS_STRING(__pyx_t_9);
+ __pyx_t_12 = (__pyx_t_11 + PyBytes_GET_SIZE(__pyx_t_9));
+ for (__pyx_t_13 = __pyx_t_11; __pyx_t_13 < __pyx_t_12; __pyx_t_13++) {
+ __pyx_t_10 = __pyx_t_13;
+ __pyx_v_c = (__pyx_t_10[0]);
+
+ /* "View.MemoryView":465
+ *
+ * for i, c in enumerate(bytesvalue):
+ * itemp[i] = c # <<<<<<<<<<<<<<
+ *
+ * @cname('getbuffer')
+ */
+ __pyx_v_i = __pyx_t_7;
+
+ /* "View.MemoryView":464
+ * bytesvalue = struct.pack(self.view.format, value)
+ *
+ * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
+ * itemp[i] = c
+ *
+ */
+ __pyx_t_7 = (__pyx_t_7 + 1);
+
+ /* "View.MemoryView":465
+ *
+ * for i, c in enumerate(bytesvalue):
+ * itemp[i] = c # <<<<<<<<<<<<<<
+ *
+ * @cname('getbuffer')
+ */
+ (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
+ }
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+ /* "View.MemoryView":451
+ * return result
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_struct);
+ __Pyx_XDECREF(__pyx_v_bytesvalue);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":468
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * if flags & PyBUF_STRIDES:
+ * info.shape = self.view.shape
+ */
+
+/* Python wrapper */
+static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ char *__pyx_t_3;
+ void *__pyx_t_4;
+ int __pyx_t_5;
+ Py_ssize_t __pyx_t_6;
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ if (__pyx_v_info != NULL) {
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_info->obj);
+ }
+
+ /* "View.MemoryView":469
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.shape = self.view.shape
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":470
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_STRIDES:
+ * info.shape = self.view.shape # <<<<<<<<<<<<<<
+ * else:
+ * info.shape = NULL
+ */
+ __pyx_t_2 = __pyx_v_self->view.shape;
+ __pyx_v_info->shape = __pyx_t_2;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":472
+ * info.shape = self.view.shape
+ * else:
+ * info.shape = NULL # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_STRIDES:
+ */
+ __pyx_v_info->shape = NULL;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":474
+ * info.shape = NULL
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.strides = self.view.strides
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":475
+ *
+ * if flags & PyBUF_STRIDES:
+ * info.strides = self.view.strides # <<<<<<<<<<<<<<
+ * else:
+ * info.strides = NULL
+ */
+ __pyx_t_2 = __pyx_v_self->view.strides;
+ __pyx_v_info->strides = __pyx_t_2;
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":477
+ * info.strides = self.view.strides
+ * else:
+ * info.strides = NULL # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_INDIRECT:
+ */
+ __pyx_v_info->strides = NULL;
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":479
+ * info.strides = NULL
+ *
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":480
+ *
+ * if flags & PyBUF_INDIRECT:
+ * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
+ * else:
+ * info.suboffsets = NULL
+ */
+ __pyx_t_2 = __pyx_v_self->view.suboffsets;
+ __pyx_v_info->suboffsets = __pyx_t_2;
+ goto __pyx_L5;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":482
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ * info.suboffsets = NULL # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_FORMAT:
+ */
+ __pyx_v_info->suboffsets = NULL;
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":484
+ * info.suboffsets = NULL
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.view.format
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":485
+ *
+ * if flags & PyBUF_FORMAT:
+ * info.format = self.view.format # <<<<<<<<<<<<<<
+ * else:
+ * info.format = NULL
+ */
+ __pyx_t_3 = __pyx_v_self->view.format;
+ __pyx_v_info->format = __pyx_t_3;
+ goto __pyx_L6;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":487
+ * info.format = self.view.format
+ * else:
+ * info.format = NULL # <<<<<<<<<<<<<<
+ *
+ * info.buf = self.view.buf
+ */
+ __pyx_v_info->format = NULL;
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":489
+ * info.format = NULL
+ *
+ * info.buf = self.view.buf # <<<<<<<<<<<<<<
+ * info.ndim = self.view.ndim
+ * info.itemsize = self.view.itemsize
+ */
+ __pyx_t_4 = __pyx_v_self->view.buf;
+ __pyx_v_info->buf = __pyx_t_4;
+
+ /* "View.MemoryView":490
+ *
+ * info.buf = self.view.buf
+ * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
+ * info.itemsize = self.view.itemsize
+ * info.len = self.view.len
+ */
+ __pyx_t_5 = __pyx_v_self->view.ndim;
+ __pyx_v_info->ndim = __pyx_t_5;
+
+ /* "View.MemoryView":491
+ * info.buf = self.view.buf
+ * info.ndim = self.view.ndim
+ * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
+ * info.len = self.view.len
+ * info.readonly = 0
+ */
+ __pyx_t_6 = __pyx_v_self->view.itemsize;
+ __pyx_v_info->itemsize = __pyx_t_6;
+
+ /* "View.MemoryView":492
+ * info.ndim = self.view.ndim
+ * info.itemsize = self.view.itemsize
+ * info.len = self.view.len # <<<<<<<<<<<<<<
+ * info.readonly = 0
+ * info.obj = self
+ */
+ __pyx_t_6 = __pyx_v_self->view.len;
+ __pyx_v_info->len = __pyx_t_6;
+
+ /* "View.MemoryView":493
+ * info.itemsize = self.view.itemsize
+ * info.len = self.view.len
+ * info.readonly = 0 # <<<<<<<<<<<<<<
+ * info.obj = self
+ *
+ */
+ __pyx_v_info->readonly = 0;
+
+ /* "View.MemoryView":494
+ * info.len = self.view.len
+ * info.readonly = 0
+ * info.obj = self # <<<<<<<<<<<<<<
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
+
+ /* "View.MemoryView":468
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * if flags & PyBUF_STRIDES:
+ * info.shape = self.view.shape
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
+ __Pyx_GOTREF(Py_None);
+ __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
+ }
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":501
+ * property T:
+ * @cname('__pyx_memoryview_transpose')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":502
+ * @cname('__pyx_memoryview_transpose')
+ * def __get__(self):
+ * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
+ * transpose_memslice(&result.from_slice)
+ * return result
+ */
+ __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":503
+ * def __get__(self):
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
+ * return result
+ *
+ */
+ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":504
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ * return result # <<<<<<<<<<<<<<
+ *
+ * property base:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = ((PyObject *)__pyx_v_result);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":501
+ * property T:
+ * @cname('__pyx_memoryview_transpose')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":508
+ * property base:
+ * @cname('__pyx_memoryview__get__base')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.obj
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":509
+ * @cname('__pyx_memoryview__get__base')
+ * def __get__(self):
+ * return self.obj # <<<<<<<<<<<<<<
+ *
+ * property shape:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->obj);
+ __pyx_r = __pyx_v_self->obj;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":508
+ * property base:
+ * @cname('__pyx_memoryview__get__base')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.obj
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":513
+ * property shape:
+ * @cname('__pyx_memoryview_get_shape')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)])
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":514
+ * @cname('__pyx_memoryview_get_shape')
+ * def __get__(self):
+ * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ *
+ * property strides:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __pyx_v_self->view.ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+ __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_self->view.shape[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
+ __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":513
+ * property shape:
+ * @cname('__pyx_memoryview_get_shape')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)])
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":518
+ * property strides:
+ * @cname('__pyx_memoryview_get_strides')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":519
+ * @cname('__pyx_memoryview_get_strides')
+ * def __get__(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ *
+ * raise ValueError("Buffer view does not expose strides")
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":521
+ * if self.view.strides == NULL:
+ *
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ *
+ * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ */
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __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[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":523
+ * raise ValueError("Buffer view does not expose strides")
+ *
+ * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ *
+ * property suboffsets:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __pyx_v_self->view.ndim;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+ __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.strides[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":518
+ * property strides:
+ * @cname('__pyx_memoryview_get_strides')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":527
+ * property suboffsets:
+ * @cname('__pyx_memoryview_get_suboffsets')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self.view.suboffsets == NULL:
+ * return [-1] * self.view.ndim
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":528
+ * @cname('__pyx_memoryview_get_suboffsets')
+ * def __get__(self):
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
+ * return [-1] * self.view.ndim
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":529
+ * def __get__(self):
+ * if self.view.suboffsets == NULL:
+ * return [-1] * self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyList_New(1 * ((__pyx_v_self->view.ndim<0) ? 0:__pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ { Py_ssize_t __pyx_temp;
+ for (__pyx_temp=0; __pyx_temp < __pyx_v_self->view.ndim; __pyx_temp++) {
+ __Pyx_INCREF(__pyx_int_neg_1);
+ PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_int_neg_1);
+ }
+ }
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":531
+ * return [-1] * self.view.ndim
+ *
+ * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ *
+ * property ndim:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __pyx_v_self->view.ndim;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+ __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.suboffsets[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":527
+ * property suboffsets:
+ * @cname('__pyx_memoryview_get_suboffsets')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self.view.suboffsets == NULL:
+ * return [-1] * self.view.ndim
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":535
+ * property ndim:
+ * @cname('__pyx_memoryview_get_ndim')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":536
+ * @cname('__pyx_memoryview_get_ndim')
+ * def __get__(self):
+ * return self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * property itemsize:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":535
+ * property ndim:
+ * @cname('__pyx_memoryview_get_ndim')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":540
+ * property itemsize:
+ * @cname('__pyx_memoryview_get_itemsize')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":541
+ * @cname('__pyx_memoryview_get_itemsize')
+ * def __get__(self):
+ * return self.view.itemsize # <<<<<<<<<<<<<<
+ *
+ * property nbytes:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":540
+ * property itemsize:
+ * @cname('__pyx_memoryview_get_itemsize')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":545
+ * property nbytes:
+ * @cname('__pyx_memoryview_get_nbytes')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":546
+ * @cname('__pyx_memoryview_get_nbytes')
+ * def __get__(self):
+ * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
+ *
+ * property size:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":545
+ * property nbytes:
+ * @cname('__pyx_memoryview_get_nbytes')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":550
+ * property size:
+ * @cname('__pyx_memoryview_get_size')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self._size is None:
+ * result = 1
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_v_result = NULL;
+ PyObject *__pyx_v_length = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ Py_ssize_t __pyx_t_5;
+ PyObject *(*__pyx_t_6)(PyObject *);
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":551
+ * @cname('__pyx_memoryview_get_size')
+ * def __get__(self):
+ * if self._size is None: # <<<<<<<<<<<<<<
+ * result = 1
+ *
+ */
+ __pyx_t_1 = (__pyx_v_self->_size == Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":552
+ * def __get__(self):
+ * if self._size is None:
+ * result = 1 # <<<<<<<<<<<<<<
+ *
+ * for length in self.shape:
+ */
+ __Pyx_INCREF(__pyx_int_1);
+ __pyx_v_result = __pyx_int_1;
+
+ /* "View.MemoryView":554
+ * result = 1
+ *
+ * for length in self.shape: # <<<<<<<<<<<<<<
+ * result *= length
+ *
+ */
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
+ __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
+ __pyx_t_6 = NULL;
+ } else {
+ __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ for (;;) {
+ if (likely(!__pyx_t_6)) {
+ if (likely(PyList_CheckExact(__pyx_t_4))) {
+ if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else {
+ if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ }
+ } else {
+ __pyx_t_3 = __pyx_t_6(__pyx_t_4);
+ if (unlikely(!__pyx_t_3)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_3);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":555
+ *
+ * for length in self.shape:
+ * result *= length # <<<<<<<<<<<<<<
+ *
+ * self._size = result
+ */
+ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":554
+ * result = 1
+ *
+ * for length in self.shape: # <<<<<<<<<<<<<<
+ * result *= length
+ *
+ */
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "View.MemoryView":557
+ * result *= length
+ *
+ * self._size = result # <<<<<<<<<<<<<<
+ *
+ * return self._size
+ */
+ __Pyx_INCREF(__pyx_v_result);
+ __Pyx_GIVEREF(__pyx_v_result);
+ __Pyx_GOTREF(__pyx_v_self->_size);
+ __Pyx_DECREF(__pyx_v_self->_size);
+ __pyx_v_self->_size = __pyx_v_result;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":559
+ * self._size = result
+ *
+ * return self._size # <<<<<<<<<<<<<<
+ *
+ * def __len__(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->_size);
+ __pyx_r = __pyx_v_self->_size;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":550
+ * property size:
+ * @cname('__pyx_memoryview_get_size')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self._size is None:
+ * result = 1
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_length);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":561
+ * return self._size
+ *
+ * def __len__(self): # <<<<<<<<<<<<<<
+ * if self.view.ndim >= 1:
+ * return self.view.shape[0]
+ */
+
+/* Python wrapper */
+static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
+static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("__len__", 0);
+
+ /* "View.MemoryView":562
+ *
+ * def __len__(self):
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
+ * return self.view.shape[0]
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":563
+ * def __len__(self):
+ * if self.view.ndim >= 1:
+ * return self.view.shape[0] # <<<<<<<<<<<<<<
+ *
+ * return 0
+ */
+ __pyx_r = (__pyx_v_self->view.shape[0]);
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":565
+ * return self.view.shape[0]
+ *
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ * def __repr__(self):
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":561
+ * return self._size
+ *
+ * def __len__(self): # <<<<<<<<<<<<<<
+ * if self.view.ndim >= 1:
+ * return self.view.shape[0]
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":567
+ * return 0
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
+ * id(self))
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__repr__", 0);
+
+ /* "View.MemoryView":568
+ *
+ * def __repr__(self):
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
+ * id(self))
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":569
+ * def __repr__(self):
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
+ * id(self)) # <<<<<<<<<<<<<<
+ *
+ * def __str__(self):
+ */
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":568
+ *
+ * def __repr__(self):
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
+ * id(self))
+ *
+ */
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_1 = 0;
+ __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":567
+ * return 0
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
+ * id(self))
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":571
+ * id(self))
+ *
+ * def __str__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__str__", 0);
+
+ /* "View.MemoryView":572
+ *
+ * def __str__(self):
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":571
+ * id(self))
+ *
+ * def __str__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":575
+ *
+ *
+ * def is_c_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice *__pyx_v_mslice;
+ __Pyx_memviewslice __pyx_v_tmp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("is_c_contig", 0);
+
+ /* "View.MemoryView":578
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice, 'C', self.view.ndim)
+ *
+ */
+ __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
+
+ /* "View.MemoryView":579
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp)
+ * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * def is_f_contig(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":575
+ *
+ *
+ * def is_c_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":581
+ * return slice_is_contig(mslice, 'C', self.view.ndim)
+ *
+ * def is_f_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice *__pyx_v_mslice;
+ __Pyx_memviewslice __pyx_v_tmp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("is_f_contig", 0);
+
+ /* "View.MemoryView":584
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice, 'F', self.view.ndim)
+ *
+ */
+ __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
+
+ /* "View.MemoryView":585
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp)
+ * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * def copy(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":581
+ * return slice_is_contig(mslice, 'C', self.view.ndim)
+ *
+ * def is_f_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":587
+ * return slice_is_contig(mslice, 'F', self.view.ndim)
+ *
+ * def copy(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice mslice
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("copy (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice __pyx_v_mslice;
+ int __pyx_v_flags;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_memviewslice __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("copy", 0);
+
+ /* "View.MemoryView":589
+ * def copy(self):
+ * cdef __Pyx_memviewslice mslice
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
+ *
+ * slice_copy(self, &mslice)
+ */
+ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
+
+ /* "View.MemoryView":591
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
+ *
+ * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
+ * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
+ * self.view.itemsize,
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
+
+ /* "View.MemoryView":592
+ *
+ * slice_copy(self, &mslice)
+ * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
+ * self.view.itemsize,
+ * flags|PyBUF_C_CONTIGUOUS,
+ */
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), __pyx_k_c, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_mslice = __pyx_t_1;
+
+ /* "View.MemoryView":597
+ * self.dtype_is_object)
+ *
+ * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
+ *
+ * def copy_fortran(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":587
+ * return slice_is_contig(mslice, 'F', self.view.ndim)
+ *
+ * def copy(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice mslice
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":599
+ * return memoryview_copy_from_slice(self, &mslice)
+ *
+ * def copy_fortran(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice src, dst
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice __pyx_v_src;
+ __Pyx_memviewslice __pyx_v_dst;
+ int __pyx_v_flags;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_memviewslice __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("copy_fortran", 0);
+
+ /* "View.MemoryView":601
+ * def copy_fortran(self):
+ * cdef __Pyx_memviewslice src, dst
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
+ *
+ * slice_copy(self, &src)
+ */
+ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
+
+ /* "View.MemoryView":603
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
+ *
+ * slice_copy(self, &src) # <<<<<<<<<<<<<<
+ * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
+ * self.view.itemsize,
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
+
+ /* "View.MemoryView":604
+ *
+ * slice_copy(self, &src)
+ * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
+ * self.view.itemsize,
+ * flags|PyBUF_F_CONTIGUOUS,
+ */
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), __pyx_k_fortran, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_dst = __pyx_t_1;
+
+ /* "View.MemoryView":609
+ * self.dtype_is_object)
+ *
+ * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":599
+ * return memoryview_copy_from_slice(self, &mslice)
+ *
+ * def copy_fortran(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice src, dst
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":613
+ *
+ * @cname('__pyx_memoryview_new')
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo
+ */
+
+static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
+ struct __pyx_memoryview_obj *__pyx_v_result = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
+
+ /* "View.MemoryView":614
+ * @cname('__pyx_memoryview_new')
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
+ * result.typeinfo = typeinfo
+ * return result
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_o);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
+ __Pyx_GIVEREF(__pyx_v_o);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":615
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
+ * return result
+ *
+ */
+ __pyx_v_result->typeinfo = __pyx_v_typeinfo;
+
+ /* "View.MemoryView":616
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo
+ * return result # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_check')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = ((PyObject *)__pyx_v_result);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":613
+ *
+ * @cname('__pyx_memoryview_new')
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":619
+ *
+ * @cname('__pyx_memoryview_check')
+ * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
+ * return isinstance(o, memoryview)
+ *
+ */
+
+static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("memoryview_check", 0);
+
+ /* "View.MemoryView":620
+ * @cname('__pyx_memoryview_check')
+ * cdef inline bint memoryview_check(object o):
+ * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
+ *
+ * cdef tuple _unellipsify(object index, int ndim):
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, ((PyObject *)__pyx_memoryview_type));
+ __pyx_r = __pyx_t_1;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":619
+ *
+ * @cname('__pyx_memoryview_check')
+ * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
+ * return isinstance(o, memoryview)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":622
+ * return isinstance(o, memoryview)
+ *
+ * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
+ * """
+ * Replace all ellipses with full slices and fill incomplete indices with
+ */
+
+static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
+ PyObject *__pyx_v_tup = NULL;
+ PyObject *__pyx_v_result = NULL;
+ int __pyx_v_have_slices;
+ int __pyx_v_seen_ellipsis;
+ CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
+ PyObject *__pyx_v_item = NULL;
+ Py_ssize_t __pyx_v_nslices;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ Py_ssize_t __pyx_t_5;
+ PyObject *(*__pyx_t_6)(PyObject *);
+ PyObject *__pyx_t_7 = NULL;
+ Py_ssize_t __pyx_t_8;
+ int __pyx_t_9;
+ int __pyx_t_10;
+ PyObject *__pyx_t_11 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_unellipsify", 0);
+
+ /* "View.MemoryView":627
+ * full slices.
+ * """
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
+ * tup = (index,)
+ * else:
+ */
+ __pyx_t_1 = PyTuple_Check(__pyx_v_index);
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":628
+ * """
+ * if not isinstance(index, tuple):
+ * tup = (index,) # <<<<<<<<<<<<<<
+ * else:
+ * tup = index
+ */
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_index);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
+ __Pyx_GIVEREF(__pyx_v_index);
+ __pyx_v_tup = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":630
+ * tup = (index,)
+ * else:
+ * tup = index # <<<<<<<<<<<<<<
+ *
+ * result = []
+ */
+ __Pyx_INCREF(__pyx_v_index);
+ __pyx_v_tup = __pyx_v_index;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":632
+ * tup = index
+ *
+ * result = [] # <<<<<<<<<<<<<<
+ * have_slices = False
+ * seen_ellipsis = False
+ */
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_v_result = ((PyObject*)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":633
+ *
+ * result = []
+ * have_slices = False # <<<<<<<<<<<<<<
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup):
+ */
+ __pyx_v_have_slices = 0;
+
+ /* "View.MemoryView":634
+ * result = []
+ * have_slices = False
+ * seen_ellipsis = False # <<<<<<<<<<<<<<
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis:
+ */
+ __pyx_v_seen_ellipsis = 0;
+
+ /* "View.MemoryView":635
+ * have_slices = False
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ */
+ __Pyx_INCREF(__pyx_int_0);
+ __pyx_t_3 = __pyx_int_0;
+ if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
+ __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
+ __pyx_t_6 = NULL;
+ } else {
+ __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ for (;;) {
+ if (likely(!__pyx_t_6)) {
+ if (likely(PyList_CheckExact(__pyx_t_4))) {
+ if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else {
+ if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ }
+ } else {
+ __pyx_t_7 = __pyx_t_6(__pyx_t_4);
+ if (unlikely(!__pyx_t_7)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_7);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
+ __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3);
+ __pyx_t_3 = __pyx_t_7;
+ __pyx_t_7 = 0;
+
+ /* "View.MemoryView":636
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis: # <<<<<<<<<<<<<<
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ */
+ __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":637
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis:
+ * if not seen_ellipsis: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ * seen_ellipsis = True
+ */
+ __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":638
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
+ * seen_ellipsis = True
+ * else:
+ */
+ __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ { Py_ssize_t __pyx_temp;
+ for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
+ __Pyx_INCREF(__pyx_slice__14);
+ PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__14);
+ __Pyx_GIVEREF(__pyx_slice__14);
+ }
+ }
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "View.MemoryView":639
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ * seen_ellipsis = True # <<<<<<<<<<<<<<
+ * else:
+ * result.append(slice(None))
+ */
+ __pyx_v_seen_ellipsis = 1;
+ goto __pyx_L7;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":641
+ * seen_ellipsis = True
+ * else:
+ * result.append(slice(None)) # <<<<<<<<<<<<<<
+ * have_slices = True
+ * else:
+ */
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__15); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L7:;
+
+ /* "View.MemoryView":642
+ * else:
+ * result.append(slice(None))
+ * have_slices = True # <<<<<<<<<<<<<<
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item):
+ */
+ __pyx_v_have_slices = 1;
+ goto __pyx_L6;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":644
+ * have_slices = True
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ */
+ __pyx_t_2 = PySlice_Check(__pyx_v_item);
+ __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
+ if (__pyx_t_10) {
+ } else {
+ __pyx_t_1 = __pyx_t_10;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
+ __pyx_t_1 = __pyx_t_10;
+ __pyx_L9_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":645
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item):
+ * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
+ *
+ * have_slices = have_slices or isinstance(item, slice)
+ */
+ __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_Raise(__pyx_t_7, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":647
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
+ * result.append(item)
+ *
+ */
+ __pyx_t_10 = (__pyx_v_have_slices != 0);
+ if (!__pyx_t_10) {
+ } else {
+ __pyx_t_1 = __pyx_t_10;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_10 = PySlice_Check(__pyx_v_item);
+ __pyx_t_2 = (__pyx_t_10 != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L11_bool_binop_done:;
+ __pyx_v_have_slices = __pyx_t_1;
+
+ /* "View.MemoryView":648
+ *
+ * have_slices = have_slices or isinstance(item, slice)
+ * result.append(item) # <<<<<<<<<<<<<<
+ *
+ * nslices = ndim - len(result)
+ */
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":635
+ * have_slices = False
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ */
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "View.MemoryView":650
+ * result.append(item)
+ *
+ * nslices = ndim - len(result) # <<<<<<<<<<<<<<
+ * if nslices:
+ * result.extend([slice(None)] * nslices)
+ */
+ __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
+
+ /* "View.MemoryView":651
+ *
+ * nslices = ndim - len(result)
+ * if nslices: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * nslices)
+ *
+ */
+ __pyx_t_1 = (__pyx_v_nslices != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":652
+ * nslices = ndim - len(result)
+ * if nslices:
+ * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
+ *
+ * return have_slices or nslices, tuple(result)
+ */
+ __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ { Py_ssize_t __pyx_temp;
+ for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
+ __Pyx_INCREF(__pyx_slice__16);
+ PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__16);
+ __Pyx_GIVEREF(__pyx_slice__16);
+ }
+ }
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L13;
+ }
+ __pyx_L13:;
+
+ /* "View.MemoryView":654
+ * result.extend([slice(None)] * nslices)
+ *
+ * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
+ *
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ if (!__pyx_v_have_slices) {
+ } else {
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L14_bool_binop_done;
+ }
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __pyx_t_4;
+ __pyx_t_4 = 0;
+ __pyx_L14_bool_binop_done:;
+ __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_3 = 0;
+ __pyx_t_4 = 0;
+ __pyx_r = ((PyObject*)__pyx_t_7);
+ __pyx_t_7 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":622
+ * return isinstance(o, memoryview)
+ *
+ * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
+ * """
+ * Replace all ellipses with full slices and fill incomplete indices with
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_11);
+ __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_tup);
+ __Pyx_XDECREF(__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_idx);
+ __Pyx_XDECREF(__pyx_v_item);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":656
+ * return have_slices or nslices, tuple(result)
+ *
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
+ * cdef int i
+ * for i in range(ndim):
+ */
+
+static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
+ int __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
+
+ /* "View.MemoryView":658
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * cdef int i
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if suboffsets[i] >= 0:
+ * raise ValueError("Indirect dimensions not supported")
+ */
+ __pyx_t_1 = __pyx_v_ndim;
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "View.MemoryView":659
+ * cdef int i
+ * for i in range(ndim):
+ * if suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Indirect dimensions not supported")
+ *
+ */
+ __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0);
+ if (__pyx_t_3) {
+
+ /* "View.MemoryView":660
+ * for i in range(ndim):
+ * if suboffsets[i] >= 0:
+ * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 660; __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[2]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+
+ /* "View.MemoryView":656
+ * return have_slices or nslices, tuple(result)
+ *
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
+ * cdef int i
+ * for i in range(ndim):
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":667
+ *
+ * @cname('__pyx_memview_slice')
+ * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim
+ * cdef bint negative_step
+ */
+
+static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
+ int __pyx_v_new_ndim;
+ int __pyx_v_suboffset_dim;
+ int __pyx_v_dim;
+ __Pyx_memviewslice __pyx_v_src;
+ __Pyx_memviewslice __pyx_v_dst;
+ __Pyx_memviewslice *__pyx_v_p_src;
+ struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
+ __Pyx_memviewslice *__pyx_v_p_dst;
+ int *__pyx_v_p_suboffset_dim;
+ Py_ssize_t __pyx_v_start;
+ Py_ssize_t __pyx_v_stop;
+ Py_ssize_t __pyx_v_step;
+ int __pyx_v_have_start;
+ int __pyx_v_have_stop;
+ int __pyx_v_have_step;
+ PyObject *__pyx_v_index = NULL;
+ struct __pyx_memoryview_obj *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ struct __pyx_memoryview_obj *__pyx_t_4;
+ char *__pyx_t_5;
+ int __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ PyObject *(*__pyx_t_8)(PyObject *);
+ PyObject *__pyx_t_9 = NULL;
+ Py_ssize_t __pyx_t_10;
+ int __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("memview_slice", 0);
+
+ /* "View.MemoryView":668
+ * @cname('__pyx_memview_slice')
+ * cdef memoryview memview_slice(memoryview memview, object indices):
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
+ * cdef bint negative_step
+ * cdef __Pyx_memviewslice src, dst
+ */
+ __pyx_v_new_ndim = 0;
+ __pyx_v_suboffset_dim = -1;
+
+ /* "View.MemoryView":675
+ *
+ *
+ * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
+ *
+ * cdef _memoryviewslice memviewsliceobj
+ */
+ memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));
+
+ /* "View.MemoryView":679
+ * cdef _memoryviewslice memviewsliceobj
+ *
+ * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
+ *
+ * if isinstance(memview, _memoryviewslice):
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
+ PyErr_SetNone(PyExc_AssertionError);
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+
+ /* "View.MemoryView":681
+ * assert memview.view.ndim > 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":682
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * memviewsliceobj = memview # <<<<<<<<<<<<<<
+ * p_src = &memviewsliceobj.from_slice
+ * else:
+ */
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)__pyx_v_memview);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":683
+ * if isinstance(memview, _memoryviewslice):
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
+ * else:
+ * slice_copy(memview, &src)
+ */
+ __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":685
+ * p_src = &memviewsliceobj.from_slice
+ * else:
+ * slice_copy(memview, &src) # <<<<<<<<<<<<<<
+ * p_src = &src
+ *
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
+
+ /* "View.MemoryView":686
+ * else:
+ * slice_copy(memview, &src)
+ * p_src = &src # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_p_src = (&__pyx_v_src);
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":692
+ *
+ *
+ * dst.memview = p_src.memview # <<<<<<<<<<<<<<
+ * dst.data = p_src.data
+ *
+ */
+ __pyx_t_4 = __pyx_v_p_src->memview;
+ __pyx_v_dst.memview = __pyx_t_4;
+
+ /* "View.MemoryView":693
+ *
+ * dst.memview = p_src.memview
+ * dst.data = p_src.data # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __pyx_v_p_src->data;
+ __pyx_v_dst.data = __pyx_t_5;
+
+ /* "View.MemoryView":698
+ *
+ *
+ * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
+ * cdef int *p_suboffset_dim = &suboffset_dim
+ * cdef Py_ssize_t start, stop, step
+ */
+ __pyx_v_p_dst = (&__pyx_v_dst);
+
+ /* "View.MemoryView":699
+ *
+ * cdef __Pyx_memviewslice *p_dst = &dst
+ * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t start, stop, step
+ * cdef bint have_start, have_stop, have_step
+ */
+ __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
+
+ /* "View.MemoryView":703
+ * cdef bint have_start, have_stop, have_step
+ *
+ * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
+ * if PyIndex_Check(index):
+ * slice_memviewslice(
+ */
+ __pyx_t_6 = 0;
+ if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
+ __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
+ __pyx_t_8 = NULL;
+ } else {
+ __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ for (;;) {
+ if (likely(!__pyx_t_8)) {
+ if (likely(PyList_CheckExact(__pyx_t_3))) {
+ if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else {
+ if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ }
+ } else {
+ __pyx_t_9 = __pyx_t_8(__pyx_t_3);
+ if (unlikely(!__pyx_t_9)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_9);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_v_dim = __pyx_t_6;
+ __pyx_t_6 = (__pyx_t_6 + 1);
+
+ /* "View.MemoryView":704
+ *
+ * for dim, index in enumerate(indices):
+ * if PyIndex_Check(index): # <<<<<<<<<<<<<<
+ * slice_memviewslice(
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ */
+ __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":708
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ * dim, new_ndim, p_suboffset_dim,
+ * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ */
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":705
+ * for dim, index in enumerate(indices):
+ * if PyIndex_Check(index):
+ * slice_memviewslice( # <<<<<<<<<<<<<<
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ * dim, new_ndim, p_suboffset_dim,
+ */
+ __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L6;
+ }
+
+ /* "View.MemoryView":711
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ * elif index is None: # <<<<<<<<<<<<<<
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ */
+ __pyx_t_2 = (__pyx_v_index == Py_None);
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":712
+ * False)
+ * elif index is None:
+ * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
+ * p_dst.strides[new_ndim] = 0
+ * p_dst.suboffsets[new_ndim] = -1
+ */
+ (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
+
+ /* "View.MemoryView":713
+ * elif index is None:
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
+ * p_dst.suboffsets[new_ndim] = -1
+ * new_ndim += 1
+ */
+ (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
+
+ /* "View.MemoryView":714
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
+ * new_ndim += 1
+ * else:
+ */
+ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1;
+
+ /* "View.MemoryView":715
+ * p_dst.strides[new_ndim] = 0
+ * p_dst.suboffsets[new_ndim] = -1
+ * new_ndim += 1 # <<<<<<<<<<<<<<
+ * else:
+ * start = index.start or 0
+ */
+ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+ goto __pyx_L6;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":717
+ * new_ndim += 1
+ * else:
+ * start = index.start or 0 # <<<<<<<<<<<<<<
+ * stop = index.stop or 0
+ * step = index.step or 0
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_1) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else {
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __pyx_t_12;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_t_10 = 0;
+ __pyx_L7_bool_binop_done:;
+ __pyx_v_start = __pyx_t_10;
+
+ /* "View.MemoryView":718
+ * else:
+ * start = index.start or 0
+ * stop = index.stop or 0 # <<<<<<<<<<<<<<
+ * step = index.step or 0
+ *
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_1) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else {
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __pyx_t_12;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_10 = 0;
+ __pyx_L9_bool_binop_done:;
+ __pyx_v_stop = __pyx_t_10;
+
+ /* "View.MemoryView":719
+ * start = index.start or 0
+ * stop = index.stop or 0
+ * step = index.step or 0 # <<<<<<<<<<<<<<
+ *
+ * have_start = index.start is not None
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_1) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else {
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __pyx_t_12;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_10 = 0;
+ __pyx_L11_bool_binop_done:;
+ __pyx_v_step = __pyx_t_10;
+
+ /* "View.MemoryView":721
+ * step = index.step or 0
+ *
+ * have_start = index.start is not None # <<<<<<<<<<<<<<
+ * have_stop = index.stop is not None
+ * have_step = index.step is not None
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_have_start = __pyx_t_1;
+
+ /* "View.MemoryView":722
+ *
+ * have_start = index.start is not None
+ * have_stop = index.stop is not None # <<<<<<<<<<<<<<
+ * have_step = index.step is not None
+ *
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_have_stop = __pyx_t_1;
+
+ /* "View.MemoryView":723
+ * have_start = index.start is not None
+ * have_stop = index.stop is not None
+ * have_step = index.step is not None # <<<<<<<<<<<<<<
+ *
+ * slice_memviewslice(
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_have_step = __pyx_t_1;
+
+ /* "View.MemoryView":725
+ * have_step = index.step is not None
+ *
+ * slice_memviewslice( # <<<<<<<<<<<<<<
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ * dim, new_ndim, p_suboffset_dim,
+ */
+ __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":731
+ * have_start, have_stop, have_step,
+ * True)
+ * new_ndim += 1 # <<<<<<<<<<<<<<
+ *
+ * if isinstance(memview, _memoryviewslice):
+ */
+ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":703
+ * cdef bint have_start, have_stop, have_step
+ *
+ * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
+ * if PyIndex_Check(index):
+ * slice_memviewslice(
+ */
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "View.MemoryView":733
+ * new_ndim += 1
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":734
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
+ * memviewsliceobj.to_object_func,
+ * memviewsliceobj.to_dtype_func,
+ */
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+
+ /* "View.MemoryView":735
+ * if isinstance(memview, _memoryviewslice):
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
+ * memviewsliceobj.to_dtype_func,
+ * memview.dtype_is_object)
+ */
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+
+ /* "View.MemoryView":736
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
+ * memview.dtype_is_object)
+ * else:
+ */
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+
+ /* "View.MemoryView":734
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
+ * memviewsliceobj.to_object_func,
+ * memviewsliceobj.to_dtype_func,
+ */
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":739
+ * memview.dtype_is_object)
+ * else:
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
+ * memview.dtype_is_object)
+ *
+ */
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+
+ /* "View.MemoryView":740
+ * else:
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
+ * memview.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+
+ /* "View.MemoryView":739
+ * memview.dtype_is_object)
+ * else:
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
+ * memview.dtype_is_object)
+ *
+ */
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":667
+ *
+ * @cname('__pyx_memview_slice')
+ * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim
+ * cdef bint negative_step
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
+ __Pyx_XDECREF(__pyx_v_index);
+ __Pyx_XGIVEREF((PyObject *)__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":764
+ *
+ * @cname('__pyx_memoryview_slice_memviewslice')
+ * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
+ */
+
+static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
+ Py_ssize_t __pyx_v_new_shape;
+ int __pyx_v_negative_step;
+ int __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+
+ /* "View.MemoryView":784
+ * cdef bint negative_step
+ *
+ * if not is_slice: # <<<<<<<<<<<<<<
+ *
+ * if start < 0:
+ */
+ __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":786
+ * if not is_slice:
+ *
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if not 0 <= start < shape:
+ */
+ __pyx_t_1 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":787
+ *
+ * if start < 0:
+ * start += shape # <<<<<<<<<<<<<<
+ * if not 0 <= start < shape:
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ */
+ __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":788
+ * if start < 0:
+ * start += shape
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ * else:
+ */
+ __pyx_t_1 = (0 <= __pyx_v_start);
+ if (__pyx_t_1) {
+ __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
+ }
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":789
+ * start += shape
+ * if not 0 <= start < shape:
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
+ * else:
+ *
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":792
+ * else:
+ *
+ * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
+ *
+ * if have_step and step == 0:
+ */
+ __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L6_bool_binop_done;
+ }
+ __pyx_t_1 = ((__pyx_v_step < 0) != 0);
+ __pyx_t_2 = __pyx_t_1;
+ __pyx_L6_bool_binop_done:;
+ __pyx_v_negative_step = __pyx_t_2;
+
+ /* "View.MemoryView":794
+ * negative_step = have_step != 0 and step < 0
+ *
+ * if have_step and step == 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
+ *
+ */
+ __pyx_t_1 = (__pyx_v_have_step != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_1 = ((__pyx_v_step == 0) != 0);
+ __pyx_t_2 = __pyx_t_1;
+ __pyx_L9_bool_binop_done:;
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":795
+ *
+ * if have_step and step == 0:
+ * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+
+ /* "View.MemoryView":798
+ *
+ *
+ * if have_start: # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start += shape
+ */
+ __pyx_t_2 = (__pyx_v_have_start != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":799
+ *
+ * if have_start:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if start < 0:
+ */
+ __pyx_t_2 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":800
+ * if have_start:
+ * if start < 0:
+ * start += shape # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start = 0
+ */
+ __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
+
+ /* "View.MemoryView":801
+ * if start < 0:
+ * start += shape
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = 0
+ * elif start >= shape:
+ */
+ __pyx_t_2 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":802
+ * start += shape
+ * if start < 0:
+ * start = 0 # <<<<<<<<<<<<<<
+ * elif start >= shape:
+ * if negative_step:
+ */
+ __pyx_v_start = 0;
+ goto __pyx_L13;
+ }
+ __pyx_L13:;
+ goto __pyx_L12;
+ }
+
+ /* "View.MemoryView":803
+ * if start < 0:
+ * start = 0
+ * elif start >= shape: # <<<<<<<<<<<<<<
+ * if negative_step:
+ * start = shape - 1
+ */
+ __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":804
+ * start = 0
+ * elif start >= shape:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":805
+ * elif start >= shape:
+ * if negative_step:
+ * start = shape - 1 # <<<<<<<<<<<<<<
+ * else:
+ * start = shape
+ */
+ __pyx_v_start = (__pyx_v_shape - 1);
+ goto __pyx_L14;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":807
+ * start = shape - 1
+ * else:
+ * start = shape # <<<<<<<<<<<<<<
+ * else:
+ * if negative_step:
+ */
+ __pyx_v_start = __pyx_v_shape;
+ }
+ __pyx_L14:;
+ goto __pyx_L12;
+ }
+ __pyx_L12:;
+ goto __pyx_L11;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":809
+ * start = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":810
+ * else:
+ * if negative_step:
+ * start = shape - 1 # <<<<<<<<<<<<<<
+ * else:
+ * start = 0
+ */
+ __pyx_v_start = (__pyx_v_shape - 1);
+ goto __pyx_L15;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":812
+ * start = shape - 1
+ * else:
+ * start = 0 # <<<<<<<<<<<<<<
+ *
+ * if have_stop:
+ */
+ __pyx_v_start = 0;
+ }
+ __pyx_L15:;
+ }
+ __pyx_L11:;
+
+ /* "View.MemoryView":814
+ * start = 0
+ *
+ * if have_stop: # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop += shape
+ */
+ __pyx_t_2 = (__pyx_v_have_stop != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":815
+ *
+ * if have_stop:
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop += shape
+ * if stop < 0:
+ */
+ __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":816
+ * if have_stop:
+ * if stop < 0:
+ * stop += shape # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop = 0
+ */
+ __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
+
+ /* "View.MemoryView":817
+ * if stop < 0:
+ * stop += shape
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop = 0
+ * elif stop > shape:
+ */
+ __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":818
+ * stop += shape
+ * if stop < 0:
+ * stop = 0 # <<<<<<<<<<<<<<
+ * elif stop > shape:
+ * stop = shape
+ */
+ __pyx_v_stop = 0;
+ goto __pyx_L18;
+ }
+ __pyx_L18:;
+ goto __pyx_L17;
+ }
+
+ /* "View.MemoryView":819
+ * if stop < 0:
+ * stop = 0
+ * elif stop > shape: # <<<<<<<<<<<<<<
+ * stop = shape
+ * else:
+ */
+ __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":820
+ * stop = 0
+ * elif stop > shape:
+ * stop = shape # <<<<<<<<<<<<<<
+ * else:
+ * if negative_step:
+ */
+ __pyx_v_stop = __pyx_v_shape;
+ goto __pyx_L17;
+ }
+ __pyx_L17:;
+ goto __pyx_L16;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":822
+ * stop = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * stop = -1
+ * else:
+ */
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":823
+ * else:
+ * if negative_step:
+ * stop = -1 # <<<<<<<<<<<<<<
+ * else:
+ * stop = shape
+ */
+ __pyx_v_stop = -1;
+ goto __pyx_L19;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":825
+ * stop = -1
+ * else:
+ * stop = shape # <<<<<<<<<<<<<<
+ *
+ * if not have_step:
+ */
+ __pyx_v_stop = __pyx_v_shape;
+ }
+ __pyx_L19:;
+ }
+ __pyx_L16:;
+
+ /* "View.MemoryView":827
+ * stop = shape
+ *
+ * if not have_step: # <<<<<<<<<<<<<<
+ * step = 1
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":828
+ *
+ * if not have_step:
+ * step = 1 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_step = 1;
+ goto __pyx_L20;
+ }
+ __pyx_L20:;
+
+ /* "View.MemoryView":832
+ *
+ * with cython.cdivision(True):
+ * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
+ *
+ * if (stop - start) - step * new_shape:
+ */
+ __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
+
+ /* "View.MemoryView":834
+ * new_shape = (stop - start) // step
+ *
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
+ * new_shape += 1
+ *
+ */
+ __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":835
+ *
+ * if (stop - start) - step * new_shape:
+ * new_shape += 1 # <<<<<<<<<<<<<<
+ *
+ * if new_shape < 0:
+ */
+ __pyx_v_new_shape = (__pyx_v_new_shape + 1);
+ goto __pyx_L21;
+ }
+ __pyx_L21:;
+
+ /* "View.MemoryView":837
+ * new_shape += 1
+ *
+ * if new_shape < 0: # <<<<<<<<<<<<<<
+ * new_shape = 0
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":838
+ *
+ * if new_shape < 0:
+ * new_shape = 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_new_shape = 0;
+ goto __pyx_L22;
+ }
+ __pyx_L22:;
+
+ /* "View.MemoryView":841
+ *
+ *
+ * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
+ * dst.shape[new_ndim] = new_shape
+ * dst.suboffsets[new_ndim] = suboffset
+ */
+ (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
+
+ /* "View.MemoryView":842
+ *
+ * dst.strides[new_ndim] = stride * step
+ * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
+ * dst.suboffsets[new_ndim] = suboffset
+ *
+ */
+ (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
+
+ /* "View.MemoryView":843
+ * dst.strides[new_ndim] = stride * step
+ * dst.shape[new_ndim] = new_shape
+ * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":846
+ *
+ *
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
+ * dst.data += start * stride
+ * else:
+ */
+ __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":847
+ *
+ * if suboffset_dim[0] < 0:
+ * dst.data += start * stride # <<<<<<<<<<<<<<
+ * else:
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ */
+ __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
+ goto __pyx_L23;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":849
+ * dst.data += start * stride
+ * else:
+ * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
+ *
+ * if suboffset >= 0:
+ */
+ __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
+ (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
+ }
+ __pyx_L23:;
+
+ /* "View.MemoryView":851
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ *
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * if not is_slice:
+ * if new_ndim == 0:
+ */
+ __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":852
+ *
+ * if suboffset >= 0:
+ * if not is_slice: # <<<<<<<<<<<<<<
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ */
+ __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":853
+ * if suboffset >= 0:
+ * if not is_slice:
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ */
+ __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":854
+ * if not is_slice:
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
+ */
+ __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
+ goto __pyx_L26;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":856
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
+ * "must be indexed and not sliced", dim)
+ * else:
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L26:;
+ goto __pyx_L25;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":859
+ * "must be indexed and not sliced", dim)
+ * else:
+ * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
+ *
+ * return 0
+ */
+ (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
+ }
+ __pyx_L25:;
+ goto __pyx_L24;
+ }
+ __pyx_L24:;
+
+ /* "View.MemoryView":861
+ * suboffset_dim[0] = new_ndim
+ *
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":764
+ *
+ * @cname('__pyx_memoryview_slice_memviewslice')
+ * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = -1;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":867
+ *
+ * @cname('__pyx_pybuffer_index')
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1
+ */
+
+static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
+ Py_ssize_t __pyx_v_shape;
+ Py_ssize_t __pyx_v_stride;
+ Py_ssize_t __pyx_v_suboffset;
+ Py_ssize_t __pyx_v_itemsize;
+ char *__pyx_v_resultp;
+ char *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("pybuffer_index", 0);
+
+ /* "View.MemoryView":869
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t itemsize = view.itemsize
+ * cdef char *resultp
+ */
+ __pyx_v_suboffset = -1;
+
+ /* "View.MemoryView":870
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1
+ * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
+ * cdef char *resultp
+ *
+ */
+ __pyx_t_1 = __pyx_v_view->itemsize;
+ __pyx_v_itemsize = __pyx_t_1;
+
+ /* "View.MemoryView":873
+ * cdef char *resultp
+ *
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
+ * shape = view.len / itemsize
+ * stride = itemsize
+ */
+ __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":874
+ *
+ * if view.ndim == 0:
+ * shape = view.len / itemsize # <<<<<<<<<<<<<<
+ * stride = itemsize
+ * else:
+ */
+ if (unlikely(__pyx_v_itemsize == 0)) {
+ #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[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
+
+ /* "View.MemoryView":875
+ * if view.ndim == 0:
+ * shape = view.len / itemsize
+ * stride = itemsize # <<<<<<<<<<<<<<
+ * else:
+ * shape = view.shape[dim]
+ */
+ __pyx_v_stride = __pyx_v_itemsize;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":877
+ * stride = itemsize
+ * else:
+ * shape = view.shape[dim] # <<<<<<<<<<<<<<
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL:
+ */
+ __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
+
+ /* "View.MemoryView":878
+ * else:
+ * shape = view.shape[dim]
+ * stride = view.strides[dim] # <<<<<<<<<<<<<<
+ * if view.suboffsets != NULL:
+ * suboffset = view.suboffsets[dim]
+ */
+ __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
+
+ /* "View.MemoryView":879
+ * shape = view.shape[dim]
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * suboffset = view.suboffsets[dim]
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":880
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL:
+ * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
+ *
+ * if index < 0:
+ */
+ __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":882
+ * suboffset = view.suboffsets[dim]
+ *
+ * if index < 0: # <<<<<<<<<<<<<<
+ * index += view.shape[dim]
+ * if index < 0:
+ */
+ __pyx_t_2 = ((__pyx_v_index < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":883
+ *
+ * if index < 0:
+ * index += view.shape[dim] # <<<<<<<<<<<<<<
+ * if index < 0:
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ */
+ __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
+
+ /* "View.MemoryView":884
+ * if index < 0:
+ * index += view.shape[dim]
+ * if index < 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_index < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":885
+ * index += view.shape[dim]
+ * if index < 0:
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
+ *
+ * if index >= shape:
+ */
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":887
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ * if index >= shape: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":888
+ *
+ * if index >= shape:
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
+ *
+ * resultp = bufp + index * stride
+ */
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 888; __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_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 888; __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[2]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":890
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ * resultp = bufp + index * stride # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * resultp = (<char **> resultp)[0] + suboffset
+ */
+ __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
+
+ /* "View.MemoryView":891
+ *
+ * resultp = bufp + index * stride
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":892
+ * resultp = bufp + index * stride
+ * if suboffset >= 0:
+ * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
+ *
+ * return resultp
+ */
+ __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+
+ /* "View.MemoryView":894
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ * return resultp # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_resultp;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":867
+ *
+ * @cname('__pyx_pybuffer_index')
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":900
+ *
+ * @cname('__pyx_memslice_transpose')
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
+ * cdef int ndim = memslice.memview.view.ndim
+ *
+ */
+
+static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
+ int __pyx_v_ndim;
+ Py_ssize_t *__pyx_v_shape;
+ Py_ssize_t *__pyx_v_strides;
+ int __pyx_v_i;
+ int __pyx_v_j;
+ int __pyx_r;
+ int __pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ long __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ int __pyx_t_8;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+
+ /* "View.MemoryView":901
+ * @cname('__pyx_memslice_transpose')
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
+ * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
+ *
+ * cdef Py_ssize_t *shape = memslice.shape
+ */
+ __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
+ __pyx_v_ndim = __pyx_t_1;
+
+ /* "View.MemoryView":903
+ * cdef int ndim = memslice.memview.view.ndim
+ *
+ * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t *strides = memslice.strides
+ *
+ */
+ __pyx_t_2 = __pyx_v_memslice->shape;
+ __pyx_v_shape = __pyx_t_2;
+
+ /* "View.MemoryView":904
+ *
+ * cdef Py_ssize_t *shape = memslice.shape
+ * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = __pyx_v_memslice->strides;
+ __pyx_v_strides = __pyx_t_2;
+
+ /* "View.MemoryView":908
+ *
+ * cdef int i, j
+ * for i in range(ndim / 2): # <<<<<<<<<<<<<<
+ * j = ndim - 1 - i
+ * strides[i], strides[j] = strides[j], strides[i]
+ */
+ __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
+ for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
+ __pyx_v_i = __pyx_t_1;
+
+ /* "View.MemoryView":909
+ * cdef int i, j
+ * for i in range(ndim / 2):
+ * j = ndim - 1 - i # <<<<<<<<<<<<<<
+ * strides[i], strides[j] = strides[j], strides[i]
+ * shape[i], shape[j] = shape[j], shape[i]
+ */
+ __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
+
+ /* "View.MemoryView":910
+ * for i in range(ndim / 2):
+ * j = ndim - 1 - i
+ * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
+ * shape[i], shape[j] = shape[j], shape[i]
+ *
+ */
+ __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]);
+ __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]);
+ (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
+ (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;
+
+ /* "View.MemoryView":911
+ * j = ndim - 1 - i
+ * strides[i], strides[j] = strides[j], strides[i]
+ * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
+ *
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
+ */
+ __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]);
+ __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]);
+ (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
+ (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;
+
+ /* "View.MemoryView":913
+ * shape[i], shape[j] = shape[j], shape[i]
+ *
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
+ *
+ */
+ __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
+ if (!__pyx_t_7) {
+ } else {
+ __pyx_t_6 = __pyx_t_7;
+ goto __pyx_L6_bool_binop_done;
+ }
+ __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
+ __pyx_t_6 = __pyx_t_7;
+ __pyx_L6_bool_binop_done:;
+ if (__pyx_t_6) {
+
+ /* "View.MemoryView":914
+ *
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
+ *
+ * return 1
+ */
+ __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, __pyx_k_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+
+ /* "View.MemoryView":916
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
+ *
+ * return 1 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = 1;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":900
+ *
+ * @cname('__pyx_memslice_transpose')
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
+ * cdef int ndim = memslice.memview.view.ndim
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = 0;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":933
+ * cdef int (*to_dtype_func)(char *, object) except 0
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ */
+
+/* Python wrapper */
+static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "View.MemoryView":934
+ *
+ * def __dealloc__(self):
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ */
+ __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
+
+ /* "View.MemoryView":933
+ * cdef int (*to_dtype_func)(char *, object) except 0
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":936
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * if self.to_object_func != NULL:
+ * return self.to_object_func(itemp)
+ */
+
+static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("convert_item_to_object", 0);
+
+ /* "View.MemoryView":937
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
+ * return self.to_object_func(itemp)
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":938
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL:
+ * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
+ * else:
+ * return memoryview.convert_item_to_object(self, itemp)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":940
+ * return self.to_object_func(itemp)
+ * else:
+ * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":936
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * if self.to_object_func != NULL:
+ * return self.to_object_func(itemp)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":942
+ * return memoryview.convert_item_to_object(self, itemp)
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * if self.to_dtype_func != NULL:
+ * self.to_dtype_func(itemp, value)
+ */
+
+static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("assign_item_from_object", 0);
+
+ /* "View.MemoryView":943
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
+ * self.to_dtype_func(itemp, value)
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":944
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL:
+ * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
+ * else:
+ * memoryview.assign_item_from_object(self, itemp, value)
+ */
+ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":946
+ * self.to_dtype_func(itemp, value)
+ * else:
+ * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
+ *
+ * property base:
+ */
+ __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":942
+ * return memoryview.convert_item_to_object(self, itemp)
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * if self.to_dtype_func != NULL:
+ * self.to_dtype_func(itemp, value)
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":950
+ * property base:
+ * @cname('__pyx_memoryviewslice__get__base')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.from_object
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":951
+ * @cname('__pyx_memoryviewslice__get__base')
+ * def __get__(self):
+ * return self.from_object # <<<<<<<<<<<<<<
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->from_object);
+ __pyx_r = __pyx_v_self->from_object;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":950
+ * property base:
+ * @cname('__pyx_memoryviewslice__get__base')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.from_object
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":957
+ *
+ * @cname('__pyx_memoryview_fromslice')
+ * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * object (*to_object_func)(char *),
+ */
+
+static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
+ struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
+ int __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_TypeInfo *__pyx_t_4;
+ Py_buffer __pyx_t_5;
+ Py_ssize_t __pyx_t_6;
+ int __pyx_t_7;
+ int __pyx_t_8;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
+
+ /* "View.MemoryView":966
+ * cdef int i
+ *
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
+ __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":967
+ *
+ * if <PyObject *> memviewslice.memview == Py_None:
+ * return None # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(Py_None);
+ __pyx_r = Py_None;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":972
+ *
+ *
+ * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ * result.from_slice = memviewslice
+ */
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_INCREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
+ __Pyx_GIVEREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryviewslice_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":974
+ * result = _memoryviewslice(None, 0, dtype_is_object)
+ *
+ * result.from_slice = memviewslice # <<<<<<<<<<<<<<
+ * __PYX_INC_MEMVIEW(&memviewslice, 1)
+ *
+ */
+ __pyx_v_result->from_slice = __pyx_v_memviewslice;
+
+ /* "View.MemoryView":975
+ *
+ * result.from_slice = memviewslice
+ * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
+ *
+ * result.from_object = (<memoryview> memviewslice.memview).base
+ */
+ __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
+
+ /* "View.MemoryView":977
+ * __PYX_INC_MEMVIEW(&memviewslice, 1)
+ *
+ * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
+ * result.typeinfo = memviewslice.memview.typeinfo
+ *
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_v_result->from_object);
+ __Pyx_DECREF(__pyx_v_result->from_object);
+ __pyx_v_result->from_object = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":978
+ *
+ * result.from_object = (<memoryview> memviewslice.memview).base
+ * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
+ *
+ * result.view = memviewslice.memview.view
+ */
+ __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
+ __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
+
+ /* "View.MemoryView":980
+ * result.typeinfo = memviewslice.memview.typeinfo
+ *
+ * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
+ * result.view.buf = <void *> memviewslice.data
+ * result.view.ndim = ndim
+ */
+ __pyx_t_5 = __pyx_v_memviewslice.memview->view;
+ __pyx_v_result->__pyx_base.view = __pyx_t_5;
+
+ /* "View.MemoryView":981
+ *
+ * result.view = memviewslice.memview.view
+ * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
+ * result.view.ndim = ndim
+ * (<__pyx_buffer *> &result.view).obj = Py_None
+ */
+ __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
+
+ /* "View.MemoryView":982
+ * result.view = memviewslice.memview.view
+ * result.view.buf = <void *> memviewslice.data
+ * result.view.ndim = ndim # <<<<<<<<<<<<<<
+ * (<__pyx_buffer *> &result.view).obj = Py_None
+ * Py_INCREF(Py_None)
+ */
+ __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
+
+ /* "View.MemoryView":983
+ * result.view.buf = <void *> memviewslice.data
+ * result.view.ndim = ndim
+ * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
+ * Py_INCREF(Py_None)
+ *
+ */
+ ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
+
+ /* "View.MemoryView":984
+ * result.view.ndim = ndim
+ * (<__pyx_buffer *> &result.view).obj = Py_None
+ * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
+ *
+ * result.flags = PyBUF_RECORDS
+ */
+ Py_INCREF(Py_None);
+
+ /* "View.MemoryView":986
+ * Py_INCREF(Py_None)
+ *
+ * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
+ *
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape
+ */
+ __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
+
+ /* "View.MemoryView":988
+ * result.flags = PyBUF_RECORDS
+ *
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
+ * result.view.strides = <Py_ssize_t *> result.from_slice.strides
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ */
+ __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
+
+ /* "View.MemoryView":989
+ *
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape
+ * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ *
+ */
+ __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
+
+ /* "View.MemoryView":990
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape
+ * result.view.strides = <Py_ssize_t *> result.from_slice.strides
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
+ *
+ * result.view.len = result.view.itemsize
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+
+ /* "View.MemoryView":992
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ *
+ * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
+ * for i in range(ndim):
+ * result.view.len *= result.view.shape[i]
+ */
+ __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_6;
+
+ /* "View.MemoryView":993
+ *
+ * result.view.len = result.view.itemsize
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * result.view.len *= result.view.shape[i]
+ *
+ */
+ __pyx_t_7 = __pyx_v_ndim;
+ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
+ __pyx_v_i = __pyx_t_8;
+
+ /* "View.MemoryView":994
+ * result.view.len = result.view.itemsize
+ * for i in range(ndim):
+ * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<<
+ *
+ * result.to_object_func = to_object_func
+ */
+ __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * (__pyx_v_result->__pyx_base.view.shape[__pyx_v_i]));
+ }
+
+ /* "View.MemoryView":996
+ * result.view.len *= result.view.shape[i]
+ *
+ * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
+ * result.to_dtype_func = to_dtype_func
+ *
+ */
+ __pyx_v_result->to_object_func = __pyx_v_to_object_func;
+
+ /* "View.MemoryView":997
+ *
+ * result.to_object_func = to_object_func
+ * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
+ *
+ * return result
+ */
+ __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
+
+ /* "View.MemoryView":999
+ * result.to_dtype_func = to_dtype_func
+ *
+ * return result # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_get_slice_from_memoryview')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = ((PyObject *)__pyx_v_result);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":957
+ *
+ * @cname('__pyx_memoryview_fromslice')
+ * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * object (*to_object_func)(char *),
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1002
+ *
+ * @cname('__pyx_memoryview_get_slice_from_memoryview')
+ * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ */
+
+static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
+ struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
+ __Pyx_memviewslice *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
+
+ /* "View.MemoryView":1005
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * obj = memview
+ * return &obj.from_slice
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1006
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice):
+ * obj = memview # <<<<<<<<<<<<<<
+ * return &obj.from_slice
+ * else:
+ */
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)__pyx_v_memview);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":1007
+ * if isinstance(memview, _memoryviewslice):
+ * obj = memview
+ * return &obj.from_slice # <<<<<<<<<<<<<<
+ * else:
+ * slice_copy(memview, mslice)
+ */
+ __pyx_r = (&__pyx_v_obj->from_slice);
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1009
+ * return &obj.from_slice
+ * else:
+ * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
+ * return mslice
+ *
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
+
+ /* "View.MemoryView":1010
+ * else:
+ * slice_copy(memview, mslice)
+ * return mslice # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_slice_copy')
+ */
+ __pyx_r = __pyx_v_mslice;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":1002
+ *
+ * @cname('__pyx_memoryview_get_slice_from_memoryview')
+ * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_obj);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1013
+ *
+ * @cname('__pyx_memoryview_slice_copy')
+ * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
+ * cdef int dim
+ * cdef (Py_ssize_t*) shape, strides, suboffsets
+ */
+
+static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
+ int __pyx_v_dim;
+ Py_ssize_t *__pyx_v_shape;
+ Py_ssize_t *__pyx_v_strides;
+ Py_ssize_t *__pyx_v_suboffsets;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t *__pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ __Pyx_RefNannySetupContext("slice_copy", 0);
+
+ /* "View.MemoryView":1017
+ * cdef (Py_ssize_t*) shape, strides, suboffsets
+ *
+ * shape = memview.view.shape # <<<<<<<<<<<<<<
+ * strides = memview.view.strides
+ * suboffsets = memview.view.suboffsets
+ */
+ __pyx_t_1 = __pyx_v_memview->view.shape;
+ __pyx_v_shape = __pyx_t_1;
+
+ /* "View.MemoryView":1018
+ *
+ * shape = memview.view.shape
+ * strides = memview.view.strides # <<<<<<<<<<<<<<
+ * suboffsets = memview.view.suboffsets
+ *
+ */
+ __pyx_t_1 = __pyx_v_memview->view.strides;
+ __pyx_v_strides = __pyx_t_1;
+
+ /* "View.MemoryView":1019
+ * shape = memview.view.shape
+ * strides = memview.view.strides
+ * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
+ *
+ * dst.memview = <__pyx_memoryview *> memview
+ */
+ __pyx_t_1 = __pyx_v_memview->view.suboffsets;
+ __pyx_v_suboffsets = __pyx_t_1;
+
+ /* "View.MemoryView":1021
+ * suboffsets = memview.view.suboffsets
+ *
+ * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
+ * dst.data = <char *> memview.view.buf
+ *
+ */
+ __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
+
+ /* "View.MemoryView":1022
+ *
+ * dst.memview = <__pyx_memoryview *> memview
+ * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
+ *
+ * for dim in range(memview.view.ndim):
+ */
+ __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
+
+ /* "View.MemoryView":1024
+ * dst.data = <char *> memview.view.buf
+ *
+ * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
+ * dst.shape[dim] = shape[dim]
+ * dst.strides[dim] = strides[dim]
+ */
+ __pyx_t_2 = __pyx_v_memview->view.ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_dim = __pyx_t_3;
+
+ /* "View.MemoryView":1025
+ *
+ * for dim in range(memview.view.ndim):
+ * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
+ * dst.strides[dim] = strides[dim]
+ * if suboffsets == NULL:
+ */
+ (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
+
+ /* "View.MemoryView":1026
+ * for dim in range(memview.view.ndim):
+ * dst.shape[dim] = shape[dim]
+ * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
+ * if suboffsets == NULL:
+ * dst.suboffsets[dim] = -1
+ */
+ (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
+
+ /* "View.MemoryView":1027
+ * dst.shape[dim] = shape[dim]
+ * dst.strides[dim] = strides[dim]
+ * if suboffsets == NULL: # <<<<<<<<<<<<<<
+ * dst.suboffsets[dim] = -1
+ * else:
+ */
+ __pyx_t_4 = ((__pyx_v_suboffsets == NULL) != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":1028
+ * dst.strides[dim] = strides[dim]
+ * if suboffsets == NULL:
+ * dst.suboffsets[dim] = -1 # <<<<<<<<<<<<<<
+ * else:
+ * dst.suboffsets[dim] = suboffsets[dim]
+ */
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = -1;
+ goto __pyx_L5;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1030
+ * dst.suboffsets[dim] = -1
+ * else:
+ * dst.suboffsets[dim] = suboffsets[dim] # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_object')
+ */
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]);
+ }
+ __pyx_L5:;
+ }
+
+ /* "View.MemoryView":1013
+ *
+ * @cname('__pyx_memoryview_slice_copy')
+ * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
+ * cdef int dim
+ * cdef (Py_ssize_t*) shape, strides, suboffsets
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":1033
+ *
+ * @cname('__pyx_memoryview_copy_object')
+ * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
+ * "Create a new memoryview object"
+ * cdef __Pyx_memviewslice memviewslice
+ */
+
+static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
+ __Pyx_memviewslice __pyx_v_memviewslice;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("memoryview_copy", 0);
+
+ /* "View.MemoryView":1036
+ * "Create a new memoryview object"
+ * cdef __Pyx_memviewslice memviewslice
+ * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
+ * return memoryview_copy_from_slice(memview, &memviewslice)
+ *
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
+
+ /* "View.MemoryView":1037
+ * cdef __Pyx_memviewslice memviewslice
+ * slice_copy(memview, &memviewslice)
+ * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_object_from_slice')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1033
+ *
+ * @cname('__pyx_memoryview_copy_object')
+ * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
+ * "Create a new memoryview object"
+ * cdef __Pyx_memviewslice memviewslice
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1040
+ *
+ * @cname('__pyx_memoryview_copy_object_from_slice')
+ * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
+ * """
+ * Create a new memoryview object from a given memoryview object and slice.
+ */
+
+static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
+ PyObject *(*__pyx_v_to_object_func)(char *);
+ int (*__pyx_v_to_dtype_func)(char *, PyObject *);
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *(*__pyx_t_3)(char *);
+ int (*__pyx_t_4)(char *, PyObject *);
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
+
+ /* "View.MemoryView":1047
+ * cdef int (*to_dtype_func)(char *, object) except 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * to_object_func = (<_memoryviewslice> memview).to_object_func
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1048
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
+ * else:
+ */
+ __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
+ __pyx_v_to_object_func = __pyx_t_3;
+
+ /* "View.MemoryView":1049
+ * if isinstance(memview, _memoryviewslice):
+ * to_object_func = (<_memoryviewslice> memview).to_object_func
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
+ * else:
+ * to_object_func = NULL
+ */
+ __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
+ __pyx_v_to_dtype_func = __pyx_t_4;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1051
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
+ * else:
+ * to_object_func = NULL # <<<<<<<<<<<<<<
+ * to_dtype_func = NULL
+ *
+ */
+ __pyx_v_to_object_func = NULL;
+
+ /* "View.MemoryView":1052
+ * else:
+ * to_object_func = NULL
+ * to_dtype_func = NULL # <<<<<<<<<<<<<<
+ *
+ * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
+ */
+ __pyx_v_to_dtype_func = NULL;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1054
+ * to_dtype_func = NULL
+ *
+ * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
+ * to_object_func, to_dtype_func,
+ * memview.dtype_is_object)
+ */
+ __Pyx_XDECREF(__pyx_r);
+
+ /* "View.MemoryView":1056
+ * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
+ * to_object_func, to_dtype_func,
+ * memview.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1040
+ *
+ * @cname('__pyx_memoryview_copy_object_from_slice')
+ * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
+ * """
+ * Create a new memoryview object from a given memoryview object and slice.
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1062
+ *
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
+ * if arg < 0:
+ * return -arg
+ */
+
+static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
+ Py_ssize_t __pyx_r;
+ int __pyx_t_1;
+
+ /* "View.MemoryView":1063
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0: # <<<<<<<<<<<<<<
+ * return -arg
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1064
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0:
+ * return -arg # <<<<<<<<<<<<<<
+ * else:
+ * return arg
+ */
+ __pyx_r = (-__pyx_v_arg);
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1066
+ * return -arg
+ * else:
+ * return arg # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_get_best_slice_order')
+ */
+ __pyx_r = __pyx_v_arg;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":1062
+ *
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
+ * if arg < 0:
+ * return -arg
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1069
+ *
+ * @cname('__pyx_get_best_slice_order')
+ * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
+ * """
+ * Figure out the best memory access order for a given slice.
+ */
+
+static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
+ int __pyx_v_i;
+ Py_ssize_t __pyx_v_c_stride;
+ Py_ssize_t __pyx_v_f_stride;
+ char __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+
+ /* "View.MemoryView":1074
+ * """
+ * cdef int i
+ * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t f_stride = 0
+ *
+ */
+ __pyx_v_c_stride = 0;
+
+ /* "View.MemoryView":1075
+ * cdef int i
+ * cdef Py_ssize_t c_stride = 0
+ * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim - 1, -1, -1):
+ */
+ __pyx_v_f_stride = 0;
+
+ /* "View.MemoryView":1077
+ * cdef Py_ssize_t f_stride = 0
+ *
+ * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
+ * if mslice.shape[i] > 1:
+ * c_stride = mslice.strides[i]
+ */
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ __pyx_v_i = __pyx_t_1;
+
+ /* "View.MemoryView":1078
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * c_stride = mslice.strides[i]
+ * break
+ */
+ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1079
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1:
+ * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
+
+ /* "View.MemoryView":1080
+ * if mslice.shape[i] > 1:
+ * c_stride = mslice.strides[i]
+ * break # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim):
+ */
+ goto __pyx_L4_break;
+ }
+ }
+ __pyx_L4_break:;
+
+ /* "View.MemoryView":1082
+ * break
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if mslice.shape[i] > 1:
+ * f_stride = mslice.strides[i]
+ */
+ __pyx_t_1 = __pyx_v_ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1083
+ *
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * f_stride = mslice.strides[i]
+ * break
+ */
+ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1084
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1:
+ * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
+
+ /* "View.MemoryView":1085
+ * if mslice.shape[i] > 1:
+ * f_stride = mslice.strides[i]
+ * break # <<<<<<<<<<<<<<
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
+ */
+ goto __pyx_L7_break;
+ }
+ }
+ __pyx_L7_break:;
+
+ /* "View.MemoryView":1087
+ * break
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
+ * return 'C'
+ * else:
+ */
+ __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1088
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
+ * return 'C' # <<<<<<<<<<<<<<
+ * else:
+ * return 'F'
+ */
+ __pyx_r = 'C';
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1090
+ * return 'C'
+ * else:
+ * return 'F' # <<<<<<<<<<<<<<
+ *
+ * @cython.cdivision(True)
+ */
+ __pyx_r = 'F';
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":1069
+ *
+ * @cname('__pyx_get_best_slice_order')
+ * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
+ * """
+ * Figure out the best memory access order for a given slice.
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1093
+ *
+ * @cython.cdivision(True)
+ * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
+ * char *dst_data, Py_ssize_t *dst_strides,
+ * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
+ */
+
+static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
+ CYTHON_UNUSED Py_ssize_t __pyx_v_i;
+ CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
+ Py_ssize_t __pyx_v_dst_extent;
+ Py_ssize_t __pyx_v_src_stride;
+ Py_ssize_t __pyx_v_dst_stride;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+
+ /* "View.MemoryView":1100
+ *
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dst_extent = dst_shape[0]
+ * cdef Py_ssize_t src_stride = src_strides[0]
+ */
+ __pyx_v_src_extent = (__pyx_v_src_shape[0]);
+
+ /* "View.MemoryView":1101
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t src_extent = src_shape[0]
+ * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t src_stride = src_strides[0]
+ * cdef Py_ssize_t dst_stride = dst_strides[0]
+ */
+ __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
+
+ /* "View.MemoryView":1102
+ * cdef Py_ssize_t src_extent = src_shape[0]
+ * cdef Py_ssize_t dst_extent = dst_shape[0]
+ * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dst_stride = dst_strides[0]
+ *
+ */
+ __pyx_v_src_stride = (__pyx_v_src_strides[0]);
+
+ /* "View.MemoryView":1103
+ * cdef Py_ssize_t dst_extent = dst_shape[0]
+ * cdef Py_ssize_t src_stride = src_strides[0]
+ * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
+ *
+ * if ndim == 1:
+ */
+ __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
+
+ /* "View.MemoryView":1105
+ * cdef Py_ssize_t dst_stride = dst_strides[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if (src_stride > 0 and dst_stride > 0 and
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ */
+ __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1106
+ *
+ * if ndim == 1:
+ * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ */
+ __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L5_bool_binop_done;
+ }
+
+ /* "View.MemoryView":1107
+ * if ndim == 1:
+ * if (src_stride > 0 and dst_stride > 0 and
+ * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ * else:
+ */
+ __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
+ if (__pyx_t_2) {
+ __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
+ }
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_L5_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1108
+ * if (src_stride > 0 and dst_stride > 0 and
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
+ * else:
+ * for i in range(dst_extent):
+ */
+ memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1110
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ * else:
+ * for i in range(dst_extent): # <<<<<<<<<<<<<<
+ * memcpy(dst_data, src_data, itemsize)
+ * src_data += src_stride
+ */
+ __pyx_t_4 = __pyx_v_dst_extent;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "View.MemoryView":1111
+ * else:
+ * for i in range(dst_extent):
+ * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
+ * src_data += src_stride
+ * dst_data += dst_stride
+ */
+ memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);
+
+ /* "View.MemoryView":1112
+ * for i in range(dst_extent):
+ * memcpy(dst_data, src_data, itemsize)
+ * src_data += src_stride # <<<<<<<<<<<<<<
+ * dst_data += dst_stride
+ * else:
+ */
+ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
+
+ /* "View.MemoryView":1113
+ * memcpy(dst_data, src_data, itemsize)
+ * src_data += src_stride
+ * dst_data += dst_stride # <<<<<<<<<<<<<<
+ * else:
+ * for i in range(dst_extent):
+ */
+ __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
+ }
+ }
+ __pyx_L4:;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1115
+ * dst_data += dst_stride
+ * else:
+ * for i in range(dst_extent): # <<<<<<<<<<<<<<
+ * _copy_strided_to_strided(src_data, src_strides + 1,
+ * dst_data, dst_strides + 1,
+ */
+ __pyx_t_4 = __pyx_v_dst_extent;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "View.MemoryView":1116
+ * else:
+ * for i in range(dst_extent):
+ * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
+ * dst_data, dst_strides + 1,
+ * src_shape + 1, dst_shape + 1,
+ */
+ _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
+
+ /* "View.MemoryView":1120
+ * src_shape + 1, dst_shape + 1,
+ * ndim - 1, itemsize)
+ * src_data += src_stride # <<<<<<<<<<<<<<
+ * dst_data += dst_stride
+ *
+ */
+ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
+
+ /* "View.MemoryView":1121
+ * ndim - 1, itemsize)
+ * src_data += src_stride
+ * dst_data += dst_stride # <<<<<<<<<<<<<<
+ *
+ * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
+ */
+ __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
+ }
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1093
+ *
+ * @cython.cdivision(True)
+ * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
+ * char *dst_data, Py_ssize_t *dst_strides,
+ * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1123
+ * dst_data += dst_stride
+ *
+ * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * int ndim, size_t itemsize) nogil:
+ */
+
+static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
+
+ /* "View.MemoryView":1126
+ * __Pyx_memviewslice *dst,
+ * int ndim, size_t itemsize) nogil:
+ * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
+ * src.shape, dst.shape, ndim, itemsize)
+ *
+ */
+ _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
+
+ /* "View.MemoryView":1123
+ * dst_data += dst_stride
+ *
+ * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * int ndim, size_t itemsize) nogil:
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1130
+ *
+ * @cname('__pyx_memoryview_slice_get_size')
+ * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
+ * "Return the size of the memory occupied by the slice in number of bytes"
+ * cdef int i
+ */
+
+static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
+ int __pyx_v_i;
+ Py_ssize_t __pyx_v_size;
+ Py_ssize_t __pyx_r;
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+
+ /* "View.MemoryView":1133
+ * "Return the size of the memory occupied by the slice in number of bytes"
+ * cdef int i
+ * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim):
+ */
+ __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
+ __pyx_v_size = __pyx_t_1;
+
+ /* "View.MemoryView":1135
+ * cdef Py_ssize_t size = src.memview.view.itemsize
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * size *= src.shape[i]
+ *
+ */
+ __pyx_t_2 = __pyx_v_ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1136
+ *
+ * for i in range(ndim):
+ * size *= src.shape[i] # <<<<<<<<<<<<<<
+ *
+ * return size
+ */
+ __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
+ }
+
+ /* "View.MemoryView":1138
+ * size *= src.shape[i]
+ *
+ * return size # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_fill_contig_strides_array')
+ */
+ __pyx_r = __pyx_v_size;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1130
+ *
+ * @cname('__pyx_memoryview_slice_get_size')
+ * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
+ * "Return the size of the memory occupied by the slice in number of bytes"
+ * cdef int i
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1141
+ *
+ * @cname('__pyx_fill_contig_strides_array')
+ * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
+ * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
+ * int ndim, char order) nogil:
+ */
+
+static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
+ int __pyx_v_idx;
+ Py_ssize_t __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+
+ /* "View.MemoryView":1150
+ * cdef int idx
+ *
+ * if order == 'F': # <<<<<<<<<<<<<<
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ */
+ __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1151
+ *
+ * if order == 'F':
+ * for idx in range(ndim): # <<<<<<<<<<<<<<
+ * strides[idx] = stride
+ * stride = stride * shape[idx]
+ */
+ __pyx_t_2 = __pyx_v_ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_idx = __pyx_t_3;
+
+ /* "View.MemoryView":1152
+ * if order == 'F':
+ * for idx in range(ndim):
+ * strides[idx] = stride # <<<<<<<<<<<<<<
+ * stride = stride * shape[idx]
+ * else:
+ */
+ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
+
+ /* "View.MemoryView":1153
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ * stride = stride * shape[idx] # <<<<<<<<<<<<<<
+ * else:
+ * for idx in range(ndim - 1, -1, -1):
+ */
+ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
+ }
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1155
+ * stride = stride * shape[idx]
+ * else:
+ * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
+ * strides[idx] = stride
+ * stride = stride * shape[idx]
+ */
+ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
+ __pyx_v_idx = __pyx_t_2;
+
+ /* "View.MemoryView":1156
+ * else:
+ * for idx in range(ndim - 1, -1, -1):
+ * strides[idx] = stride # <<<<<<<<<<<<<<
+ * stride = stride * shape[idx]
+ *
+ */
+ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
+
+ /* "View.MemoryView":1157
+ * for idx in range(ndim - 1, -1, -1):
+ * strides[idx] = stride
+ * stride = stride * shape[idx] # <<<<<<<<<<<<<<
+ *
+ * return stride
+ */
+ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
+ }
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1159
+ * stride = stride * shape[idx]
+ *
+ * return stride # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_data_to_temp')
+ */
+ __pyx_r = __pyx_v_stride;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1141
+ *
+ * @cname('__pyx_fill_contig_strides_array')
+ * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
+ * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
+ * int ndim, char order) nogil:
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1162
+ *
+ * @cname('__pyx_memoryview_copy_data_to_temp')
+ * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *tmpslice,
+ * char order,
+ */
+
+static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
+ int __pyx_v_i;
+ void *__pyx_v_result;
+ size_t __pyx_v_itemsize;
+ size_t __pyx_v_size;
+ void *__pyx_r;
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ struct __pyx_memoryview_obj *__pyx_t_4;
+ int __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+
+ /* "View.MemoryView":1173
+ * cdef void *result
+ *
+ * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
+ * cdef size_t size = slice_get_size(src, ndim)
+ *
+ */
+ __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
+ __pyx_v_itemsize = __pyx_t_1;
+
+ /* "View.MemoryView":1174
+ *
+ * cdef size_t itemsize = src.memview.view.itemsize
+ * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
+ *
+ * result = malloc(size)
+ */
+ __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
+
+ /* "View.MemoryView":1176
+ * cdef size_t size = slice_get_size(src, ndim)
+ *
+ * result = malloc(size) # <<<<<<<<<<<<<<
+ * if not result:
+ * _err(MemoryError, NULL)
+ */
+ __pyx_v_result = malloc(__pyx_v_size);
+
+ /* "View.MemoryView":1177
+ *
+ * result = malloc(size)
+ * if not result: # <<<<<<<<<<<<<<
+ * _err(MemoryError, NULL)
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1178
+ * result = malloc(size)
+ * if not result:
+ * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1181
+ *
+ *
+ * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
+ * tmpslice.memview = src.memview
+ * for i in range(ndim):
+ */
+ __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
+
+ /* "View.MemoryView":1182
+ *
+ * tmpslice.data = <char *> result
+ * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
+ * for i in range(ndim):
+ * tmpslice.shape[i] = src.shape[i]
+ */
+ __pyx_t_4 = __pyx_v_src->memview;
+ __pyx_v_tmpslice->memview = __pyx_t_4;
+
+ /* "View.MemoryView":1183
+ * tmpslice.data = <char *> result
+ * tmpslice.memview = src.memview
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * tmpslice.shape[i] = src.shape[i]
+ * tmpslice.suboffsets[i] = -1
+ */
+ __pyx_t_3 = __pyx_v_ndim;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "View.MemoryView":1184
+ * tmpslice.memview = src.memview
+ * for i in range(ndim):
+ * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
+ * tmpslice.suboffsets[i] = -1
+ *
+ */
+ (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
+
+ /* "View.MemoryView":1185
+ * for i in range(ndim):
+ * tmpslice.shape[i] = src.shape[i]
+ * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ *
+ * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
+ */
+ (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1;
+ }
+
+ /* "View.MemoryView":1187
+ * tmpslice.suboffsets[i] = -1
+ *
+ * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
+ * ndim, order)
+ *
+ */
+ __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order);
+
+ /* "View.MemoryView":1191
+ *
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if tmpslice.shape[i] == 1:
+ * tmpslice.strides[i] = 0
+ */
+ __pyx_t_3 = __pyx_v_ndim;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "View.MemoryView":1192
+ *
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
+ * tmpslice.strides[i] = 0
+ *
+ */
+ __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1193
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1:
+ * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
+ *
+ * if slice_is_contig(src, order, ndim):
+ */
+ (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+ }
+
+ /* "View.MemoryView":1195
+ * tmpslice.strides[i] = 0
+ *
+ * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * memcpy(result, src.data, size)
+ * else:
+ */
+ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1196
+ *
+ * if slice_is_contig(src, order, ndim):
+ * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
+ * else:
+ * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
+ */
+ memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size);
+ goto __pyx_L9;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1198
+ * memcpy(result, src.data, size)
+ * else:
+ * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
+ *
+ * return result
+ */
+ copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
+ }
+ __pyx_L9:;
+
+ /* "View.MemoryView":1200
+ * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
+ *
+ * return result # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1162
+ *
+ * @cname('__pyx_memoryview_copy_data_to_temp')
+ * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *tmpslice,
+ * char order,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = NULL;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1205
+ *
+ * @cname('__pyx_memoryview_err_extents')
+ * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
+ */
+
+static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("_err_extents", 0);
+
+ /* "View.MemoryView":1208
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
+ * (i, extent1, extent2)) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_err_dim')
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":1207
+ * cdef int _err_extents(int i, Py_ssize_t extent1,
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
+ * (i, extent1, extent2))
+ *
+ */
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1207; __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[2]; __pyx_lineno = 1207; __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[2]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":1205
+ *
+ * @cname('__pyx_memoryview_err_extents')
+ * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1211
+ *
+ * @cname('__pyx_memoryview_err_dim')
+ * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii') % dim)
+ *
+ */
+
+static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("_err_dim", 0);
+ __Pyx_INCREF(__pyx_v_error);
+
+ /* "View.MemoryView":1212
+ * @cname('__pyx_memoryview_err_dim')
+ * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
+ * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_err')
+ */
+ __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __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_3); __pyx_t_3 = 0;
+ __Pyx_INCREF(__pyx_v_error);
+ __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_2)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (!__pyx_t_2) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __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_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":1211
+ *
+ * @cname('__pyx_memoryview_err_dim')
+ * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii') % dim)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __Pyx_XDECREF(__pyx_v_error);
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1215
+ *
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
+ * if msg != NULL:
+ * raise error(msg.decode('ascii'))
+ */
+
+static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("_err", 0);
+ __Pyx_INCREF(__pyx_v_error);
+
+ /* "View.MemoryView":1216
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii'))
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1217
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL:
+ * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
+ * else:
+ * raise error
+ */
+ __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_error);
+ __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ if (!__pyx_t_5) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ } else {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1219
+ * raise error(msg.decode('ascii'))
+ * else:
+ * raise error # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_contents')
+ */
+ __Pyx_Raise(__pyx_v_error, 0, 0, 0);
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":1215
+ *
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
+ * if msg != NULL:
+ * raise error(msg.decode('ascii'))
+ */
+
+ /* 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);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __Pyx_XDECREF(__pyx_v_error);
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1222
+ *
+ * @cname('__pyx_memoryview_copy_contents')
+ * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice dst,
+ * int src_ndim, int dst_ndim,
+ */
+
+static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
+ void *__pyx_v_tmpdata;
+ size_t __pyx_v_itemsize;
+ int __pyx_v_i;
+ char __pyx_v_order;
+ int __pyx_v_broadcasting;
+ int __pyx_v_direct_copy;
+ __Pyx_memviewslice __pyx_v_tmp;
+ int __pyx_v_ndim;
+ int __pyx_r;
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ void *__pyx_t_6;
+ int __pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+
+ /* "View.MemoryView":1230
+ * Check for overlapping memory and verify the shapes.
+ * """
+ * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
+ * cdef size_t itemsize = src.memview.view.itemsize
+ * cdef int i
+ */
+ __pyx_v_tmpdata = NULL;
+
+ /* "View.MemoryView":1231
+ * """
+ * cdef void *tmpdata = NULL
+ * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
+ * cdef int i
+ * cdef char order = get_best_order(&src, src_ndim)
+ */
+ __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
+ __pyx_v_itemsize = __pyx_t_1;
+
+ /* "View.MemoryView":1233
+ * cdef size_t itemsize = src.memview.view.itemsize
+ * cdef int i
+ * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
+ * cdef bint broadcasting = False
+ * cdef bint direct_copy = False
+ */
+ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
+
+ /* "View.MemoryView":1234
+ * cdef int i
+ * cdef char order = get_best_order(&src, src_ndim)
+ * cdef bint broadcasting = False # <<<<<<<<<<<<<<
+ * cdef bint direct_copy = False
+ * cdef __Pyx_memviewslice tmp
+ */
+ __pyx_v_broadcasting = 0;
+
+ /* "View.MemoryView":1235
+ * cdef char order = get_best_order(&src, src_ndim)
+ * cdef bint broadcasting = False
+ * cdef bint direct_copy = False # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice tmp
+ *
+ */
+ __pyx_v_direct_copy = 0;
+
+ /* "View.MemoryView":1238
+ * cdef __Pyx_memviewslice tmp
+ *
+ * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ */
+ __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1239
+ *
+ * if src_ndim < dst_ndim:
+ * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
+ * elif dst_ndim < src_ndim:
+ * broadcast_leading(&dst, dst_ndim, src_ndim)
+ */
+ __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":1240
+ * if src_ndim < dst_ndim:
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&dst, dst_ndim, src_ndim)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1241
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
+ *
+ * cdef int ndim = max(src_ndim, dst_ndim)
+ */
+ __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1243
+ * broadcast_leading(&dst, dst_ndim, src_ndim)
+ *
+ * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim):
+ */
+ __pyx_t_3 = __pyx_v_dst_ndim;
+ __pyx_t_4 = __pyx_v_src_ndim;
+ if (((__pyx_t_3 > __pyx_t_4) != 0)) {
+ __pyx_t_5 = __pyx_t_3;
+ } else {
+ __pyx_t_5 = __pyx_t_4;
+ }
+ __pyx_v_ndim = __pyx_t_5;
+
+ /* "View.MemoryView":1245
+ * cdef int ndim = max(src_ndim, dst_ndim)
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1:
+ */
+ __pyx_t_5 = __pyx_v_ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1246
+ *
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ */
+ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1247
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1: # <<<<<<<<<<<<<<
+ * broadcasting = True
+ * src.strides[i] = 0
+ */
+ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1248
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1:
+ * broadcasting = True # <<<<<<<<<<<<<<
+ * src.strides[i] = 0
+ * else:
+ */
+ __pyx_v_broadcasting = 1;
+
+ /* "View.MemoryView":1249
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ * src.strides[i] = 0 # <<<<<<<<<<<<<<
+ * else:
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ */
+ (__pyx_v_src.strides[__pyx_v_i]) = 0;
+ goto __pyx_L7;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1251
+ * src.strides[i] = 0
+ * else:
+ * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
+ *
+ * if src.suboffsets[i] >= 0:
+ */
+ __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L7:;
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":1253
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ *
+ * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ */
+ __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1254
+ *
+ * if src.suboffsets[i] >= 0:
+ * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
+ *
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ */
+ __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+ }
+
+ /* "View.MemoryView":1256
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
+ *
+ * if not slice_is_contig(&src, order, ndim):
+ */
+ __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1258
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ *
+ * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<<
+ * order = get_best_order(&dst, ndim)
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_memviewslice_is_contig((&__pyx_v_src), __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1259
+ *
+ * if not slice_is_contig(&src, order, ndim):
+ * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
+ *
+ * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
+ */
+ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
+ goto __pyx_L10;
+ }
+ __pyx_L10:;
+
+ /* "View.MemoryView":1261
+ * order = get_best_order(&dst, ndim)
+ *
+ * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
+ * src = tmp
+ *
+ */
+ __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_tmpdata = __pyx_t_6;
+
+ /* "View.MemoryView":1262
+ *
+ * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
+ * src = tmp # <<<<<<<<<<<<<<
+ *
+ * if not broadcasting:
+ */
+ __pyx_v_src = __pyx_v_tmp;
+ goto __pyx_L9;
+ }
+ __pyx_L9:;
+
+ /* "View.MemoryView":1264
+ * src = tmp
+ *
+ * if not broadcasting: # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1267
+ *
+ *
+ * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(&dst, 'C', ndim)
+ * elif slice_is_contig(&src, 'F', ndim):
+ */
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'C', __pyx_v_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1268
+ *
+ * if slice_is_contig(&src, 'C', ndim):
+ * direct_copy = slice_is_contig(&dst, 'C', ndim) # <<<<<<<<<<<<<<
+ * elif slice_is_contig(&src, 'F', ndim):
+ * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ */
+ __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'C', __pyx_v_ndim);
+ goto __pyx_L12;
+ }
+
+ /* "View.MemoryView":1269
+ * if slice_is_contig(&src, 'C', ndim):
+ * direct_copy = slice_is_contig(&dst, 'C', ndim)
+ * elif slice_is_contig(&src, 'F', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ *
+ */
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'F', __pyx_v_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1270
+ * direct_copy = slice_is_contig(&dst, 'C', ndim)
+ * elif slice_is_contig(&src, 'F', ndim):
+ * direct_copy = slice_is_contig(&dst, 'F', ndim) # <<<<<<<<<<<<<<
+ *
+ * if direct_copy:
+ */
+ __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'F', __pyx_v_ndim);
+ goto __pyx_L12;
+ }
+ __pyx_L12:;
+
+ /* "View.MemoryView":1272
+ * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ *
+ * if direct_copy: # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
+ __pyx_t_2 = (__pyx_v_direct_copy != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1274
+ * if direct_copy:
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
+
+ /* "View.MemoryView":1275
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ * free(tmpdata)
+ */
+ memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));
+
+ /* "View.MemoryView":1276
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
+ * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
+ * free(tmpdata)
+ * return 0
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
+
+ /* "View.MemoryView":1277
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ * free(tmpdata) # <<<<<<<<<<<<<<
+ * return 0
+ *
+ */
+ free(__pyx_v_tmpdata);
+
+ /* "View.MemoryView":1278
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ * free(tmpdata)
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ * if order == 'F' == get_best_order(&dst, ndim):
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+ goto __pyx_L11;
+ }
+ __pyx_L11:;
+
+ /* "View.MemoryView":1280
+ * return 0
+ *
+ * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = (__pyx_v_order == 'F');
+ if (__pyx_t_2) {
+ __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
+ }
+ __pyx_t_7 = (__pyx_t_2 != 0);
+ if (__pyx_t_7) {
+
+ /* "View.MemoryView":1283
+ *
+ *
+ * transpose_memslice(&src) # <<<<<<<<<<<<<<
+ * transpose_memslice(&dst)
+ *
+ */
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":1284
+ *
+ * transpose_memslice(&src)
+ * transpose_memslice(&dst) # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L14;
+ }
+ __pyx_L14:;
+
+ /* "View.MemoryView":1286
+ * transpose_memslice(&dst)
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
+ * copy_strided_to_strided(&src, &dst, ndim, itemsize)
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
+
+ /* "View.MemoryView":1287
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ *
+ */
+ copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
+
+ /* "View.MemoryView":1288
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * copy_strided_to_strided(&src, &dst, ndim, itemsize)
+ * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
+ *
+ * free(tmpdata)
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
+
+ /* "View.MemoryView":1290
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ *
+ * free(tmpdata) # <<<<<<<<<<<<<<
+ * return 0
+ *
+ */
+ free(__pyx_v_tmpdata);
+
+ /* "View.MemoryView":1291
+ *
+ * free(tmpdata)
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_broadcast_leading')
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1222
+ *
+ * @cname('__pyx_memoryview_copy_contents')
+ * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice dst,
+ * int src_ndim, int dst_ndim,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = -1;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1294
+ *
+ * @cname('__pyx_memoryview_broadcast_leading')
+ * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * int ndim_other) nogil:
+ */
+
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
+ int __pyx_v_i;
+ int __pyx_v_offset;
+ int __pyx_t_1;
+ int __pyx_t_2;
+
+ /* "View.MemoryView":1298
+ * int ndim_other) nogil:
+ * cdef int i
+ * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim - 1, -1, -1):
+ */
+ __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
+
+ /* "View.MemoryView":1300
+ * cdef int offset = ndim_other - ndim
+ *
+ * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
+ * slice.shape[i + offset] = slice.shape[i]
+ * slice.strides[i + offset] = slice.strides[i]
+ */
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ __pyx_v_i = __pyx_t_1;
+
+ /* "View.MemoryView":1301
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * slice.shape[i + offset] = slice.shape[i] # <<<<<<<<<<<<<<
+ * slice.strides[i + offset] = slice.strides[i]
+ * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ */
+ (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]);
+
+ /* "View.MemoryView":1302
+ * for i in range(ndim - 1, -1, -1):
+ * slice.shape[i + offset] = slice.shape[i]
+ * slice.strides[i + offset] = slice.strides[i] # <<<<<<<<<<<<<<
+ * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ *
+ */
+ (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]);
+
+ /* "View.MemoryView":1303
+ * slice.shape[i + offset] = slice.shape[i]
+ * slice.strides[i + offset] = slice.strides[i]
+ * slice.suboffsets[i + offset] = slice.suboffsets[i] # <<<<<<<<<<<<<<
+ *
+ * for i in range(offset):
+ */
+ (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]);
+ }
+
+ /* "View.MemoryView":1305
+ * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ *
+ * for i in range(offset): # <<<<<<<<<<<<<<
+ * slice.shape[i] = 1
+ * slice.strides[i] = slice.strides[0]
+ */
+ __pyx_t_1 = __pyx_v_offset;
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "View.MemoryView":1306
+ *
+ * for i in range(offset):
+ * slice.shape[i] = 1 # <<<<<<<<<<<<<<
+ * slice.strides[i] = slice.strides[0]
+ * slice.suboffsets[i] = -1
+ */
+ (__pyx_v_slice->shape[__pyx_v_i]) = 1;
+
+ /* "View.MemoryView":1307
+ * for i in range(offset):
+ * slice.shape[i] = 1
+ * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<<
+ * slice.suboffsets[i] = -1
+ *
+ */
+ (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]);
+
+ /* "View.MemoryView":1308
+ * slice.shape[i] = 1
+ * slice.strides[i] = slice.strides[0]
+ * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1;
+ }
+
+ /* "View.MemoryView":1294
+ *
+ * @cname('__pyx_memoryview_broadcast_leading')
+ * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * int ndim_other) nogil:
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1316
+ *
+ * @cname('__pyx_memoryview_refcount_copying')
+ * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
+ * int ndim, bint inc) nogil:
+ *
+ */
+
+static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
+ int __pyx_t_1;
+
+ /* "View.MemoryView":1320
+ *
+ *
+ * if dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
+ * dst.strides, ndim, inc)
+ */
+ __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1321
+ *
+ * if dtype_is_object:
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
+ * dst.strides, ndim, inc)
+ *
+ */
+ __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1316
+ *
+ * @cname('__pyx_memoryview_refcount_copying')
+ * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
+ * int ndim, bint inc) nogil:
+ *
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1325
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
+ * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * bint inc) with gil:
+ */
+
+static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
+ __Pyx_RefNannyDeclarations
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
+
+ /* "View.MemoryView":1328
+ * Py_ssize_t *strides, int ndim,
+ * bint inc) with gil:
+ * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice')
+ */
+ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
+
+ /* "View.MemoryView":1325
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
+ * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * bint inc) with gil:
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+}
+
+/* "View.MemoryView":1331
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice')
+ * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim, bint inc):
+ * cdef Py_ssize_t i
+ */
+
+static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
+ CYTHON_UNUSED Py_ssize_t __pyx_v_i;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ Py_ssize_t __pyx_t_2;
+ int __pyx_t_3;
+ __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
+
+ /* "View.MemoryView":1335
+ * cdef Py_ssize_t i
+ *
+ * for i in range(shape[0]): # <<<<<<<<<<<<<<
+ * if ndim == 1:
+ * if inc:
+ */
+ __pyx_t_1 = (__pyx_v_shape[0]);
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "View.MemoryView":1336
+ *
+ * for i in range(shape[0]):
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0])
+ */
+ __pyx_t_3 = ((__pyx_v_ndim == 1) != 0);
+ if (__pyx_t_3) {
+
+ /* "View.MemoryView":1337
+ * for i in range(shape[0]):
+ * if ndim == 1:
+ * if inc: # <<<<<<<<<<<<<<
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ */
+ __pyx_t_3 = (__pyx_v_inc != 0);
+ if (__pyx_t_3) {
+
+ /* "View.MemoryView":1338
+ * if ndim == 1:
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
+ * else:
+ * Py_DECREF((<PyObject **> data)[0])
+ */
+ Py_INCREF((((PyObject **)__pyx_v_data)[0]));
+ goto __pyx_L6;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1340
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1,
+ */
+ Py_DECREF((((PyObject **)__pyx_v_data)[0]));
+ }
+ __pyx_L6:;
+ goto __pyx_L5;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1342
+ * Py_DECREF((<PyObject **> data)[0])
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
+ * ndim - 1, inc)
+ *
+ */
+ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":1345
+ * ndim - 1, inc)
+ *
+ * data += strides[0] # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
+ }
+
+ /* "View.MemoryView":1331
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice')
+ * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim, bint inc):
+ * cdef Py_ssize_t i
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":1351
+ *
+ * @cname('__pyx_memoryview_slice_assign_scalar')
+ * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
+ * size_t itemsize, void *item,
+ * bint dtype_is_object) nogil:
+ */
+
+static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
+
+ /* "View.MemoryView":1354
+ * size_t itemsize, void *item,
+ * bint dtype_is_object) nogil:
+ * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
+ * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
+ * itemsize, item)
+ */
+ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
+
+ /* "View.MemoryView":1355
+ * bint dtype_is_object) nogil:
+ * refcount_copying(dst, dtype_is_object, ndim, False)
+ * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
+ * itemsize, item)
+ * refcount_copying(dst, dtype_is_object, ndim, True)
+ */
+ __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
+
+ /* "View.MemoryView":1357
+ * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
+ * itemsize, item)
+ * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
+
+ /* "View.MemoryView":1351
+ *
+ * @cname('__pyx_memoryview_slice_assign_scalar')
+ * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
+ * size_t itemsize, void *item,
+ * bint dtype_is_object) nogil:
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1361
+ *
+ * @cname('__pyx_memoryview__slice_assign_scalar')
+ * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * size_t itemsize, void *item) nogil:
+ */
+
+static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
+ CYTHON_UNUSED Py_ssize_t __pyx_v_i;
+ Py_ssize_t __pyx_v_stride;
+ Py_ssize_t __pyx_v_extent;
+ int __pyx_t_1;
+ Py_ssize_t __pyx_t_2;
+ Py_ssize_t __pyx_t_3;
+
+ /* "View.MemoryView":1365
+ * size_t itemsize, void *item) nogil:
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ */
+ __pyx_v_stride = (__pyx_v_strides[0]);
+
+ /* "View.MemoryView":1366
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t stride = strides[0]
+ * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
+ *
+ * if ndim == 1:
+ */
+ __pyx_v_extent = (__pyx_v_shape[0]);
+
+ /* "View.MemoryView":1368
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ */
+ __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1369
+ *
+ * if ndim == 1:
+ * for i in range(extent): # <<<<<<<<<<<<<<
+ * memcpy(data, item, itemsize)
+ * data += stride
+ */
+ __pyx_t_2 = __pyx_v_extent;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1370
+ * if ndim == 1:
+ * for i in range(extent):
+ * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
+ * data += stride
+ * else:
+ */
+ memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);
+
+ /* "View.MemoryView":1371
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ * data += stride # <<<<<<<<<<<<<<
+ * else:
+ * for i in range(extent):
+ */
+ __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
+ }
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1373
+ * data += stride
+ * else:
+ * for i in range(extent): # <<<<<<<<<<<<<<
+ * _slice_assign_scalar(data, shape + 1, strides + 1,
+ * ndim - 1, itemsize, item)
+ */
+ __pyx_t_2 = __pyx_v_extent;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1374
+ * else:
+ * for i in range(extent):
+ * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
+ * ndim - 1, itemsize, item)
+ * data += stride
+ */
+ __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
+
+ /* "View.MemoryView":1376
+ * _slice_assign_scalar(data, shape + 1, strides + 1,
+ * ndim - 1, itemsize, item)
+ * data += stride # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
+ }
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1361
+ *
+ * @cname('__pyx_memoryview__slice_assign_scalar')
+ * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * size_t itemsize, void *item) nogil:
+ */
+
+ /* function exit code */
+}
+
+static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_array_obj *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_array_obj *)o);
+ p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) {
+ Py_DECREF(o); o = 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_array(PyObject *o) {
+ struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_array___dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ Py_CLEAR(p->mode);
+ Py_CLEAR(p->_format);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
+ PyObject *r;
+ PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
+ r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
+ Py_DECREF(x);
+ return r;
+}
+
+static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
+ if (v) {
+ return __pyx_array___setitem__(o, i, v);
+ }
+ else {
+ PyErr_Format(PyExc_NotImplementedError,
+ "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
+ return -1;
+ }
+}
+
+static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
+ PyObject *v = PyObject_GenericGetAttr(o, n);
+ if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Clear();
+ v = __pyx_array___getattr__(o, n);
+ }
+ return v;
+}
+
+static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
+ return get_memview(o);
+}
+
+static PyMethodDef __pyx_methods_array[] = {
+ {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_array[] = {
+ {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PySequenceMethods __pyx_tp_as_sequence_array = {
+ 0, /*sq_length*/
+ 0, /*sq_concat*/
+ 0, /*sq_repeat*/
+ __pyx_sq_item_array, /*sq_item*/
+ 0, /*sq_slice*/
+ 0, /*sq_ass_item*/
+ 0, /*sq_ass_slice*/
+ 0, /*sq_contains*/
+ 0, /*sq_inplace_concat*/
+ 0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping_array = {
+ 0, /*mp_length*/
+ __pyx_array___getitem__, /*mp_subscript*/
+ __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
+};
+
+static PyBufferProcs __pyx_tp_as_buffer_array = {
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getreadbuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getwritebuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getsegcount*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getcharbuffer*/
+ #endif
+ __pyx_array_getbuffer, /*bf_getbuffer*/
+ 0, /*bf_releasebuffer*/
+};
+
+static PyTypeObject __pyx_type___pyx_array = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "fabio.ext.byte_offset.array", /*tp_name*/
+ sizeof(struct __pyx_array_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_array, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ __pyx_tp_getattro_array, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /*tp_doc*/
+ 0, /*tp_traverse*/
+ 0, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_array, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_array, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_array, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+
+static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_MemviewEnum_obj *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_MemviewEnum_obj *)o);
+ p->name = Py_None; Py_INCREF(Py_None);
+ return o;
+}
+
+static void __pyx_tp_dealloc_Enum(PyObject *o) {
+ struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->name);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
+ if (p->name) {
+ e = (*v)(p->name, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_Enum(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
+ tmp = ((PyObject*)p->name);
+ p->name = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyMethodDef __pyx_methods_Enum[] = {
+ {0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type___pyx_MemviewEnum = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "fabio.ext.byte_offset.Enum", /*tp_name*/
+ sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_Enum, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ __pyx_MemviewEnum___repr__, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_Enum, /*tp_traverse*/
+ __pyx_tp_clear_Enum, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_Enum, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ __pyx_MemviewEnum___init__, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_Enum, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
+
+static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_memoryview_obj *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_memoryview_obj *)o);
+ p->__pyx_vtab = __pyx_vtabptr_memoryview;
+ p->obj = Py_None; Py_INCREF(Py_None);
+ p->_size = Py_None; Py_INCREF(Py_None);
+ p->_array_interface = Py_None; Py_INCREF(Py_None);
+ p->view.obj = NULL;
+ if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) {
+ Py_DECREF(o); o = 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_memoryview(PyObject *o) {
+ struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_memoryview___dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ Py_CLEAR(p->obj);
+ Py_CLEAR(p->_size);
+ Py_CLEAR(p->_array_interface);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
+ if (p->obj) {
+ e = (*v)(p->obj, a); if (e) return e;
+ }
+ if (p->_size) {
+ e = (*v)(p->_size, a); if (e) return e;
+ }
+ if (p->_array_interface) {
+ e = (*v)(p->_array_interface, a); if (e) return e;
+ }
+ if (p->view.obj) {
+ e = (*v)(p->view.obj, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_memoryview(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
+ tmp = ((PyObject*)p->obj);
+ p->obj = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_size);
+ p->_size = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_array_interface);
+ p->_array_interface = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ Py_CLEAR(p->view.obj);
+ return 0;
+}
+static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
+ PyObject *r;
+ PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
+ r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
+ Py_DECREF(x);
+ return r;
+}
+
+static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
+ if (v) {
+ return __pyx_memoryview___setitem__(o, i, v);
+ }
+ else {
+ PyErr_Format(PyExc_NotImplementedError,
+ "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
+ return -1;
+ }
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_transpose(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview__get__base(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_shape(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_strides(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_suboffsets(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_ndim(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_itemsize(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_nbytes(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_size(o);
+}
+
+static PyMethodDef __pyx_methods_memoryview[] = {
+ {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
+ {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
+ {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
+ {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_memoryview[] = {
+ {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
+ {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
+ {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
+ {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
+ {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
+ {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
+ {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
+ {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
+ __pyx_memoryview___len__, /*sq_length*/
+ 0, /*sq_concat*/
+ 0, /*sq_repeat*/
+ __pyx_sq_item_memoryview, /*sq_item*/
+ 0, /*sq_slice*/
+ 0, /*sq_ass_item*/
+ 0, /*sq_ass_slice*/
+ 0, /*sq_contains*/
+ 0, /*sq_inplace_concat*/
+ 0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
+ __pyx_memoryview___len__, /*mp_length*/
+ __pyx_memoryview___getitem__, /*mp_subscript*/
+ __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
+};
+
+static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getreadbuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getwritebuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getsegcount*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getcharbuffer*/
+ #endif
+ __pyx_memoryview_getbuffer, /*bf_getbuffer*/
+ 0, /*bf_releasebuffer*/
+};
+
+static PyTypeObject __pyx_type___pyx_memoryview = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "fabio.ext.byte_offset.memoryview", /*tp_name*/
+ sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ __pyx_memoryview___repr__, /*tp_repr*/
+ 0, /*tp_as_number*/
+ &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ __pyx_memoryview___str__, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_memoryview, /*tp_traverse*/
+ __pyx_tp_clear_memoryview, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_memoryview, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_memoryview, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_memoryview, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
+
+static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_memoryviewslice_obj *p;
+ PyObject *o = __pyx_tp_new_memoryview(t, a, k);
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_memoryviewslice_obj *)o);
+ p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
+ p->from_object = Py_None; Py_INCREF(Py_None);
+ p->from_slice.memview = NULL;
+ return o;
+}
+
+static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
+ struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_memoryviewslice___dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ Py_CLEAR(p->from_object);
+ PyObject_GC_Track(o);
+ __pyx_tp_dealloc_memoryview(o);
+}
+
+static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
+ e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
+ if (p->from_object) {
+ e = (*v)(p->from_object, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
+ __pyx_tp_clear_memoryview(o);
+ tmp = ((PyObject*)p->from_object);
+ p->from_object = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
+ return 0;
+}
+
+static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryviewslice__get__base(o);
+}
+
+static PyMethodDef __pyx_methods__memoryviewslice[] = {
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
+ {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type___pyx_memoryviewslice = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "fabio.ext.byte_offset._memoryviewslice", /*tp_name*/
+ sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ #if CYTHON_COMPILING_IN_PYPY
+ __pyx_memoryview___repr__, /*tp_repr*/
+ #else
+ 0, /*tp_repr*/
+ #endif
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ #if CYTHON_COMPILING_IN_PYPY
+ __pyx_memoryview___str__, /*tp_str*/
+ #else
+ 0, /*tp_str*/
+ #endif
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ "Internal class for passing memoryview slices to Python", /*tp_doc*/
+ __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
+ __pyx_tp_clear__memoryviewslice, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods__memoryviewslice, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets__memoryviewslice, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new__memoryviewslice, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef __pyx_moduledef = {
+ #if PY_VERSION_HEX < 0x03020000
+ { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
+ #else
+ PyModuleDef_HEAD_INIT,
+ #endif
+ "byte_offset",
+ __pyx_k_Cif_Binary_Files_images_are_2D, /* m_doc */
+ -1, /* m_size */
+ __pyx_methods /* m_methods */,
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_kp_s_2010_2016_European_Synchrotron_R, __pyx_k_2010_2016_European_Synchrotron_R, sizeof(__pyx_k_2010_2016_European_Synchrotron_R), 0, 0, 1, 0},
+ {&__pyx_kp_s_25_07_2017, __pyx_k_25_07_2017, sizeof(__pyx_k_25_07_2017), 0, 0, 1, 0},
+ {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
+ {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
+ {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
+ {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
+ {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
+ {&__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_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
+ {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
+ {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
+ {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
+ {&__pyx_kp_s_Jerome_Kieffer, __pyx_k_Jerome_Kieffer, sizeof(__pyx_k_Jerome_Kieffer), 0, 0, 1, 0},
+ {&__pyx_n_s_MIT, __pyx_k_MIT, sizeof(__pyx_k_MIT), 0, 0, 1, 1},
+ {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
+ {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
+ {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 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_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
+ {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
+ {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
+ {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
+ {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
+ {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
+ {&__pyx_n_s_absdelta, __pyx_k_absdelta, sizeof(__pyx_k_absdelta), 0, 0, 1, 1},
+ {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
+ {&__pyx_n_s_ary, __pyx_k_ary, sizeof(__pyx_k_ary), 0, 0, 1, 1},
+ {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
+ {&__pyx_n_s_ascontiguousarray, __pyx_k_ascontiguousarray, sizeof(__pyx_k_ascontiguousarray), 0, 0, 1, 1},
+ {&__pyx_n_s_author, __pyx_k_author, sizeof(__pyx_k_author), 0, 0, 1, 1},
+ {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
+ {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
+ {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
+ {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
+ {&__pyx_n_s_comp_cbf, __pyx_k_comp_cbf, sizeof(__pyx_k_comp_cbf), 0, 0, 1, 1},
+ {&__pyx_n_s_comp_cbf32, __pyx_k_comp_cbf32, sizeof(__pyx_k_comp_cbf32), 0, 0, 1, 1},
+ {&__pyx_n_s_contact, __pyx_k_contact, sizeof(__pyx_k_contact), 0, 0, 1, 1},
+ {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
+ {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
+ {&__pyx_n_s_copyright, __pyx_k_copyright, sizeof(__pyx_k_copyright), 0, 0, 1, 1},
+ {&__pyx_n_s_csize, __pyx_k_csize, sizeof(__pyx_k_csize), 0, 0, 1, 1},
+ {&__pyx_n_s_cstream, __pyx_k_cstream, sizeof(__pyx_k_cstream), 0, 0, 1, 1},
+ {&__pyx_n_s_current, __pyx_k_current, sizeof(__pyx_k_current), 0, 0, 1, 1},
+ {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
+ {&__pyx_n_s_dataOut, __pyx_k_dataOut, sizeof(__pyx_k_dataOut), 0, 0, 1, 1},
+ {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1},
+ {&__pyx_n_s_dec_TY5, __pyx_k_dec_TY5, sizeof(__pyx_k_dec_TY5), 0, 0, 1, 1},
+ {&__pyx_n_s_dec_cbf, __pyx_k_dec_cbf, sizeof(__pyx_k_dec_cbf), 0, 0, 1, 1},
+ {&__pyx_n_s_dec_cbf32, __pyx_k_dec_cbf32, sizeof(__pyx_k_dec_cbf32), 0, 0, 1, 1},
+ {&__pyx_n_s_delta, __pyx_k_delta, sizeof(__pyx_k_delta), 0, 0, 1, 1},
+ {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
+ {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
+ {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
+ {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
+ {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
+ {&__pyx_n_s_fabio_ext_byte_offset, __pyx_k_fabio_ext_byte_offset, sizeof(__pyx_k_fabio_ext_byte_offset), 0, 0, 1, 1},
+ {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
+ {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
+ {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
+ {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
+ {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
+ {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
+ {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+ {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
+ {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
+ {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1},
+ {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
+ {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
+ {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
+ {&__pyx_kp_s_jerome_kieffer_esrf_eu, __pyx_k_jerome_kieffer_esrf_eu, sizeof(__pyx_k_jerome_kieffer_esrf_eu), 0, 0, 1, 0},
+ {&__pyx_n_s_key0, __pyx_k_key0, sizeof(__pyx_k_key0), 0, 0, 1, 1},
+ {&__pyx_n_s_key8, __pyx_k_key8, sizeof(__pyx_k_key8), 0, 0, 1, 1},
+ {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1},
+ {&__pyx_n_s_lenStream, __pyx_k_lenStream, sizeof(__pyx_k_lenStream), 0, 0, 1, 1},
+ {&__pyx_n_s_license, __pyx_k_license, sizeof(__pyx_k_license), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
+ {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
+ {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
+ {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
+ {&__pyx_kp_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_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
+ {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+ {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
+ {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1},
+ {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
+ {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+ {&__pyx_n_s_ravel, __pyx_k_ravel, sizeof(__pyx_k_ravel), 0, 0, 1, 1},
+ {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
+ {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
+ {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
+ {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
+ {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
+ {&__pyx_n_s_stream, __pyx_k_stream, sizeof(__pyx_k_stream), 0, 0, 1, 1},
+ {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
+ {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
+ {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
+ {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__pyx_n_s_tmp32a, __pyx_k_tmp32a, sizeof(__pyx_k_tmp32a), 0, 0, 1, 1},
+ {&__pyx_n_s_tmp32b, __pyx_k_tmp32b, sizeof(__pyx_k_tmp32b), 0, 0, 1, 1},
+ {&__pyx_n_s_tmp64, __pyx_k_tmp64, sizeof(__pyx_k_tmp64), 0, 0, 1, 1},
+ {&__pyx_n_s_tmp64a, __pyx_k_tmp64a, sizeof(__pyx_k_tmp64a), 0, 0, 1, 1},
+ {&__pyx_n_s_tmp64b, __pyx_k_tmp64b, sizeof(__pyx_k_tmp64b), 0, 0, 1, 1},
+ {&__pyx_n_s_tmp64c, __pyx_k_tmp64c, sizeof(__pyx_k_tmp64c), 0, 0, 1, 1},
+ {&__pyx_n_s_tmp64d, __pyx_k_tmp64d, sizeof(__pyx_k_tmp64d), 0, 0, 1, 1},
+ {&__pyx_n_s_tmp64e, __pyx_k_tmp64e, sizeof(__pyx_k_tmp64e), 0, 0, 1, 1},
+ {&__pyx_n_s_tmp64f, __pyx_k_tmp64f, sizeof(__pyx_k_tmp64f), 0, 0, 1, 1},
+ {&__pyx_n_s_tmp64g, __pyx_k_tmp64g, sizeof(__pyx_k_tmp64g), 0, 0, 1, 1},
+ {&__pyx_n_s_tmp8, __pyx_k_tmp8, sizeof(__pyx_k_tmp8), 0, 0, 1, 1},
+ {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
+ {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 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_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
+ {&__pyx_kp_s_workspace_valls_fabio_git_fabio, __pyx_k_workspace_valls_fabio_git_fabio, sizeof(__pyx_k_workspace_valls_fabio_git_fabio), 0, 0, 1, 0},
+ {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 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_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __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;}
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if PY_MAJOR_VERSION >= 3
+ __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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_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_);
+
+ /* "../../../usr/lib/python2.7/dist-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_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);
+
+ /* "../../../usr/lib/python2.7/dist-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_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);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
+ *
+ * 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_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);
+
+ /* "../../../usr/lib/python2.7/dist-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_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);
+
+ /* "../../../usr/lib/python2.7/dist-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_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);
+
+ /* "View.MemoryView":127
+ *
+ * if not self.ndim:
+ * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if itemsize <= 0:
+ */
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__7);
+ __Pyx_GIVEREF(__pyx_tuple__7);
+
+ /* "View.MemoryView":130
+ *
+ * if itemsize <= 0:
+ * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if isinstance(format, unicode):
+ */
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__8);
+ __Pyx_GIVEREF(__pyx_tuple__8);
+
+ /* "View.MemoryView":142
+ *
+ * if not self._shape:
+ * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__9);
+ __Pyx_GIVEREF(__pyx_tuple__9);
+
+ /* "View.MemoryView":170
+ * self.data = <char *>malloc(self.len)
+ * if not self.data:
+ * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
+ *
+ * if self.dtype_is_object:
+ */
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__10);
+ __Pyx_GIVEREF(__pyx_tuple__10);
+
+ /* "View.MemoryView":186
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
+ * info.buf = self.data
+ * info.len = self.len
+ */
+ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__11);
+ __Pyx_GIVEREF(__pyx_tuple__11);
+
+ /* "View.MemoryView":445
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
+ * else:
+ * if len(self.view.format) == 1:
+ */
+ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__12);
+ __Pyx_GIVEREF(__pyx_tuple__12);
+
+ /* "View.MemoryView":521
+ * if self.view.strides == NULL:
+ *
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ *
+ * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ */
+ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__13);
+ __Pyx_GIVEREF(__pyx_tuple__13);
+
+ /* "View.MemoryView":638
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
+ * seen_ellipsis = True
+ * else:
+ */
+ __pyx_slice__14 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_slice__14);
+ __Pyx_GIVEREF(__pyx_slice__14);
+
+ /* "View.MemoryView":641
+ * seen_ellipsis = True
+ * else:
+ * result.append(slice(None)) # <<<<<<<<<<<<<<
+ * have_slices = True
+ * else:
+ */
+ __pyx_slice__15 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_slice__15);
+ __Pyx_GIVEREF(__pyx_slice__15);
+
+ /* "View.MemoryView":652
+ * nslices = ndim - len(result)
+ * if nslices:
+ * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
+ *
+ * return have_slices or nslices, tuple(result)
+ */
+ __pyx_slice__16 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_slice__16);
+ __Pyx_GIVEREF(__pyx_slice__16);
+
+ /* "View.MemoryView":660
+ * for i in range(ndim):
+ * if suboffsets[i] >= 0:
+ * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__17);
+ __Pyx_GIVEREF(__pyx_tuple__17);
+
+ /* "fabio/ext/byte_offset.pyx":48
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def comp_cbf32(data not None): # <<<<<<<<<<<<<<
+ * """Compress a dataset using the byte-offset described for Pilatus
+ *
+ */
+ __pyx_tuple__18 = PyTuple_Pack(10, __pyx_n_s_data, __pyx_n_s_ary, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_output, __pyx_n_s_last, __pyx_n_s_current, __pyx_n_s_delta, __pyx_n_s_absdelta); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__18);
+ __Pyx_GIVEREF(__pyx_tuple__18);
+ __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_workspace_valls_fabio_git_fabio, __pyx_n_s_comp_cbf32, 48, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/byte_offset.pyx":87
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def comp_cbf(data not None): # <<<<<<<<<<<<<<
+ * """Compress a dataset using the byte-offset described for any int64
+ *
+ */
+ __pyx_tuple__20 = PyTuple_Pack(10, __pyx_n_s_data, __pyx_n_s_ary, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_output, __pyx_n_s_last, __pyx_n_s_current, __pyx_n_s_delta, __pyx_n_s_absdelta); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__20);
+ __Pyx_GIVEREF(__pyx_tuple__20);
+ __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_workspace_valls_fabio_git_fabio, __pyx_n_s_comp_cbf, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/byte_offset.pyx":143
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def dec_cbf(bytes stream not None, size=None): # <<<<<<<<<<<<<<
+ * """
+ * Analyze a stream of char with any length of exception (2,4, or 8 bytes integers)
+ */
+ __pyx_tuple__22 = PyTuple_Pack(21, __pyx_n_s_stream, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_tmp8, __pyx_n_s_last, __pyx_n_s_current, __pyx_n_s_tmp64, __pyx_n_s_tmp64a, __pyx_n_s_tmp64b, __pyx_n_s_tmp64c, __pyx_n_s_tmp64d, __pyx_n_s_tmp64e, __pyx_n_s_tmp64f, __pyx_n_s_tmp64g, __pyx_n_s_key8, __pyx_n_s_key0, __pyx_n_s_csize, __pyx_n_s_lenStream, __pyx_n_s_cstream, __pyx_n_s_dataOut); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __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, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_workspace_valls_fabio_git_fabio, __pyx_n_s_dec_cbf, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/byte_offset.pyx":220
+ *
+ * @cython.boundscheck(False)
+ * def dec_cbf32(bytes stream not None, size=None): # <<<<<<<<<<<<<<
+ * """
+ * Analyze a stream of char with any length of exception (2 or 4 bytes integers)
+ */
+ __pyx_tuple__24 = PyTuple_Pack(17, __pyx_n_s_stream, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_tmp8, __pyx_n_s_last, __pyx_n_s_current, __pyx_n_s_tmp64, __pyx_n_s_tmp64a, __pyx_n_s_tmp64b, __pyx_n_s_tmp64c, __pyx_n_s_key8, __pyx_n_s_key0, __pyx_n_s_csize, __pyx_n_s_lenStream, __pyx_n_s_cstream, __pyx_n_s_dataOut); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __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, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_workspace_valls_fabio_git_fabio, __pyx_n_s_dec_cbf32, 220, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/byte_offset.pyx":281
+ *
+ * @cython.boundscheck(False)
+ * def dec_TY5(bytes stream not None, size=None): # <<<<<<<<<<<<<<
+ * """
+ * Analyze a stream of char with a TY5 compression scheme and exception (2 or 4 bytes integers)
+ */
+ __pyx_tuple__26 = PyTuple_Pack(13, __pyx_n_s_stream, __pyx_n_s_size, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_last, __pyx_n_s_current, __pyx_n_s_key8, __pyx_n_s_tmp32a, __pyx_n_s_tmp32b, __pyx_n_s_csize, __pyx_n_s_lenStream, __pyx_n_s_cstream, __pyx_n_s_dataOut); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __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, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_workspace_valls_fabio_git_fabio, __pyx_n_s_dec_TY5, 281, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":276
+ * return self.name
+ *
+ * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>")
+ */
+ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__28);
+ __Pyx_GIVEREF(__pyx_tuple__28);
+
+ /* "View.MemoryView":277
+ *
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
+ * cdef indirect = Enum("<strided and indirect>")
+ *
+ */
+ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__29);
+ __Pyx_GIVEREF(__pyx_tuple__29);
+
+ /* "View.MemoryView":278
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__30);
+ __Pyx_GIVEREF(__pyx_tuple__30);
+
+ /* "View.MemoryView":281
+ *
+ *
+ * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>")
+ *
+ */
+ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__31);
+ __Pyx_GIVEREF(__pyx_tuple__31);
+
+ /* "View.MemoryView":282
+ *
+ * cdef contiguous = Enum("<contiguous and direct>")
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__32);
+ __Pyx_GIVEREF(__pyx_tuple__32);
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+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_2147483648 = PyInt_FromString((char *)"2147483648", 0, 0); if (unlikely(!__pyx_int_2147483648)) {__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;
+}
+
+#if PY_MAJOR_VERSION < 3
+PyMODINIT_FUNC initbyte_offset(void); /*proto*/
+PyMODINIT_FUNC initbyte_offset(void)
+#else
+PyMODINIT_FUNC PyInit_byte_offset(void); /*proto*/
+PyMODINIT_FUNC PyInit_byte_offset(void)
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_REFNANNY
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+ if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+ }
+ #endif
+ __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_byte_offset(void)", 0);
+ if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #ifdef __Pyx_CyFunction_USED
+ if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
+ /*--- Module creation code ---*/
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("byte_offset", __pyx_methods, __pyx_k_Cif_Binary_Files_images_are_2D, 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_fabio__ext__byte_offset) {
+ 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;}
+ if (!PyDict_GetItemString(modules, "fabio.ext.byte_offset")) {
+ if (unlikely(PyDict_SetItemString(modules, "fabio.ext.byte_offset", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+ /*--- 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 ---*/
+ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Global init code ---*/
+ generic = Py_None; Py_INCREF(Py_None);
+ strided = Py_None; Py_INCREF(Py_None);
+ indirect = Py_None; Py_INCREF(Py_None);
+ contiguous = Py_None; Py_INCREF(Py_None);
+ indirect_contiguous = Py_None; Py_INCREF(Py_None);
+ /*--- Variable export code ---*/
+ /*--- Function export code ---*/
+ /*--- Type init code ---*/
+ if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type___pyx_array.tp_print = 0;
+ __pyx_array_type = &__pyx_type___pyx_array;
+ if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type___pyx_MemviewEnum.tp_print = 0;
+ __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
+ __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
+ __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
+ __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
+ __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
+ __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
+ __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
+ __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
+ __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
+ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type___pyx_memoryview.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
+ __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
+ __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
+ __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
+ __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
+ __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
+ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type___pyx_memoryviewslice.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
+ /*--- Type import code ---*/
+ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
+ #if CYTHON_COMPILING_IN_PYPY
+ sizeof(PyTypeObject),
+ #else
+ sizeof(PyHeapTypeObject),
+ #endif
+ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Variable import code ---*/
+ /*--- Function import code ---*/
+ /*--- Execution code ---*/
+
+ /* "fabio/ext/byte_offset.pyx":34
+ * """
+ *
+ * __author__ = "Jerome Kieffer" # <<<<<<<<<<<<<<
+ * __contact__ = "jerome.kieffer@esrf.eu"
+ * __license__ = "MIT"
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_s_Jerome_Kieffer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/byte_offset.pyx":35
+ *
+ * __author__ = "Jerome Kieffer"
+ * __contact__ = "jerome.kieffer@esrf.eu" # <<<<<<<<<<<<<<
+ * __license__ = "MIT"
+ * __copyright__ = "2010-2016, European Synchrotron Radiation Facility, Grenoble, France"
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_contact, __pyx_kp_s_jerome_kieffer_esrf_eu) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/byte_offset.pyx":36
+ * __author__ = "Jerome Kieffer"
+ * __contact__ = "jerome.kieffer@esrf.eu"
+ * __license__ = "MIT" # <<<<<<<<<<<<<<
+ * __copyright__ = "2010-2016, European Synchrotron Radiation Facility, Grenoble, France"
+ * __date__ = "25/07/2017"
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/byte_offset.pyx":37
+ * __contact__ = "jerome.kieffer@esrf.eu"
+ * __license__ = "MIT"
+ * __copyright__ = "2010-2016, European Synchrotron Radiation Facility, Grenoble, France" # <<<<<<<<<<<<<<
+ * __date__ = "25/07/2017"
+ *
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_2010_2016_European_Synchrotron_R) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/byte_offset.pyx":38
+ * __license__ = "MIT"
+ * __copyright__ = "2010-2016, European Synchrotron Radiation Facility, Grenoble, France"
+ * __date__ = "25/07/2017" # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_25_07_2017) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/byte_offset.pyx":42
+ *
+ * cimport numpy
+ * import numpy # <<<<<<<<<<<<<<
+ * import cython
+ *
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/byte_offset.pyx":48
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def comp_cbf32(data not None): # <<<<<<<<<<<<<<
+ * """Compress a dataset using the byte-offset described for Pilatus
+ *
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5fabio_3ext_11byte_offset_1comp_cbf32, NULL, __pyx_n_s_fabio_ext_byte_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_comp_cbf32, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/byte_offset.pyx":87
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def comp_cbf(data not None): # <<<<<<<<<<<<<<
+ * """Compress a dataset using the byte-offset described for any int64
+ *
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5fabio_3ext_11byte_offset_3comp_cbf, NULL, __pyx_n_s_fabio_ext_byte_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_comp_cbf, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/byte_offset.pyx":143
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def dec_cbf(bytes stream not None, size=None): # <<<<<<<<<<<<<<
+ * """
+ * Analyze a stream of char with any length of exception (2,4, or 8 bytes integers)
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5fabio_3ext_11byte_offset_5dec_cbf, NULL, __pyx_n_s_fabio_ext_byte_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_dec_cbf, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/byte_offset.pyx":220
+ *
+ * @cython.boundscheck(False)
+ * def dec_cbf32(bytes stream not None, size=None): # <<<<<<<<<<<<<<
+ * """
+ * Analyze a stream of char with any length of exception (2 or 4 bytes integers)
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5fabio_3ext_11byte_offset_7dec_cbf32, NULL, __pyx_n_s_fabio_ext_byte_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_dec_cbf32, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/byte_offset.pyx":281
+ *
+ * @cython.boundscheck(False)
+ * def dec_TY5(bytes stream not None, size=None): # <<<<<<<<<<<<<<
+ * """
+ * Analyze a stream of char with a TY5 compression scheme and exception (2 or 4 bytes integers)
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5fabio_3ext_11byte_offset_9dec_TY5, NULL, __pyx_n_s_fabio_ext_byte_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_dec_TY5, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/byte_offset.pyx":1
+ * # coding: utf-8 # <<<<<<<<<<<<<<
+ * #
+ * # Project: X-ray image reader
+ */
+ __pyx_t_1 = PyDict_New(); 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 (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __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;
+
+ /* "View.MemoryView":203
+ * info.obj = self
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
+ *
+ * def __dealloc__(array self):
+ */
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ PyType_Modified(__pyx_array_type);
+
+ /* "View.MemoryView":276
+ * return self.name
+ *
+ * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>")
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(generic);
+ __Pyx_DECREF_SET(generic, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":277
+ *
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
+ * cdef indirect = Enum("<strided and indirect>")
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(strided);
+ __Pyx_DECREF_SET(strided, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":278
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(indirect);
+ __Pyx_DECREF_SET(indirect, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":281
+ *
+ *
+ * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>")
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(contiguous);
+ __Pyx_DECREF_SET(contiguous, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":282
+ *
+ * cdef contiguous = Enum("<contiguous and direct>")
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(indirect_contiguous);
+ __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":496
+ * info.obj = self
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ PyType_Modified(__pyx_memoryview_type);
+
+ /* "View.MemoryView":953
+ * return self.from_object
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ PyType_Modified(__pyx_memoryviewslice_type);
+
+ /* "View.MemoryView":1361
+ *
+ * @cname('__pyx_memoryview__slice_assign_scalar')
+ * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * size_t itemsize, void *item) nogil:
+ */
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init fabio.ext.byte_offset", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_DECREF(__pyx_m); __pyx_m = 0;
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init fabio.ext.byte_offset");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if PY_MAJOR_VERSION < 3
+ return;
+ #else
+ return __pyx_m;
+ #endif
+}
+
+/* Runtime support code */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+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;
+}
+
+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
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+ PyObject *self, *result;
+ PyCFunction cfunc;
+ cfunc = PyCFunction_GET_FUNCTION(func);
+ self = PyCFunction_GET_SELF(func);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = cfunc(self, arg);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_New(1);
+ if (unlikely(!args)) return NULL;
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(args, 0, arg);
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+ return __Pyx_PyObject_CallMethO(func, arg);
+ }
+ }
+ return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject* args = PyTuple_Pack(1, arg);
+ return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
+ return __Pyx_PyObject_CallMethO(func, NULL);
+ }
+ }
+ return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
+}
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
+ PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
+ PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
+ int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyMappingMethods* mp;
+#if PY_MAJOR_VERSION < 3
+ PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
+ if (likely(ms && ms->sq_slice)) {
+ if (!has_cstart) {
+ if (_py_start && (*_py_start != Py_None)) {
+ cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
+ if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
+ } else
+ cstart = 0;
+ }
+ if (!has_cstop) {
+ if (_py_stop && (*_py_stop != Py_None)) {
+ cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
+ if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
+ } else
+ cstop = PY_SSIZE_T_MAX;
+ }
+ if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
+ Py_ssize_t l = ms->sq_length(obj);
+ if (likely(l >= 0)) {
+ if (cstop < 0) {
+ cstop += l;
+ if (cstop < 0) cstop = 0;
+ }
+ if (cstart < 0) {
+ cstart += l;
+ if (cstart < 0) cstart = 0;
+ }
+ } else {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError))
+ PyErr_Clear();
+ else
+ goto bad;
+ }
+ }
+ return ms->sq_slice(obj, cstart, cstop);
+ }
+#endif
+ mp = Py_TYPE(obj)->tp_as_mapping;
+ if (likely(mp && mp->mp_subscript))
+#endif
+ {
+ PyObject* result;
+ PyObject *py_slice, *py_start, *py_stop;
+ if (_py_slice) {
+ py_slice = *_py_slice;
+ } else {
+ PyObject* owned_start = NULL;
+ PyObject* owned_stop = NULL;
+ if (_py_start) {
+ py_start = *_py_start;
+ } else {
+ if (has_cstart) {
+ owned_start = py_start = PyInt_FromSsize_t(cstart);
+ if (unlikely(!py_start)) goto bad;
+ } else
+ py_start = Py_None;
+ }
+ if (_py_stop) {
+ py_stop = *_py_stop;
+ } else {
+ if (has_cstop) {
+ owned_stop = py_stop = PyInt_FromSsize_t(cstop);
+ if (unlikely(!py_stop)) {
+ Py_XDECREF(owned_start);
+ goto bad;
+ }
+ } else
+ py_stop = Py_None;
+ }
+ py_slice = PySlice_New(py_start, py_stop, Py_None);
+ Py_XDECREF(owned_start);
+ Py_XDECREF(owned_stop);
+ if (unlikely(!py_slice)) goto bad;
+ }
+#if CYTHON_COMPILING_IN_CPYTHON
+ result = mp->mp_subscript(obj, py_slice);
+#else
+ result = PyObject_GetItem(obj, py_slice);
+#endif
+ if (!_py_slice) {
+ Py_DECREF(py_slice);
+ }
+ return result;
+ }
+ PyErr_Format(PyExc_TypeError,
+ "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
+bad:
+ return NULL;
+}
+
+static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
+ unsigned int n = 1;
+ return *(unsigned char*)(&n) != 0;
+}
+static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type) {
+ stack[0].field = &ctx->root;
+ stack[0].parent_offset = 0;
+ ctx->root.type = type;
+ ctx->root.name = "buffer dtype";
+ ctx->root.offset = 0;
+ ctx->head = stack;
+ ctx->head->field = &ctx->root;
+ ctx->fmt_offset = 0;
+ ctx->head->parent_offset = 0;
+ ctx->new_packmode = '@';
+ ctx->enc_packmode = '@';
+ ctx->new_count = 1;
+ ctx->enc_count = 0;
+ ctx->enc_type = 0;
+ ctx->is_complex = 0;
+ ctx->is_valid_array = 0;
+ ctx->struct_alignment = 0;
+ while (type->typegroup == 'S') {
+ ++ctx->head;
+ ctx->head->field = type->fields;
+ ctx->head->parent_offset = 0;
+ type = type->fields->type;
+ }
+}
+static int __Pyx_BufFmt_ParseNumber(const char** ts) {
+ int count;
+ const char* t = *ts;
+ if (*t < '0' || *t > '9') {
+ return -1;
+ } else {
+ count = *t++ - '0';
+ while (*t >= '0' && *t < '9') {
+ count *= 10;
+ count += *t++ - '0';
+ }
+ }
+ *ts = t;
+ return count;
+}
+static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
+ int number = __Pyx_BufFmt_ParseNumber(ts);
+ if (number == -1)
+ PyErr_Format(PyExc_ValueError,\
+ "Does not understand character buffer dtype format string ('%c')", **ts);
+ return number;
+}
+static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
+ PyErr_Format(PyExc_ValueError,
+ "Unexpected format string character: '%c'", ch);
+}
+static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
+ switch (ch) {
+ case 'c': return "'char'";
+ case 'b': return "'signed char'";
+ case 'B': return "'unsigned char'";
+ case 'h': return "'short'";
+ case 'H': return "'unsigned short'";
+ case 'i': return "'int'";
+ case 'I': return "'unsigned int'";
+ case 'l': return "'long'";
+ case 'L': return "'unsigned long'";
+ case 'q': return "'long long'";
+ case 'Q': return "'unsigned long long'";
+ case 'f': return (is_complex ? "'complex float'" : "'float'");
+ case 'd': return (is_complex ? "'complex double'" : "'double'");
+ case 'g': return (is_complex ? "'complex long double'" : "'long double'");
+ case 'T': return "a struct";
+ case 'O': return "Python object";
+ case 'P': return "a pointer";
+ case 's': case 'p': return "a string";
+ case 0: return "end";
+ default: return "unparseable format string";
+ }
+}
+static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return 2;
+ case 'i': case 'I': case 'l': case 'L': return 4;
+ case 'q': case 'Q': return 8;
+ case 'f': return (is_complex ? 8 : 4);
+ case 'd': return (is_complex ? 16 : 8);
+ case 'g': {
+ PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
+ return 0;
+ }
+ case 'O': case 'P': return sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
+ switch (ch) {
+ case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(short);
+ case 'i': case 'I': return sizeof(int);
+ case 'l': case 'L': return sizeof(long);
+ #ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(PY_LONG_LONG);
+ #endif
+ case 'f': return sizeof(float) * (is_complex ? 2 : 1);
+ case 'd': return sizeof(double) * (is_complex ? 2 : 1);
+ case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
+ case 'O': case 'P': return sizeof(void*);
+ default: {
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+ }
+}
+typedef struct { char c; short x; } __Pyx_st_short;
+typedef struct { char c; int x; } __Pyx_st_int;
+typedef struct { char c; long x; } __Pyx_st_long;
+typedef struct { char c; float x; } __Pyx_st_float;
+typedef struct { char c; double x; } __Pyx_st_double;
+typedef struct { char c; long double x; } __Pyx_st_longdouble;
+typedef struct { char c; void *x; } __Pyx_st_void_p;
+#ifdef HAVE_LONG_LONG
+typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
+#endif
+static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
+ case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
+ case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
+#ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
+#endif
+ case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
+ case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
+ case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
+ case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+/* These are for computing the padding at the end of the struct to align
+ on the first member of the struct. This will probably the same as above,
+ but we don't have any guarantees.
+ */
+typedef struct { short x; char c; } __Pyx_pad_short;
+typedef struct { int x; char c; } __Pyx_pad_int;
+typedef struct { long x; char c; } __Pyx_pad_long;
+typedef struct { float x; char c; } __Pyx_pad_float;
+typedef struct { double x; char c; } __Pyx_pad_double;
+typedef struct { long double x; char c; } __Pyx_pad_longdouble;
+typedef struct { void *x; char c; } __Pyx_pad_void_p;
+#ifdef HAVE_LONG_LONG
+typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
+#endif
+static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
+ case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
+ case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
+#ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
+#endif
+ case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
+ case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
+ case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
+ case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
+ switch (ch) {
+ case 'c':
+ return 'H';
+ case 'b': case 'h': case 'i':
+ case 'l': case 'q': case 's': case 'p':
+ return 'I';
+ case 'B': case 'H': case 'I': case 'L': case 'Q':
+ return 'U';
+ case 'f': case 'd': case 'g':
+ return (is_complex ? 'C' : 'R');
+ case 'O':
+ return 'O';
+ case 'P':
+ return 'P';
+ default: {
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+ }
+}
+static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
+ if (ctx->head == NULL || ctx->head->field == &ctx->root) {
+ const char* expected;
+ const char* quote;
+ if (ctx->head == NULL) {
+ expected = "end";
+ quote = "";
+ } else {
+ expected = ctx->head->field->type->name;
+ quote = "'";
+ }
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch, expected %s%s%s but got %s",
+ quote, expected, quote,
+ __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
+ } else {
+ __Pyx_StructField* field = ctx->head->field;
+ __Pyx_StructField* parent = (ctx->head - 1)->field;
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
+ field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
+ parent->type->name, field->name);
+ }
+}
+static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
+ char group;
+ size_t size, offset, arraysize = 1;
+ if (ctx->enc_type == 0) return 0;
+ if (ctx->head->field->type->arraysize[0]) {
+ int i, ndim = 0;
+ if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
+ ctx->is_valid_array = ctx->head->field->type->ndim == 1;
+ ndim = 1;
+ if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
+ PyErr_Format(PyExc_ValueError,
+ "Expected a dimension of size %zu, got %zu",
+ ctx->head->field->type->arraysize[0], ctx->enc_count);
+ return -1;
+ }
+ }
+ if (!ctx->is_valid_array) {
+ PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
+ ctx->head->field->type->ndim, ndim);
+ return -1;
+ }
+ for (i = 0; i < ctx->head->field->type->ndim; i++) {
+ arraysize *= ctx->head->field->type->arraysize[i];
+ }
+ ctx->is_valid_array = 0;
+ ctx->enc_count = 1;
+ }
+ group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
+ do {
+ __Pyx_StructField* field = ctx->head->field;
+ __Pyx_TypeInfo* type = field->type;
+ if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
+ size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
+ } else {
+ size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
+ }
+ if (ctx->enc_packmode == '@') {
+ size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
+ size_t align_mod_offset;
+ if (align_at == 0) return -1;
+ align_mod_offset = ctx->fmt_offset % align_at;
+ if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
+ if (ctx->struct_alignment == 0)
+ ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
+ ctx->is_complex);
+ }
+ if (type->size != size || type->typegroup != group) {
+ if (type->typegroup == 'C' && type->fields != NULL) {
+ size_t parent_offset = ctx->head->parent_offset + field->offset;
+ ++ctx->head;
+ ctx->head->field = type->fields;
+ ctx->head->parent_offset = parent_offset;
+ continue;
+ }
+ if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
+ } else {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return -1;
+ }
+ }
+ offset = ctx->head->parent_offset + field->offset;
+ if (ctx->fmt_offset != offset) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
+ (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
+ return -1;
+ }
+ ctx->fmt_offset += size;
+ if (arraysize)
+ ctx->fmt_offset += (arraysize - 1) * size;
+ --ctx->enc_count;
+ while (1) {
+ if (field == &ctx->root) {
+ ctx->head = NULL;
+ if (ctx->enc_count != 0) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return -1;
+ }
+ break;
+ }
+ ctx->head->field = ++field;
+ if (field->type == NULL) {
+ --ctx->head;
+ field = ctx->head->field;
+ continue;
+ } else if (field->type->typegroup == 'S') {
+ size_t parent_offset = ctx->head->parent_offset + field->offset;
+ if (field->type->fields->type == NULL) continue;
+ field = field->type->fields;
+ ++ctx->head;
+ ctx->head->field = field;
+ ctx->head->parent_offset = parent_offset;
+ break;
+ } else {
+ break;
+ }
+ }
+ } while (ctx->enc_count);
+ ctx->enc_type = 0;
+ ctx->is_complex = 0;
+ return 0;
+}
+static CYTHON_INLINE PyObject *
+__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
+{
+ const char *ts = *tsp;
+ int i = 0, number;
+ int ndim = ctx->head->field->type->ndim;
+;
+ ++ts;
+ if (ctx->new_count != 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "Cannot handle repeated arrays in format string");
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ while (*ts && *ts != ')') {
+ 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])
+ return PyErr_Format(PyExc_ValueError,
+ "Expected a dimension of size %zu, got %d",
+ ctx->head->field->type->arraysize[i], number);
+ if (*ts != ',' && *ts != ')')
+ return PyErr_Format(PyExc_ValueError,
+ "Expected a comma in format string, got '%c'", *ts);
+ if (*ts == ',') ts++;
+ i++;
+ }
+ if (i != ndim)
+ return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
+ ctx->head->field->type->ndim, i);
+ if (!*ts) {
+ PyErr_SetString(PyExc_ValueError,
+ "Unexpected end of format string, expected ')'");
+ return NULL;
+ }
+ ctx->is_valid_array = 1;
+ ctx->new_count = 1;
+ *tsp = ++ts;
+ return Py_None;
+}
+static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
+ int got_Z = 0;
+ while (1) {
+ switch(*ts) {
+ case 0:
+ if (ctx->enc_type != 0 && ctx->head == NULL) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ if (ctx->head != NULL) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return NULL;
+ }
+ return ts;
+ case ' ':
+ case '\r':
+ case '\n':
+ ++ts;
+ break;
+ case '<':
+ if (!__Pyx_IsLittleEndian()) {
+ PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
+ return NULL;
+ }
+ ctx->new_packmode = '=';
+ ++ts;
+ break;
+ case '>':
+ case '!':
+ if (__Pyx_IsLittleEndian()) {
+ PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
+ return NULL;
+ }
+ ctx->new_packmode = '=';
+ ++ts;
+ break;
+ case '=':
+ case '@':
+ case '^':
+ ctx->new_packmode = *ts++;
+ break;
+ case 'T':
+ {
+ const char* ts_after_sub;
+ size_t i, struct_count = ctx->new_count;
+ size_t struct_alignment = ctx->struct_alignment;
+ ctx->new_count = 1;
+ ++ts;
+ if (*ts != '{') {
+ PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->enc_type = 0;
+ ctx->enc_count = 0;
+ ctx->struct_alignment = 0;
+ ++ts;
+ ts_after_sub = ts;
+ for (i = 0; i != struct_count; ++i) {
+ ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
+ if (!ts_after_sub) return NULL;
+ }
+ ts = ts_after_sub;
+ if (struct_alignment) ctx->struct_alignment = struct_alignment;
+ }
+ break;
+ case '}':
+ {
+ size_t alignment = ctx->struct_alignment;
+ ++ts;
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->enc_type = 0;
+ if (alignment && ctx->fmt_offset % alignment) {
+ ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
+ }
+ }
+ return ts;
+ case 'x':
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->fmt_offset += ctx->new_count;
+ ctx->new_count = 1;
+ ctx->enc_count = 0;
+ ctx->enc_type = 0;
+ ctx->enc_packmode = ctx->new_packmode;
+ ++ts;
+ break;
+ case 'Z':
+ got_Z = 1;
+ ++ts;
+ if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
+ __Pyx_BufFmt_RaiseUnexpectedChar('Z');
+ return NULL;
+ }
+ 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 'p':
+ if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
+ ctx->enc_packmode == ctx->new_packmode) {
+ ctx->enc_count += ctx->new_count;
+ 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;
+ break;
+ case ':':
+ ++ts;
+ while(*ts != ':') ++ts;
+ ++ts;
+ break;
+ case '(':
+ if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
+ break;
+ default:
+ {
+ int number = __Pyx_BufFmt_ExpectNumber(&ts);
+ if (number == -1) return NULL;
+ ctx->new_count = (size_t)number;
+ }
+ }
+ }
+}
+static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
+ buf->buf = NULL;
+ buf->obj = NULL;
+ buf->strides = __Pyx_zeros;
+ buf->shape = __Pyx_zeros;
+ buf->suboffsets = __Pyx_minusones;
+}
+static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
+ Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
+ int nd, int cast, __Pyx_BufFmt_StackElem* stack)
+{
+ if (obj == Py_None || obj == NULL) {
+ __Pyx_ZeroBuffer(buf);
+ return 0;
+ }
+ buf->buf = NULL;
+ if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
+ if (buf->ndim != nd) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer has wrong number of dimensions (expected %d, got %d)",
+ nd, buf->ndim);
+ goto fail;
+ }
+ if (!cast) {
+ __Pyx_BufFmt_Context ctx;
+ __Pyx_BufFmt_Init(&ctx, stack, dtype);
+ if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
+ }
+ if ((unsigned)buf->itemsize != dtype->size) {
+ PyErr_Format(PyExc_ValueError,
+ "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
+ buf->itemsize, (buf->itemsize > 1) ? "s" : "",
+ dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
+ goto fail;
+ }
+ if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
+ return 0;
+fail:;
+ __Pyx_ZeroBuffer(buf);
+ return -1;
+}
+static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
+ if (info->buf == NULL) return;
+ if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
+ __Pyx_ReleaseBuffer(info);
+}
+
+static int
+__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
+ int ndim,
+ __Pyx_memviewslice *memviewslice,
+ int memview_is_new_reference)
+{
+ __Pyx_RefNannyDeclarations
+ int i, retval=-1;
+ Py_buffer *buf = &memview->view;
+ __Pyx_RefNannySetupContext("init_memviewslice", 0);
+ if (!buf) {
+ PyErr_SetString(PyExc_ValueError,
+ "buf is NULL.");
+ goto fail;
+ } else if (memviewslice->memview || memviewslice->data) {
+ PyErr_SetString(PyExc_ValueError,
+ "memviewslice is already initialized!");
+ goto fail;
+ }
+ if (buf->strides) {
+ for (i = 0; i < ndim; i++) {
+ memviewslice->strides[i] = buf->strides[i];
+ }
+ } else {
+ Py_ssize_t stride = buf->itemsize;
+ for (i = ndim - 1; i >= 0; i--) {
+ memviewslice->strides[i] = stride;
+ stride *= buf->shape[i];
+ }
+ }
+ for (i = 0; i < ndim; i++) {
+ memviewslice->shape[i] = buf->shape[i];
+ if (buf->suboffsets) {
+ memviewslice->suboffsets[i] = buf->suboffsets[i];
+ } else {
+ memviewslice->suboffsets[i] = -1;
+ }
+ }
+ memviewslice->memview = memview;
+ memviewslice->data = (char *)buf->buf;
+ if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
+ Py_INCREF(memview);
+ }
+ retval = 0;
+ goto no_fail;
+fail:
+ memviewslice->memview = 0;
+ memviewslice->data = 0;
+ retval = -1;
+no_fail:
+ __Pyx_RefNannyFinishContext();
+ return retval;
+}
+static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) {
+ va_list vargs;
+ char msg[200];
+ va_start(vargs, fmt);
+#ifdef HAVE_STDARG_PROTOTYPES
+ va_start(vargs, fmt);
+#else
+ va_start(vargs);
+#endif
+ vsnprintf(msg, 200, fmt, vargs);
+ Py_FatalError(msg);
+ va_end(vargs);
+}
+static CYTHON_INLINE int
+__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
+ PyThread_type_lock lock)
+{
+ int result;
+ PyThread_acquire_lock(lock, 1);
+ result = (*acquisition_count)++;
+ PyThread_release_lock(lock);
+ return result;
+}
+static CYTHON_INLINE int
+__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
+ PyThread_type_lock lock)
+{
+ int result;
+ PyThread_acquire_lock(lock, 1);
+ result = (*acquisition_count)--;
+ PyThread_release_lock(lock);
+ return result;
+}
+static CYTHON_INLINE void
+__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
+{
+ int first_time;
+ struct __pyx_memoryview_obj *memview = memslice->memview;
+ if (!memview || (PyObject *) memview == Py_None)
+ return;
+ if (__pyx_get_slice_count(memview) < 0)
+ __pyx_fatalerror("Acquisition count is %d (line %d)",
+ __pyx_get_slice_count(memview), lineno);
+ first_time = __pyx_add_acquisition_count(memview) == 0;
+ if (first_time) {
+ if (have_gil) {
+ Py_INCREF((PyObject *) memview);
+ } else {
+ PyGILState_STATE _gilstate = PyGILState_Ensure();
+ Py_INCREF((PyObject *) memview);
+ PyGILState_Release(_gilstate);
+ }
+ }
+}
+static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
+ int have_gil, int lineno) {
+ int last_time;
+ struct __pyx_memoryview_obj *memview = memslice->memview;
+ if (!memview ) {
+ return;
+ } else if ((PyObject *) memview == Py_None) {
+ memslice->memview = NULL;
+ return;
+ }
+ if (__pyx_get_slice_count(memview) <= 0)
+ __pyx_fatalerror("Acquisition count is %d (line %d)",
+ __pyx_get_slice_count(memview), lineno);
+ last_time = __pyx_sub_acquisition_count(memview) == 1;
+ memslice->data = NULL;
+ if (last_time) {
+ if (have_gil) {
+ Py_CLEAR(memslice->memview);
+ } else {
+ PyGILState_STATE _gilstate = PyGILState_Ensure();
+ Py_CLEAR(memslice->memview);
+ PyGILState_Release(_gilstate);
+ }
+ } else {
+ memslice->memview = NULL;
+ }
+}
+
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AsString(kw_name));
+ #endif
+}
+
+static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ name = first_kw_arg;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ values[name-argnames] = value;
+ continue;
+ }
+ name = first_kw_arg;
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
+ while (*name) {
+ if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**name, key)) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ if ((**argname == key) || (
+ (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**argname, key))) {
+ goto arg_passed_twice;
+ }
+ argname++;
+ }
+ }
+ } else
+ #endif
+ if (likely(PyUnicode_Check(key))) {
+ while (*name) {
+ int cmp = (**name == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**name, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ int cmp = (**argname == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**argname, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) goto arg_passed_twice;
+ argname++;
+ }
+ }
+ } else
+ goto invalid_keyword_type;
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, key);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+bad:
+ return -1;
+}
+
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *more_or_less;
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+ func_name, more_or_less, num_expected,
+ (num_expected == 1) ? "" : "s", num_found);
+}
+
+static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+ PyErr_Format(PyExc_TypeError,
+ "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
+ name, type->tp_name, Py_TYPE(obj)->tp_name);
+}
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+ const char *name, int exact)
+{
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ if (none_allowed && obj == Py_None) return 1;
+ else if (exact) {
+ if (likely(Py_TYPE(obj) == type)) return 1;
+ #if PY_MAJOR_VERSION == 2
+ else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
+ #endif
+ }
+ else {
+ if (likely(PyObject_TypeCheck(obj, type))) return 1;
+ }
+ __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
+ return 0;
+}
+
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ if (likely(PyObject_TypeCheck(obj, type)))
+ return 1;
+ PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
+ Py_TYPE(obj)->tp_name, type->tp_name);
+ return 0;
+}
+
+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;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_Restore(type, value, tb);
+#endif
+}
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(type, value, tb);
+#endif
+}
+
+#if PY_MAJOR_VERSION < 3
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
+ CYTHON_UNUSED PyObject *cause) {
+ Py_XINCREF(type);
+ if (!value || value == Py_None)
+ value = NULL;
+ else
+ Py_INCREF(value);
+ if (!tb || tb == Py_None)
+ tb = NULL;
+ else {
+ Py_INCREF(tb);
+ if (!PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto raise_error;
+ }
+ }
+ if (PyType_Check(type)) {
+#if CYTHON_COMPILING_IN_PYPY
+ if (!value) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#endif
+ PyErr_NormalizeException(&type, &value, &tb);
+ } else {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto raise_error;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(type);
+ Py_INCREF(type);
+ if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto raise_error;
+ }
+ }
+ __Pyx_ErrRestore(type, value, tb);
+ return;
+raise_error:
+ Py_XDECREF(value);
+ Py_XDECREF(type);
+ Py_XDECREF(tb);
+ return;
+}
+#else
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
+ PyObject* owned_instance = NULL;
+ if (tb == Py_None) {
+ tb = 0;
+ } else if (tb && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto bad;
+ }
+ if (value == Py_None)
+ value = 0;
+ if (PyExceptionInstance_Check(type)) {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto bad;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(value);
+ } else if (PyExceptionClass_Check(type)) {
+ PyObject *instance_class = NULL;
+ if (value && PyExceptionInstance_Check(value)) {
+ instance_class = (PyObject*) Py_TYPE(value);
+ if (instance_class != type) {
+ if (PyObject_IsSubclass(instance_class, type)) {
+ type = instance_class;
+ } else {
+ instance_class = NULL;
+ }
+ }
+ }
+ if (!instance_class) {
+ PyObject *args;
+ if (!value)
+ args = PyTuple_New(0);
+ else if (PyTuple_Check(value)) {
+ Py_INCREF(value);
+ args = value;
+ } else
+ args = PyTuple_Pack(1, value);
+ if (!args)
+ goto bad;
+ owned_instance = PyObject_Call(type, args, NULL);
+ Py_DECREF(args);
+ if (!owned_instance)
+ goto bad;
+ value = owned_instance;
+ if (!PyExceptionInstance_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "calling %R should have returned an instance of "
+ "BaseException, not %R",
+ type, Py_TYPE(value));
+ goto bad;
+ }
+ }
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto bad;
+ }
+#if PY_VERSION_HEX >= 0x03030000
+ if (cause) {
+#else
+ if (cause && cause != Py_None) {
+#endif
+ PyObject *fixed_cause;
+ if (cause == Py_None) {
+ fixed_cause = NULL;
+ } else if (PyExceptionClass_Check(cause)) {
+ fixed_cause = PyObject_CallObject(cause, NULL);
+ if (fixed_cause == NULL)
+ goto bad;
+ } else if (PyExceptionInstance_Check(cause)) {
+ fixed_cause = cause;
+ Py_INCREF(fixed_cause);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "exception causes must derive from "
+ "BaseException");
+ goto bad;
+ }
+ PyException_SetCause(value, fixed_cause);
+ }
+ PyErr_SetObject(type, value);
+ if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
+ Py_INCREF(tb);
+ PyErr_Restore(tmp_type, tmp_value, tb);
+ Py_XDECREF(tmp_tb);
+#else
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject* tmp_tb = tstate->curexc_traceback;
+ if (tb != tmp_tb) {
+ Py_INCREF(tb);
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_tb);
+ }
+#endif
+ }
+bad:
+ Py_XDECREF(owned_instance);
+ return;
+}
+#endif
+
+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 CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+#if CYTHON_COMPILING_IN_PYPY
+ return PyObject_RichCompareBool(s1, s2, equals);
+#else
+ if (s1 == s2) {
+ return (equals == Py_EQ);
+ } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
+ const char *ps1, *ps2;
+ Py_ssize_t length = PyBytes_GET_SIZE(s1);
+ if (length != PyBytes_GET_SIZE(s2))
+ return (equals == Py_NE);
+ ps1 = PyBytes_AS_STRING(s1);
+ ps2 = PyBytes_AS_STRING(s2);
+ if (ps1[0] != ps2[0]) {
+ return (equals == Py_NE);
+ } else if (length == 1) {
+ return (equals == Py_EQ);
+ } else {
+ int result = memcmp(ps1, ps2, (size_t)length);
+ return (equals == Py_EQ) ? (result == 0) : (result != 0);
+ }
+ } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
+ return (equals == Py_NE);
+ } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
+ return (equals == Py_NE);
+ } else {
+ int result;
+ PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
+ if (!py_result)
+ return -1;
+ result = __Pyx_PyObject_IsTrue(py_result);
+ Py_DECREF(py_result);
+ return result;
+ }
+#endif
+}
+
+static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+#if CYTHON_COMPILING_IN_PYPY
+ return PyObject_RichCompareBool(s1, s2, equals);
+#else
+#if PY_MAJOR_VERSION < 3
+ PyObject* owned_ref = NULL;
+#endif
+ int s1_is_unicode, s2_is_unicode;
+ if (s1 == s2) {
+ goto return_eq;
+ }
+ s1_is_unicode = PyUnicode_CheckExact(s1);
+ s2_is_unicode = PyUnicode_CheckExact(s2);
+#if PY_MAJOR_VERSION < 3
+ if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
+ owned_ref = PyUnicode_FromObject(s2);
+ if (unlikely(!owned_ref))
+ return -1;
+ s2 = owned_ref;
+ s2_is_unicode = 1;
+ } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
+ owned_ref = PyUnicode_FromObject(s1);
+ if (unlikely(!owned_ref))
+ return -1;
+ s1 = owned_ref;
+ s1_is_unicode = 1;
+ } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
+ return __Pyx_PyBytes_Equals(s1, s2, equals);
+ }
+#endif
+ if (s1_is_unicode & s2_is_unicode) {
+ Py_ssize_t length;
+ int kind;
+ void *data1, *data2;
+ if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
+ return -1;
+ length = __Pyx_PyUnicode_GET_LENGTH(s1);
+ if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
+ goto return_ne;
+ }
+ kind = __Pyx_PyUnicode_KIND(s1);
+ if (kind != __Pyx_PyUnicode_KIND(s2)) {
+ goto return_ne;
+ }
+ data1 = __Pyx_PyUnicode_DATA(s1);
+ data2 = __Pyx_PyUnicode_DATA(s2);
+ if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
+ goto return_ne;
+ } else if (length == 1) {
+ goto return_eq;
+ } else {
+ int result = memcmp(data1, data2, (size_t)(length * kind));
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_EQ) ? (result == 0) : (result != 0);
+ }
+ } else if ((s1 == Py_None) & s2_is_unicode) {
+ goto return_ne;
+ } else if ((s2 == Py_None) & s1_is_unicode) {
+ goto return_ne;
+ } else {
+ int result;
+ PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
+ if (!py_result)
+ return -1;
+ result = __Pyx_PyObject_IsTrue(py_result);
+ Py_DECREF(py_result);
+ return result;
+ }
+return_eq:
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_EQ);
+return_ne:
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_NE);
+#endif
+}
+
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
+ Py_ssize_t q = a / b;
+ Py_ssize_t r = a - q*b;
+ q -= ((r != 0) & ((r ^ b) < 0));
+ return q;
+}
+
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
+#if CYTHON_COMPILING_IN_CPYTHON
+#if PY_MAJOR_VERSION >= 3
+ if (likely(PyUnicode_Check(n)))
+#else
+ if (likely(PyString_Check(n)))
+#endif
+ return __Pyx_PyObject_GetAttrStr(o, n);
+#endif
+ return PyObject_GetAttr(o, n);
+}
+
+static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+ const char* cstring, Py_ssize_t start, Py_ssize_t stop,
+ const char* encoding, const char* errors,
+ PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
+ Py_ssize_t length;
+ if (unlikely((start < 0) | (stop < 0))) {
+ length = strlen(cstring);
+ if (start < 0) {
+ start += length;
+ if (start < 0)
+ start = 0;
+ }
+ if (stop < 0)
+ stop += length;
+ }
+ length = stop - start;
+ if (unlikely(length <= 0))
+ return PyUnicode_FromUnicode(NULL, 0);
+ cstring += start;
+ if (decode_func) {
+ return decode_func(cstring, length, errors);
+ } else {
+ return PyUnicode_Decode(cstring, length, encoding, errors);
+ }
+}
+
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->exc_type;
+ *value = tstate->exc_value;
+ *tb = tstate->exc_traceback;
+ Py_XINCREF(*type);
+ Py_XINCREF(*value);
+ Py_XINCREF(*tb);
+#else
+ PyErr_GetExcInfo(type, value, tb);
+#endif
+}
+static void __Pyx_ExceptionReset(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->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = type;
+ tstate->exc_value = value;
+ tstate->exc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(type, value, tb);
+#endif
+}
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *local_type, *local_value, *local_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ local_type = tstate->curexc_type;
+ local_value = tstate->curexc_value;
+ local_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(&local_type, &local_value, &local_tb);
+#endif
+ PyErr_NormalizeException(&local_type, &local_value, &local_tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(tstate->curexc_type))
+#else
+ if (unlikely(PyErr_Occurred()))
+#endif
+ goto bad;
+ #if PY_MAJOR_VERSION >= 3
+ if (local_tb) {
+ if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+ goto bad;
+ }
+ #endif
+ Py_XINCREF(local_tb);
+ Py_XINCREF(local_type);
+ Py_XINCREF(local_value);
+ *type = local_type;
+ *value = local_value;
+ *tb = local_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = local_type;
+ tstate->exc_value = local_value;
+ tstate->exc_traceback = local_tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
+#endif
+ return 0;
+bad:
+ *type = 0;
+ *value = 0;
+ *tb = 0;
+ Py_XDECREF(local_type);
+ Py_XDECREF(local_value);
+ Py_XDECREF(local_tb);
+ return -1;
+}
+
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = *type;
+ tstate->exc_value = *value;
+ tstate->exc_traceback = *tb;
+#else
+ PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
+ PyErr_SetExcInfo(*type, *value, *tb);
+#endif
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
+
+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_RaiseUnboundLocalError(const char *varname) {
+ PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
+}
+
+static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
+ long q = a / b;
+ long r = a - q*b;
+ q -= ((r != 0) & ((r ^ b) < 0));
+ return q;
+}
+
+static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+ CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
+ int full_traceback) {
+ PyObject *old_exc, *old_val, *old_tb;
+ PyObject *ctx;
+ __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
+ if (full_traceback) {
+ Py_XINCREF(old_exc);
+ Py_XINCREF(old_val);
+ Py_XINCREF(old_tb);
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ PyErr_PrintEx(1);
+ }
+ #if PY_MAJOR_VERSION < 3
+ ctx = PyString_FromString(name);
+ #else
+ ctx = PyUnicode_FromString(name);
+ #endif
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ if (!ctx) {
+ PyErr_WriteUnraisable(Py_None);
+ } else {
+ PyErr_WriteUnraisable(ctx);
+ Py_DECREF(ctx);
+ }
+}
+
+static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+#if PY_VERSION_HEX >= 0x02070000
+ PyObject *ob = PyCapsule_New(vtable, 0, 0);
+#else
+ PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
+#endif
+ if (!ob)
+ goto bad;
+ if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
+ goto bad;
+ Py_DECREF(ob);
+ return 0;
+bad:
+ Py_XDECREF(ob);
+ return -1;
+}
+
+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) {
+ if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
+ if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
+ if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
+ if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
+ 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;
+ if (!obj) return;
+ if (PyObject_CheckBuffer(obj)) {
+ PyBuffer_Release(view);
+ return;
+ }
+ if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(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_npy_int32(npy_int32 value) {
+ const npy_int32 neg_one = (npy_int32) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(npy_int32) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(npy_int32) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(npy_int32) <= 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(npy_int32),
+ 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 npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
+ const npy_int32 neg_one = (npy_int32) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(npy_int32) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (npy_int32) 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(npy_int32, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(npy_int32) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, 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(npy_int32, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(npy_int32) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong(x))
+ } else if (sizeof(npy_int32) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, 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
+ npy_int32 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 (npy_int32) -1;
+ }
+ } else {
+ npy_int32 val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (npy_int32) -1;
+ val = __Pyx_PyInt_As_npy_int32(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to npy_int32");
+ return (npy_int32) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to npy_int32");
+ return (npy_int32) -1;
+}
+
+static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int32_t(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_npy_int32(*(__pyx_t_5numpy_int32_t *) itemp);
+}
+static int __pyx_memview_set_nn___pyx_t_5numpy_int32_t(const char *itemp, PyObject *obj) {
+ __pyx_t_5numpy_int32_t value = __Pyx_PyInt_As_npy_int32(obj);
+ if ((value == (npy_int32)-1) && PyErr_Occurred())
+ return 0;
+ *(__pyx_t_5numpy_int32_t *) itemp = value;
+ return 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;
+}
+
+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);
+ }
+}
+
+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 PyObject* __Pyx_PyInt_From_npy_int8(npy_int8 value) {
+ const npy_int8 neg_one = (npy_int8) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(npy_int8) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(npy_int8) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(npy_int8) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(npy_int8) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(npy_int8) <= 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(npy_int8),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE npy_int8 __Pyx_PyInt_As_npy_int8(PyObject *x) {
+ const npy_int8 neg_one = (npy_int8) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(npy_int8) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int8, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (npy_int8) 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(npy_int8, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(npy_int8) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int8, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(npy_int8) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int8, 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(npy_int8, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(npy_int8, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(npy_int8) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int8, long, PyLong_AsLong(x))
+ } else if (sizeof(npy_int8) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int8, 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
+ npy_int8 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 (npy_int8) -1;
+ }
+ } else {
+ npy_int8 val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (npy_int8) -1;
+ val = __Pyx_PyInt_As_npy_int8(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to npy_int8");
+ return (npy_int8) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to npy_int8");
+ return (npy_int8) -1;
+}
+
+static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int8_t(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_npy_int8(*(__pyx_t_5numpy_int8_t *) itemp);
+}
+static int __pyx_memview_set_nn___pyx_t_5numpy_int8_t(const char *itemp, PyObject *obj) {
+ __pyx_t_5numpy_int8_t value = __Pyx_PyInt_As_npy_int8(obj);
+ if ((value == (npy_int8)-1) && PyErr_Occurred())
+ return 0;
+ *(__pyx_t_5numpy_int8_t *) itemp = value;
+ return 1;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) {
+ const npy_int64 neg_one = (npy_int64) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(npy_int64) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(npy_int64) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(npy_int64) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(npy_int64) <= 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(npy_int64),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) {
+ const npy_int64 neg_one = (npy_int64) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(npy_int64) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (npy_int64) 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(npy_int64, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(npy_int64) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(npy_int64) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int64, 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(npy_int64, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(npy_int64, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(npy_int64) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int64, long, PyLong_AsLong(x))
+ } else if (sizeof(npy_int64) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int64, 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
+ npy_int64 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 (npy_int64) -1;
+ }
+ } else {
+ npy_int64 val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (npy_int64) -1;
+ val = __Pyx_PyInt_As_npy_int64(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to npy_int64");
+ return (npy_int64) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to npy_int64");
+ return (npy_int64) -1;
+}
+
+static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_npy_int64(*(__pyx_t_5numpy_int64_t *) itemp);
+}
+static int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj) {
+ __pyx_t_5numpy_int64_t value = __Pyx_PyInt_As_npy_int64(obj);
+ if ((value == (npy_int64)-1) && PyErr_Occurred())
+ return 0;
+ *(__pyx_t_5numpy_int64_t *) itemp = value;
+ return 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;
+ }
+#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;
+ z.real = a.real + b.real;
+ z.imag = a.imag + b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ z.real = a.real - b.real;
+ z.imag = a.imag - b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ z.real = a.real * b.real - a.imag * b.imag;
+ z.imag = a.real * b.imag + a.imag * b.real;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ float denom = b.real * b.real + b.imag * b.imag;
+ z.real = (a.real * b.real + a.imag * b.imag) / denom;
+ z.imag = (a.imag * b.real - a.real * b.imag) / denom;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
+ __pyx_t_float_complex z;
+ z.real = -a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
+ return (a.real == 0) && (a.imag == 0);
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
+ __pyx_t_float_complex z;
+ z.real = a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ #if 1
+ static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
+ #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
+ return sqrtf(z.real*z.real + z.imag*z.imag);
+ #else
+ return hypotf(z.real, z.imag);
+ #endif
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ float r, lnr, theta, z_r, z_theta;
+ if (b.imag == 0 && b.real == (int)b.real) {
+ if (b.real < 0) {
+ float denom = a.real * a.real + a.imag * a.imag;
+ a.real = a.real / denom;
+ a.imag = -a.imag / denom;
+ b.real = -b.real;
+ }
+ switch ((int)b.real) {
+ case 0:
+ z.real = 1;
+ z.imag = 0;
+ return z;
+ case 1:
+ return a;
+ case 2:
+ z = __Pyx_c_prodf(a, a);
+ return __Pyx_c_prodf(a, a);
+ case 3:
+ z = __Pyx_c_prodf(a, a);
+ return __Pyx_c_prodf(z, a);
+ case 4:
+ z = __Pyx_c_prodf(a, a);
+ return __Pyx_c_prodf(z, z);
+ }
+ }
+ if (a.imag == 0) {
+ if (a.real == 0) {
+ return a;
+ }
+ r = a.real;
+ theta = 0;
+ } else {
+ r = __Pyx_c_absf(a);
+ theta = atan2f(a.imag, a.real);
+ }
+ lnr = logf(r);
+ z_r = expf(lnr * b.real - theta * b.imag);
+ z_theta = theta * b.real + lnr * b.imag;
+ z.real = z_r * cosf(z_theta);
+ z.imag = z_r * sinf(z_theta);
+ return z;
+ }
+ #endif
+#endif
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ return ::std::complex< double >(x, y);
+ }
+ #else
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ return x + y*(__pyx_t_double_complex)_Complex_I;
+ }
+ #endif
+#else
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ __pyx_t_double_complex z;
+ z.real = x;
+ z.imag = y;
+ return z;
+ }
+#endif
+
+#if CYTHON_CCOMPLEX
+#else
+ static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ return (a.real == b.real) && (a.imag == b.imag);
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real + b.real;
+ z.imag = a.imag + b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real - b.real;
+ z.imag = a.imag - b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real * b.real - a.imag * b.imag;
+ z.imag = a.real * b.imag + a.imag * b.real;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ double denom = b.real * b.real + b.imag * b.imag;
+ z.real = (a.real * b.real + a.imag * b.imag) / denom;
+ z.imag = (a.imag * b.real - a.real * b.imag) / denom;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
+ __pyx_t_double_complex z;
+ z.real = -a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
+ return (a.real == 0) && (a.imag == 0);
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
+ __pyx_t_double_complex z;
+ z.real = a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ #if 1
+ static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
+ #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
+ return sqrt(z.real*z.real + z.imag*z.imag);
+ #else
+ return hypot(z.real, z.imag);
+ #endif
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ double r, lnr, theta, z_r, z_theta;
+ if (b.imag == 0 && b.real == (int)b.real) {
+ if (b.real < 0) {
+ double denom = a.real * a.real + a.imag * a.imag;
+ a.real = a.real / denom;
+ a.imag = -a.imag / denom;
+ b.real = -b.real;
+ }
+ switch ((int)b.real) {
+ case 0:
+ z.real = 1;
+ z.imag = 0;
+ return z;
+ case 1:
+ 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 int
+__pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
+ char order, int ndim)
+{
+ int i, index, step, start;
+ Py_ssize_t itemsize = mvs->memview->view.itemsize;
+ if (order == 'F') {
+ step = 1;
+ start = 0;
+ } else {
+ step = -1;
+ start = ndim - 1;
+ }
+ for (i = 0; i < ndim; i++) {
+ index = start + step * i;
+ if (mvs->suboffsets[index] >= 0 || mvs->strides[index] != itemsize)
+ return 0;
+ itemsize *= mvs->shape[index];
+ }
+ return 1;
+}
+
+static void
+__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
+ void **out_start, void **out_end,
+ int ndim, size_t itemsize)
+{
+ char *start, *end;
+ int i;
+ start = end = slice->data;
+ for (i = 0; i < ndim; i++) {
+ Py_ssize_t stride = slice->strides[i];
+ Py_ssize_t extent = slice->shape[i];
+ if (extent == 0) {
+ *out_start = *out_end = start;
+ return;
+ } else {
+ if (stride > 0)
+ end += stride * (extent - 1);
+ else
+ start += stride * (extent - 1);
+ }
+ }
+ *out_start = start;
+ *out_end = end + itemsize;
+}
+static int
+__pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize)
+{
+ void *start1, *end1, *start2, *end2;
+ __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
+ __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
+ return (start1 < end2) && (start2 < end1);
+}
+
+static __Pyx_memviewslice
+__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
+ const char *mode, int ndim,
+ size_t sizeof_dtype, int contig_flag,
+ int dtype_is_object)
+{
+ __Pyx_RefNannyDeclarations
+ int i;
+ __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
+ struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
+ Py_buffer *buf = &from_memview->view;
+ PyObject *shape_tuple = NULL;
+ PyObject *temp_int = NULL;
+ struct __pyx_array_obj *array_obj = NULL;
+ struct __pyx_memoryview_obj *memview_obj = NULL;
+ __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
+ for (i = 0; i < ndim; i++) {
+ if (from_mvs->suboffsets[i] >= 0) {
+ PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
+ "indirect dimensions (axis %d)", i);
+ goto fail;
+ }
+ }
+ shape_tuple = PyTuple_New(ndim);
+ if (unlikely(!shape_tuple)) {
+ goto fail;
+ }
+ __Pyx_GOTREF(shape_tuple);
+ for(i = 0; i < ndim; i++) {
+ temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
+ if(unlikely(!temp_int)) {
+ goto fail;
+ } else {
+ PyTuple_SET_ITEM(shape_tuple, i, temp_int);
+ temp_int = NULL;
+ }
+ }
+ array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
+ if (unlikely(!array_obj)) {
+ goto fail;
+ }
+ __Pyx_GOTREF(array_obj);
+ memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
+ (PyObject *) array_obj, contig_flag,
+ dtype_is_object,
+ from_mvs->memview->typeinfo);
+ if (unlikely(!memview_obj))
+ goto fail;
+ if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
+ goto fail;
+ if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
+ dtype_is_object) < 0))
+ goto fail;
+ goto no_fail;
+fail:
+ __Pyx_XDECREF(new_mvs.memview);
+ new_mvs.memview = NULL;
+ new_mvs.data = NULL;
+no_fail:
+ __Pyx_XDECREF(shape_tuple);
+ __Pyx_XDECREF(temp_int);
+ __Pyx_XDECREF(array_obj);
+ __Pyx_RefNannyFinishContext();
+ return new_mvs;
+}
+
+static CYTHON_INLINE PyObject *
+__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
+{
+ PyObject *cobj;
+#if PY_VERSION_HEX >= 0x02070000
+ cobj = PyCapsule_New(p, sig, NULL);
+#else
+ cobj = PyCObject_FromVoidPtr(p, NULL);
+#endif
+ return cobj;
+}
+
+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;
+}
+
+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
+ 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
+ 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;
+}
+
+static int
+__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
+{
+ int i;
+ if (!a || !b)
+ return 0;
+ if (a == b)
+ return 1;
+ if (a->size != b->size || a->typegroup != b->typegroup ||
+ a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
+ if (a->typegroup == 'H' || b->typegroup == 'H') {
+ return a->size == b->size;
+ } else {
+ return 0;
+ }
+ }
+ if (a->ndim) {
+ for (i = 0; i < a->ndim; i++)
+ if (a->arraysize[i] != b->arraysize[i])
+ return 0;
+ }
+ if (a->typegroup == 'S') {
+ if (a->flags != b->flags)
+ return 0;
+ if (a->fields || b->fields) {
+ if (!(a->fields && b->fields))
+ return 0;
+ for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
+ __Pyx_StructField *field_a = a->fields + i;
+ __Pyx_StructField *field_b = b->fields + i;
+ if (field_a->offset != field_b->offset ||
+ !__pyx_typeinfo_cmp(field_a->type, field_b->type))
+ return 0;
+ }
+ return !a->fields[i].type && !b->fields[i].type;
+ }
+ }
+ return 1;
+}
+
+static int
+__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
+{
+ if (buf->shape[dim] <= 1)
+ return 1;
+ if (buf->strides) {
+ if (spec & __Pyx_MEMVIEW_CONTIG) {
+ if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
+ if (buf->strides[dim] != sizeof(void *)) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer is not indirectly contiguous "
+ "in dimension %d.", dim);
+ goto fail;
+ }
+ } else if (buf->strides[dim] != buf->itemsize) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer and memoryview are not contiguous "
+ "in the same dimension.");
+ goto fail;
+ }
+ }
+ if (spec & __Pyx_MEMVIEW_FOLLOW) {
+ Py_ssize_t stride = buf->strides[dim];
+ if (stride < 0)
+ stride = -stride;
+ if (stride < buf->itemsize) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer and memoryview are not contiguous "
+ "in the same dimension.");
+ goto fail;
+ }
+ }
+ } else {
+ if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
+ PyErr_Format(PyExc_ValueError,
+ "C-contiguous buffer is not contiguous in "
+ "dimension %d", dim);
+ goto fail;
+ } else if (spec & (__Pyx_MEMVIEW_PTR)) {
+ PyErr_Format(PyExc_ValueError,
+ "C-contiguous buffer is not indirect in "
+ "dimension %d", dim);
+ goto fail;
+ } else if (buf->suboffsets) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer exposes suboffsets but no strides");
+ goto fail;
+ }
+ }
+ return 1;
+fail:
+ return 0;
+}
+static int
+__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
+{
+ if (spec & __Pyx_MEMVIEW_DIRECT) {
+ if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer not compatible with direct access "
+ "in dimension %d.", dim);
+ goto fail;
+ }
+ }
+ if (spec & __Pyx_MEMVIEW_PTR) {
+ if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer is not indirectly accessible "
+ "in dimension %d.", dim);
+ goto fail;
+ }
+ }
+ return 1;
+fail:
+ return 0;
+}
+static int
+__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
+{
+ int i;
+ if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
+ Py_ssize_t stride = 1;
+ for (i = 0; i < ndim; i++) {
+ if (stride * buf->itemsize != buf->strides[i] &&
+ buf->shape[i] > 1)
+ {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer not fortran contiguous.");
+ goto fail;
+ }
+ stride = stride * buf->shape[i];
+ }
+ } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
+ Py_ssize_t stride = 1;
+ for (i = ndim - 1; i >- 1; i--) {
+ if (stride * buf->itemsize != buf->strides[i] &&
+ buf->shape[i] > 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer not C contiguous.");
+ goto fail;
+ }
+ stride = stride * buf->shape[i];
+ }
+ }
+ return 1;
+fail:
+ return 0;
+}
+static int __Pyx_ValidateAndInit_memviewslice(
+ int *axes_specs,
+ int c_or_f_flag,
+ int buf_flags,
+ int ndim,
+ __Pyx_TypeInfo *dtype,
+ __Pyx_BufFmt_StackElem stack[],
+ __Pyx_memviewslice *memviewslice,
+ PyObject *original_obj)
+{
+ struct __pyx_memoryview_obj *memview, *new_memview;
+ __Pyx_RefNannyDeclarations
+ Py_buffer *buf;
+ int i, spec = 0, retval = -1;
+ __Pyx_BufFmt_Context ctx;
+ int from_memoryview = __pyx_memoryview_check(original_obj);
+ __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
+ if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
+ original_obj)->typeinfo)) {
+ memview = (struct __pyx_memoryview_obj *) original_obj;
+ new_memview = NULL;
+ } else {
+ memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
+ original_obj, buf_flags, 0, dtype);
+ new_memview = memview;
+ if (unlikely(!memview))
+ goto fail;
+ }
+ buf = &memview->view;
+ if (buf->ndim != ndim) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer has wrong number of dimensions (expected %d, got %d)",
+ ndim, buf->ndim);
+ goto fail;
+ }
+ if (new_memview) {
+ __Pyx_BufFmt_Init(&ctx, stack, dtype);
+ if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
+ }
+ if ((unsigned) buf->itemsize != dtype->size) {
+ PyErr_Format(PyExc_ValueError,
+ "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
+ "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
+ buf->itemsize,
+ (buf->itemsize > 1) ? "s" : "",
+ dtype->name,
+ dtype->size,
+ (dtype->size > 1) ? "s" : "");
+ goto fail;
+ }
+ for (i = 0; i < ndim; i++) {
+ spec = axes_specs[i];
+ if (!__pyx_check_strides(buf, i, ndim, spec))
+ goto fail;
+ if (!__pyx_check_suboffsets(buf, i, ndim, spec))
+ goto fail;
+ }
+ if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
+ goto fail;
+ if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
+ new_memview != NULL) == -1)) {
+ goto fail;
+ }
+ retval = 0;
+ goto no_fail;
+fail:
+ Py_XDECREF(new_memview);
+ retval = -1;
+no_fail:
+ __Pyx_RefNannyFinishContext();
+ return retval;
+}
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(PyObject *obj) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
+ (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 1,
+ &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int8_t(PyObject *obj) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
+ (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 1,
+ &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(PyObject *obj) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
+ (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 1,
+ &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *obj) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
+ PyBUF_RECORDS, 1,
+ &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+static int __Pyx_check_binary_version(void) {
+ char ctversion[4], rtversion[4];
+ PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
+ if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
+ char message[200];
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+#ifndef __PYX_HAVE_RT_ImportModule
+#define __PYX_HAVE_RT_ImportModule
+static PyObject *__Pyx_ImportModule(const char *name) {
+ PyObject *py_name = 0;
+ PyObject *py_module = 0;
+ py_name = __Pyx_PyIdentifier_FromString(name);
+ if (!py_name)
+ goto bad;
+ py_module = PyImport_Import(py_name);
+ Py_DECREF(py_name);
+ return py_module;
+bad:
+ Py_XDECREF(py_name);
+ return 0;
+}
+#endif
+
+#ifndef __PYX_HAVE_RT_ImportType
+#define __PYX_HAVE_RT_ImportType
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
+ size_t size, int strict)
+{
+ PyObject *py_module = 0;
+ PyObject *result = 0;
+ PyObject *py_name = 0;
+ char warning[200];
+ Py_ssize_t basicsize;
+#ifdef Py_LIMITED_API
+ PyObject *py_basicsize;
+#endif
+ py_module = __Pyx_ImportModule(module_name);
+ if (!py_module)
+ goto bad;
+ py_name = __Pyx_PyIdentifier_FromString(class_name);
+ if (!py_name)
+ goto bad;
+ result = PyObject_GetAttr(py_module, py_name);
+ Py_DECREF(py_name);
+ py_name = 0;
+ Py_DECREF(py_module);
+ py_module = 0;
+ if (!result)
+ goto bad;
+ if (!PyType_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.%.200s is not a type object",
+ module_name, class_name);
+ goto bad;
+ }
+#ifndef Py_LIMITED_API
+ basicsize = ((PyTypeObject *)result)->tp_basicsize;
+#else
+ py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
+ if (!py_basicsize)
+ goto bad;
+ basicsize = PyLong_AsSsize_t(py_basicsize);
+ Py_DECREF(py_basicsize);
+ py_basicsize = 0;
+ if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
+ goto bad;
+#endif
+ if (!strict && (size_t)basicsize > size) {
+ PyOS_snprintf(warning, sizeof(warning),
+ "%s.%s size changed, may indicate binary incompatibility",
+ module_name, class_name);
+ if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
+ }
+ else if ((size_t)basicsize != size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s has the wrong size, try recompiling",
+ module_name, class_name);
+ goto bad;
+ }
+ return (PyTypeObject *)result;
+bad:
+ Py_XDECREF(py_module);
+ Py_XDECREF(result);
+ return NULL;
+}
+#endif
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __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;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+ PyNumberMethods *m;
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (PyInt_Check(x) || PyLong_Check(x))
+#else
+ if (PyLong_Check(x))
+#endif
+ return Py_INCREF(x), x;
+ m = Py_TYPE(x)->tp_as_number;
+#if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = PyNumber_Long(x);
+ }
+#else
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Long(x);
+ }
+#endif
+ if (res) {
+#if PY_MAJOR_VERSION < 3
+ if (!PyInt_Check(res) && !PyLong_Check(res)) {
+#else
+ if (!PyLong_Check(res)) {
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ name, name, Py_TYPE(res)->tp_name);
+ Py_DECREF(res);
+ return NULL;
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b)))
+ 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) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/fabio/ext/byte_offset.pyx b/fabio/ext/byte_offset.pyx
new file mode 100644
index 0000000..3f4f682
--- /dev/null
+++ b/fabio/ext/byte_offset.pyx
@@ -0,0 +1,358 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/kif/fabio
+#
+# Copyright (C) 2015 European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+"""
+Cif Binary Files images are 2D images written by the Pilatus detector and others.
+They use a modified (simplified) byte-offset algorithm. This file contains the
+decompression function from a string to an int64 numpy array.
+"""
+
+__author__ = "Jerome Kieffer"
+__contact__ = "jerome.kieffer@esrf.eu"
+__license__ = "MIT"
+__copyright__ = "2010-2016, European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "11/08/2017"
+
+
+cimport numpy
+import numpy
+import cython
+
+
+@cython.boundscheck(False)
+@cython.wraparound(False)
+def comp_cbf32(data not None):
+ """Compress a dataset using the byte-offset described for Pilatus
+
+ :param data: array of integers
+ :return: numpy array of chars
+ """
+ cdef:
+ numpy.int32_t[::1] ary = numpy.ascontiguousarray(data.ravel(), dtype=numpy.int32)
+ int size = ary.size, i = 0, j = 0
+ numpy.int8_t[::1] output = numpy.zeros(size * 7, dtype=numpy.int8)
+ numpy.int32_t last, current, delta, absdelta
+ last = 0
+ for i in range(size):
+ current = ary[i]
+ delta = current - last
+ absdelta = delta if delta > 0 else -delta
+ if absdelta >= 1 << 15:
+ output[j] = -128
+ output[j + 1] = 0
+ output[j + 2] = -128
+ output[j + 3] = (delta & 255)
+ output[j + 4] = (delta >> 8) & 255
+ output[j + 5] = (delta >> 16) & 255
+ output[j + 6] = (delta >> 24)
+ j += 7
+ elif absdelta >= 1 << 7:
+ output[j] = -128
+ output[j + 1] = delta & 255
+ output[j + 2] = (delta >> 8) & 255
+ j += 3
+ else:
+ output[j] = delta
+ j += 1
+ last = current
+ return numpy.asarray(output)[:j]
+
+
+@cython.boundscheck(False)
+@cython.wraparound(False)
+def comp_cbf(data not None):
+ """Compress a dataset using the byte-offset described for any int64
+
+ :param data: array of integers
+ :return: numpy array of chars
+ """
+ cdef:
+ numpy.int64_t[::1] ary = numpy.ascontiguousarray(data.ravel(), dtype=numpy.int64)
+ int size = ary.size, i = 0, j = 0
+ numpy.int8_t[::1] output = numpy.zeros(size * 15, dtype=numpy.int8)
+ numpy.int64_t last, current, delta, absdelta
+ last = 0
+ for i in range(size):
+ current = ary[i]
+ delta = current - last
+ absdelta = delta if delta > 0 else -delta
+ if absdelta >= 1 << 31:
+ output[j] = -128
+ output[j + 1] = 0
+ output[j + 2] = -128
+ output[j + 3] = 0
+ output[j + 4] = 0
+ output[j + 5] = 0
+ output[j + 6] = -128
+ output[j + 7] = (delta & 255)
+ output[j + 8] = (delta >> 8) & 255
+ output[j + 9] = (delta >> 16) & 255
+ output[j + 10] = (delta >> 24) & 255
+ output[j + 11] = (delta >> 32) & 255
+ output[j + 12] = (delta >> 40) & 255
+ output[j + 13] = (delta >> 48) & 255
+ output[j + 14] = (delta >> 56) & 255
+ j += 15
+ elif absdelta >= 1 << 15:
+ output[j] = -128
+ output[j + 1] = 0
+ output[j + 2] = -128
+ output[j + 3] = (delta & 255)
+ output[j + 4] = (delta >> 8) & 255
+ output[j + 5] = (delta >> 16) & 255
+ output[j + 6] = (delta >> 24)
+ j += 7
+ elif absdelta >= 1 << 7:
+ output[j] = -128
+ output[j + 1] = delta & 255
+ output[j + 2] = (delta >> 8) & 255
+ j += 3
+ else:
+ output[j] = delta
+ j += 1
+ last = current
+ return numpy.asarray(output)[:j]
+
+
+@cython.boundscheck(False)
+@cython.wraparound(False)
+def dec_cbf(bytes stream not None, size=None):
+ """
+ Analyze a stream of char with any length of exception (2,4, or 8 bytes integers)
+ :param stream: bytes (string) representing the compressed data
+ :param size: the size of the output array (of longInts)
+ :return: int64 ndArrays
+ """
+ cdef:
+ int i = 0
+ int j = 0
+ numpy.uint8_t tmp8 = 0
+
+ numpy.int64_t last = 0
+ numpy.int64_t current = 0
+ numpy.int64_t tmp64 = 0
+ numpy.int64_t tmp64a = 0
+ numpy.int64_t tmp64b = 0
+ numpy.int64_t tmp64c = 0
+ numpy.int64_t tmp64d = 0
+ numpy.int64_t tmp64e = 0
+ numpy.int64_t tmp64f = 0
+ numpy.int64_t tmp64g = 0
+
+ numpy.uint8_t key8 = 0x80
+ numpy.uint8_t key0 = 0x00
+
+ int csize
+ int lenStream = < int > len(stream)
+ numpy.uint8_t[:] cstream = bytearray(stream)
+ if size is None:
+ csize = lenStream
+ else:
+ csize = < int > size
+ cdef numpy.ndarray[numpy.int64_t, ndim = 1] dataOut = numpy.empty(csize, dtype=numpy.int64)
+ with nogil:
+ while (i < lenStream) and (j < csize):
+ if (cstream[i] == key8):
+ if ((cstream[i + 1] == key0) and (cstream[i + 2] == key8)):
+ if (cstream[i + 3] == key0) and (cstream[i + 4] == key0) and (cstream[i + 5] == key0) and (cstream[i + 6] == key8):
+ # Retrieve the interesting Bytes of data
+ tmp64g = cstream[i + 7]
+ tmp64f = cstream[i + 8]
+ tmp64e = cstream[i + 9]
+ tmp64d = cstream[i + 10]
+ tmp64c = cstream[i + 11]
+ tmp64b = cstream[i + 12]
+ tmp64a = cstream[i + 13]
+ tmp64 = <numpy.int8_t> cstream[i + 14]
+ # Assemble data into a 64 bits integer
+ current = (tmp64 << 56) | (tmp64a << 48) | (tmp64b << 40) | (tmp64c << 32) | (tmp64d << 24) | (tmp64e << 16) | (tmp64f << 8) | (tmp64g)
+ i += 15
+ else:
+ # Retrieve the interesting Bytes of data
+ tmp64c = cstream[i + 3]
+ tmp64b = cstream[i + 4]
+ tmp64a = cstream[i + 5]
+ tmp64 = <numpy.int8_t> cstream[i + 6]
+ # Assemble data into a 64 bits integer
+ current = (tmp64 << 24) | (tmp64a << 16) | (tmp64b << 8) | (tmp64c)
+ i += 7
+ else:
+ tmp64a = cstream[i + 1]
+ tmp64 = <numpy.int8_t> cstream[i + 2]
+
+ current = (tmp64 << 8) | (tmp64a)
+ i += 3
+ else:
+ current = (<numpy.int8_t> cstream[i])
+ i += 1
+ last += current
+ dataOut[j] = last
+ j += 1
+
+ return dataOut[:j]
+
+
+@cython.boundscheck(False)
+def dec_cbf32(bytes stream not None, size=None):
+ """
+ Analyze a stream of char with any length of exception (2 or 4 bytes integers)
+ Optimized for int32 decompression
+
+ :param stream: bytes (string) representing the compressed data
+ :param size: the size of the output array (of longInts)
+ :return: int64 ndArrays
+ """
+ cdef:
+ int i = 0
+ int j = 0
+ numpy.uint8_t tmp8 = 0
+
+ numpy.int32_t last = 0
+ numpy.int32_t current = 0
+ numpy.int32_t tmp64 = 0
+ numpy.int32_t tmp64a = 0
+ numpy.int32_t tmp64b = 0
+ numpy.int32_t tmp64c = 0
+
+ numpy.uint8_t key8 = 0x80
+ numpy.uint8_t key0 = 0x00
+
+ int csize
+ int lenStream = < int > len(stream)
+ numpy.uint8_t[:] cstream = bytearray(stream)
+ if size is None:
+ csize = lenStream
+ else:
+ csize = < int > size
+ cdef numpy.ndarray[numpy.int32_t, ndim = 1] dataOut = numpy.empty(csize, dtype=numpy.int32)
+ with nogil:
+ while (i < lenStream) and (j < csize):
+ if (cstream[i] == key8):
+ if ((cstream[i + 1] == key0) and (cstream[i + 2] == key8)):
+ # Retrieve the interesting Bytes of data
+ tmp64c = cstream[i + 3]
+ tmp64b = cstream[i + 4]
+ tmp64a = cstream[i + 5]
+ tmp64 = <numpy.int8_t> cstream[i + 6]
+ # Assemble data into a 32 bits integer
+ current = (tmp64 << 24) | (tmp64a << 16) | (tmp64b << 8) | (tmp64c)
+ i += 7
+ else:
+ tmp64a = cstream[i + 1]
+ tmp64 = <numpy.int8_t> cstream[i + 2]
+
+ current = (tmp64 << 8) | (tmp64a)
+ i += 3
+ else:
+ current = (<numpy.int8_t> cstream[i])
+ i += 1
+ last += current
+ dataOut[j] = last
+ j += 1
+
+ return dataOut[:j]
+
+
+@cython.boundscheck(False)
+def dec_TY5(bytes stream not None, size=None):
+ """
+ Analyze a stream of char with a TY5 compression scheme and exception (2 or 4 bytes integers)
+
+ TODO: known broken, FIXME
+
+ :param stream: bytes (string) representing the compressed data
+ :param size: the size of the output array (of longInts)
+ :return: int32 ndArrays
+ """
+
+ cdef:
+ int i = 0
+ int j = 0
+ numpy.int32_t last = 0
+ numpy.int32_t current = 0
+
+ # numpy.uint8_t tmp8 = 0
+ numpy.uint8_t key8 = 0xfe # 127+127
+
+ numpy.int32_t tmp32a = 0
+ numpy.int32_t tmp32b = 0
+ # numpy.int32_t tmp32c = 0
+ # numpy.int32_t tmp32d = 0
+
+ int csize
+ int lenStream = len(stream)
+ numpy.uint8_t[:] cstream = bytearray(stream)
+ if size is None:
+ csize = lenStream
+ else:
+ csize = < int > size
+
+ cdef numpy.ndarray[numpy.int32_t, ndim = 1] dataOut = numpy.zeros(csize, dtype=numpy.int32)
+ if True:
+ while (i < lenStream) and (j < csize):
+ if (cstream[i] == key8):
+ tmp32a = cstream[i + 1] - 127
+ tmp32b = <numpy.int16_t>( <numpy.int8_t> cstream[i + 2] << 8 )
+ # print(tmp32a, tmp32b, (tmp32b|tmp32a))
+ current = (tmp32b) | (tmp32a)
+ i += 3
+ else:
+ current = <numpy.int32_t>(<numpy.uint8_t> cstream[i]) - 127
+ i += 1
+ last += current
+ dataOut[j] = last
+ j += 1
+ return dataOut[:j]
+
+# # determines the current position in the bitstream
+# position=headersize+columnnumber*row+column+offset
+# value=float(file[position])-127
+# if value<127:
+# # this is the normal case
+# # two bytes encode one pixel
+# basevalue=value+basevalue
+# data[row][column]=basevalue
+# elif value==127:
+# # this is the special case 1
+# # if the marker 127 is found the next four bytes encode one pixel
+# if float(file[position+2]) < 127:
+# # resulting value is positive
+# value=(float(file[position+1]))+255*(float(file[position+2]))
+# elif float(file[position+2]) > 127:
+# # resulting value is negative
+# value=float(file[position+1])+255*(float(file[position+2])-256)
+# basevalue=value+basevalue
+# data[row][column]=basevalue
+# offset=offset+2
+# if float(file[position+0])+float(file[position+1])==510:
+# # this is the special case 1
+# # i do not know what is going on
+# print('special case i can not explain.')
+# offset=offset+8
+# if basevalue > 500:
+# # just a way to cut off very high intensities
+# data[row][column]=500
diff --git a/fabio/ext/cf_io.c b/fabio/ext/cf_io.c
new file mode 100644
index 0000000..aad2571
--- /dev/null
+++ b/fabio/ext/cf_io.c
@@ -0,0 +1,6727 @@
+/* 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 < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+ #error Cython requires Python 2.6+ or Python 3.2+.
+#else
+#define CYTHON_ABI "0_21_1"
+#include <stddef.h>
+#ifndef offsetof
+#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+#define CYTHON_COMPILING_IN_PYPY 1
+#define CYTHON_COMPILING_IN_CPYTHON 0
+#else
+#define CYTHON_COMPILING_IN_PYPY 0
+#define CYTHON_COMPILING_IN_CPYTHON 1
+#endif
+#if 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+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define Py_TPFLAGS_CHECKTYPES 0
+ #define Py_TPFLAGS_HAVE_INDEX 0
+ #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_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
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t PyInt_AsLong
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#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_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
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+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
+
+
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+#define _USE_MATH_DEFINES
+#endif
+#include <math.h>
+#define __PYX_HAVE__fabio__ext__cf_io
+#define __PYX_HAVE_API__fabio__ext__cf_io
+#include "string.h"
+#include "stdio.h"
+#include "stdlib.h"
+#include "numpy/arrayobject.h"
+#include "numpy/ufuncobject.h"
+#include "columnfile.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#ifdef PYREX_WITHOUT_ASSERTIONS
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+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);
+#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
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+#if !defined(CYTHON_CCOMPLEX)
+ #if defined(__cplusplus)
+ #define CYTHON_CCOMPLEX 1
+ #elif defined(_Complex_I)
+ #define CYTHON_CCOMPLEX 1
+ #else
+ #define CYTHON_CCOMPLEX 0
+ #endif
+#endif
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ #include <complex>
+ #else
+ #include <complex.h>
+ #endif
+#endif
+#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
+ #undef _Complex_I
+ #define _Complex_I 1.0fj
+#endif
+
+
+static const char *__pyx_f[] = {
+ "fabio/ext/cf_io.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;
+ struct __Pyx_StructField_* fields;
+ size_t size;
+ size_t arraysize[8];
+ int ndim;
+ char typegroup;
+ char is_unsigned;
+ int flags;
+} __Pyx_TypeInfo;
+typedef struct __Pyx_StructField_ {
+ __Pyx_TypeInfo* type;
+ const char* name;
+ size_t offset;
+} __Pyx_StructField;
+typedef struct {
+ __Pyx_StructField* field;
+ size_t parent_offset;
+} __Pyx_BufFmt_StackElem;
+typedef struct {
+ __Pyx_StructField root;
+ __Pyx_BufFmt_StackElem* head;
+ size_t fmt_offset;
+ size_t new_count, enc_count;
+ size_t struct_alignment;
+ int is_complex;
+ char enc_type;
+ char new_packmode;
+ char enc_packmode;
+ char is_valid_array;
+} __Pyx_BufFmt_Context;
+
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":723
+ * # in Cython to enable them only on the right systems.
+ *
+ * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t
+ */
+typedef npy_int8 __pyx_t_5numpy_int8_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724
+ *
+ * ctypedef npy_int8 int8_t
+ * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int32 int32_t
+ * ctypedef npy_int64 int64_t
+ */
+typedef npy_int16 __pyx_t_5numpy_int16_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
+ * ctypedef npy_int8 int8_t
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int64 int64_t
+ * #ctypedef npy_int96 int96_t
+ */
+typedef npy_int32 __pyx_t_5numpy_int32_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t
+ * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_int96 int96_t
+ * #ctypedef npy_int128 int128_t
+ */
+typedef npy_int64 __pyx_t_5numpy_int64_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730
+ * #ctypedef npy_int128 int128_t
+ *
+ * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t
+ */
+typedef npy_uint8 __pyx_t_5numpy_uint8_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731
+ *
+ * ctypedef npy_uint8 uint8_t
+ * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint32 uint32_t
+ * ctypedef npy_uint64 uint64_t
+ */
+typedef npy_uint16 __pyx_t_5numpy_uint16_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
+ * ctypedef npy_uint8 uint8_t
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint64 uint64_t
+ * #ctypedef npy_uint96 uint96_t
+ */
+typedef npy_uint32 __pyx_t_5numpy_uint32_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t
+ * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_uint96 uint96_t
+ * #ctypedef npy_uint128 uint128_t
+ */
+typedef npy_uint64 __pyx_t_5numpy_uint64_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737
+ * #ctypedef npy_uint128 uint128_t
+ *
+ * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_float64 float64_t
+ * #ctypedef npy_float80 float80_t
+ */
+typedef npy_float32 __pyx_t_5numpy_float32_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738
+ *
+ * ctypedef npy_float32 float32_t
+ * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_float80 float80_t
+ * #ctypedef npy_float128 float128_t
+ */
+typedef npy_float64 __pyx_t_5numpy_float64_t;
+
+/* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * ctypedef npy_longlong long_t
+ * ctypedef npy_longlong longlong_t
+ */
+typedef npy_long __pyx_t_5numpy_int_t;
+
+/* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * ctypedef npy_longlong longlong_t
+ *
+ */
+typedef npy_longlong __pyx_t_5numpy_long_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
+ * ctypedef npy_long int_t
+ * ctypedef npy_longlong long_t
+ * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_ulong uint_t
+ */
+typedef npy_longlong __pyx_t_5numpy_longlong_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
+ * ctypedef npy_longlong longlong_t
+ *
+ * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
+ * ctypedef npy_ulonglong ulong_t
+ * ctypedef npy_ulonglong ulonglong_t
+ */
+typedef npy_ulong __pyx_t_5numpy_uint_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752
+ *
+ * ctypedef npy_ulong uint_t
+ * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
+ * ctypedef npy_ulonglong ulonglong_t
+ *
+ */
+typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
+ * ctypedef npy_ulong uint_t
+ * ctypedef npy_ulonglong ulong_t
+ * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_intp intp_t
+ */
+typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
+ * ctypedef npy_ulonglong ulonglong_t
+ *
+ * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uintp uintp_t
+ *
+ */
+typedef npy_intp __pyx_t_5numpy_intp_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756
+ *
+ * ctypedef npy_intp intp_t
+ * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_double float_t
+ */
+typedef npy_uintp __pyx_t_5numpy_uintp_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
+ * ctypedef npy_uintp uintp_t
+ *
+ * ctypedef npy_double float_t # <<<<<<<<<<<<<<
+ * ctypedef npy_double double_t
+ * ctypedef npy_longdouble longdouble_t
+ */
+typedef npy_double __pyx_t_5numpy_float_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759
+ *
+ * ctypedef npy_double float_t
+ * ctypedef npy_double double_t # <<<<<<<<<<<<<<
+ * ctypedef npy_longdouble longdouble_t
+ *
+ */
+typedef npy_double __pyx_t_5numpy_double_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
+ * ctypedef npy_double float_t
+ * ctypedef npy_double double_t
+ * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_cfloat cfloat_t
+ */
+typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ typedef ::std::complex< float > __pyx_t_float_complex;
+ #else
+ typedef float _Complex __pyx_t_float_complex;
+ #endif
+#else
+ typedef struct { float real, imag; } __pyx_t_float_complex;
+#endif
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ typedef ::std::complex< double > __pyx_t_double_complex;
+ #else
+ typedef double _Complex __pyx_t_double_complex;
+ #endif
+#else
+ typedef struct { double real, imag; } __pyx_t_double_complex;
+#endif
+
+
+/*--- Type declarations ---*/
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762
+ * ctypedef npy_longdouble longdouble_t
+ *
+ * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
+ * ctypedef npy_cdouble cdouble_t
+ * ctypedef npy_clongdouble clongdouble_t
+ */
+typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763
+ *
+ * ctypedef npy_cfloat cfloat_t
+ * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
+ * ctypedef npy_clongdouble clongdouble_t
+ *
+ */
+typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
+ * ctypedef npy_cfloat cfloat_t
+ * ctypedef npy_cdouble cdouble_t
+ * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_cdouble complex_t
+ */
+typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
+ * ctypedef npy_clongdouble clongdouble_t
+ *
+ * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew1(a):
+ */
+typedef npy_cdouble __pyx_t_5numpy_complex_t;
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ if (acquire_gil) { \
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ PyGILState_Release(__pyx_gilstate_save); \
+ } else { \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext() \
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_XDECREF(tmp); \
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_DECREF(tmp); \
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+ const char* function_name);
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+static CYTHON_INLINE 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
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
+#else
+#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
+#endif
+
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+
+static CYTHON_INLINE int __Pyx_IterFinish(void);
+
+static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
+
+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 int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
+
+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);
+
+static void __Pyx_RaiseBufferIndexError(int axis);
+
+#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
+ PyListObject* L = (PyListObject*) list;
+ Py_ssize_t len = Py_SIZE(list);
+ if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
+ Py_INCREF(x);
+ PyList_SET_ITEM(list, len, x);
+ Py_SIZE(list) = len+1;
+ return 0;
+ }
+ return PyList_Append(list, x);
+}
+#else
+#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
+#endif
+
+static CYTHON_INLINE 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_RaiseNoneNotIterableError(void);
+
+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);
+
+typedef struct {
+ Py_ssize_t shape, strides, suboffsets;
+} __Pyx_Buf_DimInfo;
+typedef struct {
+ size_t refcount;
+ Py_buffer pybuffer;
+} __Pyx_Buffer;
+typedef struct {
+ __Pyx_Buffer *rcbuffer;
+ char *data;
+ __Pyx_Buf_DimInfo diminfo[8];
+} __Pyx_LocalBuf_ND;
+
+#if PY_MAJOR_VERSION < 3
+ static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
+ static void __Pyx_ReleaseBuffer(Py_buffer *view);
+#else
+ #define __Pyx_GetBuffer PyObject_GetBuffer
+ #define __Pyx_ReleaseBuffer PyBuffer_Release
+#endif
+
+
+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);
+
+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_int(int value);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ #define __Pyx_CREAL(z) ((z).real())
+ #define __Pyx_CIMAG(z) ((z).imag())
+ #else
+ #define __Pyx_CREAL(z) (__real__(z))
+ #define __Pyx_CIMAG(z) (__imag__(z))
+ #endif
+#else
+ #define __Pyx_CREAL(z) ((z).real)
+ #define __Pyx_CIMAG(z) ((z).imag)
+#endif
+#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
+ #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
+ #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
+#endif
+
+static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
+
+#if CYTHON_CCOMPLEX
+ #define __Pyx_c_eqf(a, b) ((a)==(b))
+ #define __Pyx_c_sumf(a, b) ((a)+(b))
+ #define __Pyx_c_difff(a, b) ((a)-(b))
+ #define __Pyx_c_prodf(a, b) ((a)*(b))
+ #define __Pyx_c_quotf(a, b) ((a)/(b))
+ #define __Pyx_c_negf(a) (-(a))
+ #ifdef __cplusplus
+ #define __Pyx_c_is_zerof(z) ((z)==(float)0)
+ #define __Pyx_c_conjf(z) (::std::conj(z))
+ #if 1
+ #define __Pyx_c_absf(z) (::std::abs(z))
+ #define __Pyx_c_powf(a, b) (::std::pow(a, b))
+ #endif
+ #else
+ #define __Pyx_c_is_zerof(z) ((z)==0)
+ #define __Pyx_c_conjf(z) (conjf(z))
+ #if 1
+ #define __Pyx_c_absf(z) (cabsf(z))
+ #define __Pyx_c_powf(a, b) (cpowf(a, b))
+ #endif
+ #endif
+#else
+ static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
+ #if 1
+ static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
+ #endif
+#endif
+
+static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
+
+#if CYTHON_CCOMPLEX
+ #define __Pyx_c_eq(a, b) ((a)==(b))
+ #define __Pyx_c_sum(a, b) ((a)+(b))
+ #define __Pyx_c_diff(a, b) ((a)-(b))
+ #define __Pyx_c_prod(a, b) ((a)*(b))
+ #define __Pyx_c_quot(a, b) ((a)/(b))
+ #define __Pyx_c_neg(a) (-(a))
+ #ifdef __cplusplus
+ #define __Pyx_c_is_zero(z) ((z)==(double)0)
+ #define __Pyx_c_conj(z) (::std::conj(z))
+ #if 1
+ #define __Pyx_c_abs(z) (::std::abs(z))
+ #define __Pyx_c_pow(a, b) (::std::pow(a, b))
+ #endif
+ #else
+ #define __Pyx_c_is_zero(z) ((z)==0)
+ #define __Pyx_c_conj(z) (conj(z))
+ #if 1
+ #define __Pyx_c_abs(z) (cabs(z))
+ #define __Pyx_c_pow(a, b) (cpow(a, b))
+ #endif
+ #endif
+#else
+ static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
+ #if 1
+ static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
+ #endif
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+static int __Pyx_check_binary_version(void);
+
+#if !defined(__Pyx_PyIdentifier_FromString)
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
+#else
+ #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
+#endif
+#endif
+
+static PyObject *__Pyx_ImportModule(const char *name);
+
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+
+/* Module declarations from 'cython' */
+
+/* Module declarations from 'cpython.buffer' */
+
+/* Module declarations from 'cpython.ref' */
+
+/* Module declarations from 'libc.string' */
+
+/* Module declarations from 'libc.stdio' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.type' */
+static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
+
+/* Module declarations from 'libc.stdlib' */
+
+/* Module declarations from 'numpy' */
+
+/* Module declarations from 'numpy' */
+static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
+static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
+static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
+static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
+static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
+static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
+
+/* Module declarations from 'fabio.ext.cf_io' */
+static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
+#define __Pyx_MODULE_NAME "fabio.ext.cf_io"
+int __pyx_module_is_main_fabio__ext__cf_io = 0;
+
+/* Implementation of 'fabio.ext.cf_io' */
+static PyObject *__pyx_builtin_range;
+static PyObject *__pyx_builtin_ValueError;
+static PyObject *__pyx_builtin_RuntimeError;
+static PyObject *__pyx_pf_5fabio_3ext_5cf_io_read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_py_file, PyObject *__pyx_v_mode); /* 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_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_a[] = "a";
+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_r[] = "r";
+static char __pyx_k_z[] = "z";
+static char __pyx_k_Zd[] = "Zd";
+static char __pyx_k_Zf[] = "Zf";
+static char __pyx_k_Zg[] = "Zg";
+static char __pyx_k_cf[] = "cf__";
+static char __pyx_k_fd[] = "fd";
+static char __pyx_k_os[] = "os";
+static char __pyx_k_wb[] = "wb";
+static char __pyx_k_MIT[] = "MIT";
+static char __pyx_k_CF_H[] = "CF_H";
+static char __pyx_k_dims[] = "dims";
+static char __pyx_k_file[] = "file";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_mode[] = "mode";
+static char __pyx_k_name[] = "__name__";
+static char __pyx_k_read[] = "read";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_close[] = "close";
+static char __pyx_k_dtype[] = "dtype";
+static char __pyx_k_empty[] = "empty";
+static char __pyx_k_error[] = "error";
+static char __pyx_k_flags[] = "flags";
+static char __pyx_k_fname[] = "fname";
+static char __pyx_k_numpy[] = "numpy";
+static char __pyx_k_range[] = "range";
+static char __pyx_k_write[] = "write";
+static char __pyx_k_CF_BIN[] = "CF_BIN";
+static char __pyx_k_fdopen[] = "fdopen";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_logger[] = "logger";
+static char __pyx_k_authors[] = "__authors__";
+static char __pyx_k_clabels[] = "clabels";
+static char __pyx_k_contact[] = "__contact__";
+static char __pyx_k_float64[] = "float64";
+static char __pyx_k_license[] = "__license__";
+static char __pyx_k_logging[] = "logging";
+static char __pyx_k_mkstemp[] = "mkstemp";
+static char __pyx_k_py_data[] = "py_data";
+static char __pyx_k_py_file[] = "py_file";
+static char __pyx_k_tempfile[] = "tempfile";
+static char __pyx_k_copyright[] = "__copyright__";
+static char __pyx_k_getLogger[] = "getLogger";
+static char __pyx_k_CF_GZ_COMP[] = "CF_GZ_COMP";
+static char __pyx_k_ValueError[] = "ValueError";
+static char __pyx_k_CF_INIT_COLS[] = "CF_INIT_COLS";
+static char __pyx_k_CF_INIT_ROWS[] = "CF_INIT_ROWS";
+static char __pyx_k_RuntimeError[] = "RuntimeError";
+static char __pyx_k_CF_HEADER_ITEM[] = "CF_HEADER_ITEM";
+static char __pyx_k_Jerome_Kieffer[] = "Jerome Kieffer";
+static char __pyx_k_fabio_ext_cf_io[] = "fabio.ext.cf_io";
+static char __pyx_k_jerome_kieffer_esrf_eu[] = "jerome.kieffer@esrf.eu";
+static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static char __pyx_k_workspace_valls_fabio_git_fabio[] = "/workspace/valls/fabio.git/fabio/ext/cf_io.pyx";
+static char __pyx_k_2013_European_Synchrotron_Radiat[] = "2013, European Synchrotron Radiation Facility, Grenoble, France";
+static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static char __pyx_k_New_Cython_version_of_cf_iomodul[] = "New Cython version of cf_iomodule.c for preparing the migration to Python3";
+static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static char __pyx_k_Unrecognized_mode_for_columnfile[] = "Unrecognized mode for columnfile %s (assuming ascii)";
+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_2013_European_Synchrotron_Radiat;
+static PyObject *__pyx_n_s_CF_BIN;
+static PyObject *__pyx_n_s_CF_GZ_COMP;
+static PyObject *__pyx_n_s_CF_H;
+static PyObject *__pyx_n_s_CF_HEADER_ITEM;
+static PyObject *__pyx_n_s_CF_INIT_COLS;
+static PyObject *__pyx_n_s_CF_INIT_ROWS;
+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_s_Jerome_Kieffer;
+static PyObject *__pyx_n_s_MIT;
+static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
+static PyObject *__pyx_n_s_RuntimeError;
+static PyObject *__pyx_kp_s_Unrecognized_mode_for_columnfile;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_n_s_a;
+static PyObject *__pyx_n_s_authors;
+static PyObject *__pyx_n_s_b;
+static PyObject *__pyx_n_s_cf;
+static PyObject *__pyx_n_s_clabels;
+static PyObject *__pyx_n_s_close;
+static PyObject *__pyx_n_s_contact;
+static PyObject *__pyx_n_s_copyright;
+static PyObject *__pyx_n_s_dims;
+static PyObject *__pyx_n_s_dtype;
+static PyObject *__pyx_n_s_empty;
+static PyObject *__pyx_n_s_error;
+static PyObject *__pyx_n_s_fabio_ext_cf_io;
+static PyObject *__pyx_n_s_fd;
+static PyObject *__pyx_n_s_fdopen;
+static PyObject *__pyx_n_s_file;
+static PyObject *__pyx_n_s_flags;
+static PyObject *__pyx_n_s_float64;
+static PyObject *__pyx_n_s_fname;
+static PyObject *__pyx_n_s_getLogger;
+static PyObject *__pyx_n_s_i;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_kp_s_jerome_kieffer_esrf_eu;
+static PyObject *__pyx_n_s_license;
+static PyObject *__pyx_n_s_logger;
+static PyObject *__pyx_n_s_logging;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_mkstemp;
+static PyObject *__pyx_n_s_mode;
+static PyObject *__pyx_n_s_name;
+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_numpy;
+static PyObject *__pyx_n_s_os;
+static PyObject *__pyx_n_s_py_data;
+static PyObject *__pyx_n_s_py_file;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_read;
+static PyObject *__pyx_n_s_tempfile;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
+static PyObject *__pyx_n_s_wb;
+static PyObject *__pyx_kp_s_workspace_valls_fabio_git_fabio;
+static PyObject *__pyx_n_s_write;
+static PyObject *__pyx_n_s_z;
+static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_2;
+static PyObject *__pyx_int_32;
+static PyObject *__pyx_int_128;
+static PyObject *__pyx_int_8192;
+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_codeobj__9;
+
+/* "fabio/ext/cf_io.pyx":71
+ *
+ *
+ * def read(py_file, mode="a"): # <<<<<<<<<<<<<<
+ * """
+ * Call the c-columnfile reading interface.
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_5cf_io_1read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_5fabio_3ext_5cf_io_read[] = "\n Call the c-columnfile reading interface.\n The mode keyword argument is either:\n \"a\" for ascii (the default)\n \"b\" for binary\n ";
+static PyMethodDef __pyx_mdef_5fabio_3ext_5cf_io_1read = {"read", (PyCFunction)__pyx_pw_5fabio_3ext_5cf_io_1read, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_5cf_io_read};
+static PyObject *__pyx_pw_5fabio_3ext_5cf_io_1read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_py_file = 0;
+ PyObject *__pyx_v_mode = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("read (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_py_file,&__pyx_n_s_mode,0};
+ PyObject* values[2] = {0,0};
+ values[1] = ((PyObject *)__pyx_n_s_a);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_py_file)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_py_file = values[0];
+ __pyx_v_mode = values[1];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("read", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.cf_io.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_5fabio_3ext_5cf_io_read(__pyx_self, __pyx_v_py_file, __pyx_v_mode);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_5cf_io_read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_py_file, PyObject *__pyx_v_mode) {
+ struct cf_data *__pyx_v_cf__;
+ unsigned int __pyx_v_flags;
+ unsigned int __pyx_v_fd;
+ int __pyx_v_i;
+ FILE *__pyx_v_file;
+ PyObject *__pyx_v_fname = NULL;
+ PyObject *__pyx_v_dims = NULL;
+ PyArrayObject *__pyx_v_py_data = 0;
+ PyObject *__pyx_v_clabels = NULL;
+ __Pyx_LocalBuf_ND __pyx_pybuffernd_py_data;
+ __Pyx_Buffer __pyx_pybuffer_py_data;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *(*__pyx_t_5)(PyObject *);
+ unsigned int __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ char const *__pyx_t_8;
+ int __pyx_t_9;
+ int __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ PyArrayObject *__pyx_t_12 = NULL;
+ int __pyx_t_13;
+ int __pyx_t_14;
+ int __pyx_t_15;
+ long __pyx_t_16;
+ int __pyx_t_17;
+ int __pyx_t_18;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("read", 0);
+ __pyx_pybuffer_py_data.pybuffer.buf = NULL;
+ __pyx_pybuffer_py_data.refcount = 0;
+ __pyx_pybuffernd_py_data.data = NULL;
+ __pyx_pybuffernd_py_data.rcbuffer = &__pyx_pybuffer_py_data;
+
+ /* "fabio/ext/cf_io.pyx":79
+ * """
+ * cdef cf_data *cf__
+ * cdef unsigned int flags = 0, fd # <<<<<<<<<<<<<<
+ *
+ * # perhaps not const
+ */
+ __pyx_v_flags = 0;
+
+ /* "fabio/ext/cf_io.pyx":87
+ * # Here is a big issue !!! and I got an even worse solution !
+ * # file = PyFile_AsFile(py_file)
+ * (fd, fname) = tempfile.mkstemp() # <<<<<<<<<<<<<<
+ * os.fdopen(fd, mode="wb").write(py_file.read())
+ * os.close(fd)
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_tempfile); 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);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_mkstemp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_2)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (__pyx_t_2) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else {
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+ PyObject* sequence = __pyx_t_1;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ Py_ssize_t size = Py_SIZE(sequence);
+ #else
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ if (likely(PyTuple_CheckExact(sequence))) {
+ __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
+ } else {
+ __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
+ }
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_2);
+ #else
+ __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = PySequence_ITEM(sequence, 1); 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);
+ #endif
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else {
+ Py_ssize_t index = -1;
+ __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
+ index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_3);
+ index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_2);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = NULL;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ goto __pyx_L4_unpacking_done;
+ __pyx_L3_unpacking_failed:;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_5 = NULL;
+ if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_L4_unpacking_done:;
+ }
+ __pyx_t_6 = __Pyx_PyInt_As_unsigned_int(__pyx_t_3); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_fd = __pyx_t_6;
+ __pyx_v_fname = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "fabio/ext/cf_io.pyx":88
+ * # file = PyFile_AsFile(py_file)
+ * (fd, fname) = tempfile.mkstemp()
+ * os.fdopen(fd, mode="wb").write(py_file.read()) # <<<<<<<<<<<<<<
+ * os.close(fd)
+ * file = fopen(fname, "r")
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); 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);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_fdopen); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_fd); 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);
+ __pyx_t_4 = PyTuple_New(1); 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);
+ PyTuple_SET_ITEM(__pyx_t_4, 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 = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mode, __pyx_n_s_wb) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_write); 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);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_file, __pyx_n_s_read); 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_t_3 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ if (__pyx_t_3) {
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else {
+ __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
+ }
+ if (!__pyx_t_4) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/cf_io.pyx":89
+ * (fd, fname) = tempfile.mkstemp()
+ * os.fdopen(fd, mode="wb").write(py_file.read())
+ * os.close(fd) # <<<<<<<<<<<<<<
+ * file = fopen(fname, "r")
+ *
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_fd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_7 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_7)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (!__pyx_t_7) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/cf_io.pyx":90
+ * os.fdopen(fd, mode="wb").write(py_file.read())
+ * os.close(fd)
+ * file = fopen(fname, "r") # <<<<<<<<<<<<<<
+ *
+ * if "z" in mode:
+ */
+ __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_fname); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_file = fopen(__pyx_t_8, __pyx_k_r);
+
+ /* "fabio/ext/cf_io.pyx":92
+ * file = fopen(fname, "r")
+ *
+ * if "z" in mode: # <<<<<<<<<<<<<<
+ * flags |= CF_GZ_COMP
+ * if "b" in mode:
+ */
+ __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_n_s_z, __pyx_v_mode, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = (__pyx_t_9 != 0);
+ if (__pyx_t_10) {
+
+ /* "fabio/ext/cf_io.pyx":93
+ *
+ * if "z" in mode:
+ * flags |= CF_GZ_COMP # <<<<<<<<<<<<<<
+ * if "b" in mode:
+ * cf__ = <cf_data *> cf_read_bin(file, NULL, flags)
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_CF_GZ_COMP); 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 = PyNumber_InPlaceOr(__pyx_t_1, __pyx_t_3); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) {__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_v_flags = __pyx_t_6;
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "fabio/ext/cf_io.pyx":94
+ * if "z" in mode:
+ * flags |= CF_GZ_COMP
+ * if "b" in mode: # <<<<<<<<<<<<<<
+ * cf__ = <cf_data *> cf_read_bin(file, NULL, flags)
+ * elif "a" in mode:
+ */
+ __pyx_t_10 = (__Pyx_PySequence_Contains(__pyx_n_s_b, __pyx_v_mode, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = (__pyx_t_10 != 0);
+ if (__pyx_t_9) {
+
+ /* "fabio/ext/cf_io.pyx":95
+ * flags |= CF_GZ_COMP
+ * if "b" in mode:
+ * cf__ = <cf_data *> cf_read_bin(file, NULL, flags) # <<<<<<<<<<<<<<
+ * elif "a" in mode:
+ * cf__ = <cf_data *> cf_read_ascii(file, NULL, flags)
+ */
+ __pyx_v_cf__ = ((struct cf_data *)cf_read_bin(__pyx_v_file, NULL, __pyx_v_flags));
+ goto __pyx_L6;
+ }
+
+ /* "fabio/ext/cf_io.pyx":96
+ * if "b" in mode:
+ * cf__ = <cf_data *> cf_read_bin(file, NULL, flags)
+ * elif "a" in mode: # <<<<<<<<<<<<<<
+ * cf__ = <cf_data *> cf_read_ascii(file, NULL, flags)
+ * else:
+ */
+ __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_n_s_a, __pyx_v_mode, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = (__pyx_t_9 != 0);
+ if (__pyx_t_10) {
+
+ /* "fabio/ext/cf_io.pyx":97
+ * cf__ = <cf_data *> cf_read_bin(file, NULL, flags)
+ * elif "a" in mode:
+ * cf__ = <cf_data *> cf_read_ascii(file, NULL, flags) # <<<<<<<<<<<<<<
+ * else:
+ * logger.error("Unrecognized mode for columnfile %s (assuming ascii)", mode)
+ */
+ __pyx_v_cf__ = ((struct cf_data *)cf_read_ascii(__pyx_v_file, NULL, __pyx_v_flags));
+ goto __pyx_L6;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/cf_io.pyx":99
+ * cf__ = <cf_data *> cf_read_ascii(file, NULL, flags)
+ * else:
+ * logger.error("Unrecognized mode for columnfile %s (assuming ascii)", mode) # <<<<<<<<<<<<<<
+ * cf__ = <cf_data *> cf_read_ascii(file, NULL, flags)
+ *
+ */
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); 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_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = NULL;
+ __pyx_t_11 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ __pyx_t_11 = 1;
+ }
+ }
+ __pyx_t_2 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ if (__pyx_t_3) {
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+ }
+ __Pyx_INCREF(__pyx_kp_s_Unrecognized_mode_for_columnfile);
+ PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_11, __pyx_kp_s_Unrecognized_mode_for_columnfile);
+ __Pyx_GIVEREF(__pyx_kp_s_Unrecognized_mode_for_columnfile);
+ __Pyx_INCREF(__pyx_v_mode);
+ PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_11, __pyx_v_mode);
+ __Pyx_GIVEREF(__pyx_v_mode);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); 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_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "fabio/ext/cf_io.pyx":100
+ * else:
+ * logger.error("Unrecognized mode for columnfile %s (assuming ascii)", mode)
+ * cf__ = <cf_data *> cf_read_ascii(file, NULL, flags) # <<<<<<<<<<<<<<
+ *
+ * # check for failure to read
+ */
+ __pyx_v_cf__ = ((struct cf_data *)cf_read_ascii(__pyx_v_file, NULL, __pyx_v_flags));
+ }
+ __pyx_L6:;
+
+ /* "fabio/ext/cf_io.pyx":103
+ *
+ * # check for failure to read
+ * if (cf__ == NULL): # <<<<<<<<<<<<<<
+ * return None, None
+ * dims = (cf__.nrows, cf__.ncols)
+ */
+ __pyx_t_10 = ((__pyx_v_cf__ == NULL) != 0);
+ if (__pyx_t_10) {
+
+ /* "fabio/ext/cf_io.pyx":104
+ * # check for failure to read
+ * if (cf__ == NULL):
+ * return None, None # <<<<<<<<<<<<<<
+ * dims = (cf__.nrows, cf__.ncols)
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_tuple_);
+ __pyx_r = __pyx_tuple_;
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/cf_io.pyx":105
+ * if (cf__ == NULL):
+ * return None, None
+ * dims = (cf__.nrows, cf__.ncols) # <<<<<<<<<<<<<<
+ *
+ * # since data may be non-contigous we can't simply create a numpy-array from
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_cf__->nrows); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_cf__->ncols); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = 0;
+ __pyx_v_dims = ((PyObject*)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "fabio/ext/cf_io.pyx":111
+ * # i.e. py_data=(PyArrayObject*)PyArray_SimpleNewFromData(2, dims, NPY_DOUBLE, (void*)(&(cf__->data[0][0])))
+ * # won't work
+ * cdef numpy.ndarray[numpy.float64_t, ndim=2] py_data = numpy.empty(dims, dtype=numpy.float64) # <<<<<<<<<<<<<<
+ * for i in range(cf__.nrows):
+ * memcpy(&py_data[i, 0], cf__.data[i], cf__.ncols * sizeof(double))
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __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 = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_dims);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_dims);
+ __Pyx_GIVEREF(__pyx_v_dims);
+ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__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 = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = ((PyArrayObject *)__pyx_t_7);
+ {
+ __Pyx_BufFmt_StackElem __pyx_stack[1];
+ if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_py_data.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
+ __pyx_v_py_data = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_py_data.rcbuffer->pybuffer.buf = NULL;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ } else {__pyx_pybuffernd_py_data.diminfo[0].strides = __pyx_pybuffernd_py_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_py_data.diminfo[0].shape = __pyx_pybuffernd_py_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_py_data.diminfo[1].strides = __pyx_pybuffernd_py_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_py_data.diminfo[1].shape = __pyx_pybuffernd_py_data.rcbuffer->pybuffer.shape[1];
+ }
+ }
+ __pyx_t_12 = 0;
+ __pyx_v_py_data = ((PyArrayObject *)__pyx_t_7);
+ __pyx_t_7 = 0;
+
+ /* "fabio/ext/cf_io.pyx":112
+ * # won't work
+ * cdef numpy.ndarray[numpy.float64_t, ndim=2] py_data = numpy.empty(dims, dtype=numpy.float64)
+ * for i in range(cf__.nrows): # <<<<<<<<<<<<<<
+ * memcpy(&py_data[i, 0], cf__.data[i], cf__.ncols * sizeof(double))
+ * clabels = []
+ */
+ __pyx_t_13 = __pyx_v_cf__->nrows;
+ for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
+ __pyx_v_i = __pyx_t_14;
+
+ /* "fabio/ext/cf_io.pyx":113
+ * cdef numpy.ndarray[numpy.float64_t, ndim=2] py_data = numpy.empty(dims, dtype=numpy.float64)
+ * for i in range(cf__.nrows):
+ * memcpy(&py_data[i, 0], cf__.data[i], cf__.ncols * sizeof(double)) # <<<<<<<<<<<<<<
+ * clabels = []
+ * for i in range(cf__.ncols):
+ */
+ __pyx_t_15 = __pyx_v_i;
+ __pyx_t_16 = 0;
+ __pyx_t_17 = -1;
+ if (__pyx_t_15 < 0) {
+ __pyx_t_15 += __pyx_pybuffernd_py_data.diminfo[0].shape;
+ if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 0;
+ } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_py_data.diminfo[0].shape)) __pyx_t_17 = 0;
+ if (__pyx_t_16 < 0) {
+ __pyx_t_16 += __pyx_pybuffernd_py_data.diminfo[1].shape;
+ if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1;
+ } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_py_data.diminfo[1].shape)) __pyx_t_17 = 1;
+ if (unlikely(__pyx_t_17 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_17);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ memcpy((&(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_py_data.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_py_data.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_py_data.diminfo[1].strides))), (__pyx_v_cf__->data[__pyx_v_i]), (__pyx_v_cf__->ncols * (sizeof(double))));
+ }
+
+ /* "fabio/ext/cf_io.pyx":114
+ * for i in range(cf__.nrows):
+ * memcpy(&py_data[i, 0], cf__.data[i], cf__.ncols * sizeof(double))
+ * clabels = [] # <<<<<<<<<<<<<<
+ * for i in range(cf__.ncols):
+ * clabels.append(str(cf__.clabels[i]))
+ */
+ __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_v_clabels = ((PyObject*)__pyx_t_7);
+ __pyx_t_7 = 0;
+
+ /* "fabio/ext/cf_io.pyx":115
+ * memcpy(&py_data[i, 0], cf__.data[i], cf__.ncols * sizeof(double))
+ * clabels = []
+ * for i in range(cf__.ncols): # <<<<<<<<<<<<<<
+ * clabels.append(str(cf__.clabels[i]))
+ * cf_free(cf__)
+ */
+ __pyx_t_13 = __pyx_v_cf__->ncols;
+ for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
+ __pyx_v_i = __pyx_t_14;
+
+ /* "fabio/ext/cf_io.pyx":116
+ * clabels = []
+ * for i in range(cf__.ncols):
+ * clabels.append(str(cf__.clabels[i])) # <<<<<<<<<<<<<<
+ * cf_free(cf__)
+ *
+ */
+ __pyx_t_7 = __Pyx_PyBytes_FromString((__pyx_v_cf__->clabels[__pyx_v_i])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_18 = __Pyx_PyList_Append(__pyx_v_clabels, __pyx_t_7); if (unlikely(__pyx_t_18 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
+
+ /* "fabio/ext/cf_io.pyx":117
+ * for i in range(cf__.ncols):
+ * clabels.append(str(cf__.clabels[i]))
+ * cf_free(cf__) # <<<<<<<<<<<<<<
+ *
+ * return py_data, clabels
+ */
+ cf_free(__pyx_v_cf__);
+
+ /* "fabio/ext/cf_io.pyx":119
+ * cf_free(cf__)
+ *
+ * return py_data, clabels # <<<<<<<<<<<<<<
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_INCREF(((PyObject *)__pyx_v_py_data));
+ PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_py_data));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_py_data));
+ __Pyx_INCREF(__pyx_v_clabels);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_clabels);
+ __Pyx_GIVEREF(__pyx_v_clabels);
+ __pyx_r = __pyx_t_7;
+ __pyx_t_7 = 0;
+ goto __pyx_L0;
+
+ /* "fabio/ext/cf_io.pyx":71
+ *
+ *
+ * def read(py_file, mode="a"): # <<<<<<<<<<<<<<
+ * """
+ * Call the c-columnfile reading interface.
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_7);
+ { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
+ __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_py_data.rcbuffer->pybuffer);
+ __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
+ __Pyx_AddTraceback("fabio.ext.cf_io.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ goto __pyx_L2;
+ __pyx_L0:;
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_py_data.rcbuffer->pybuffer);
+ __pyx_L2:;
+ __Pyx_XDECREF(__pyx_v_fname);
+ __Pyx_XDECREF(__pyx_v_dims);
+ __Pyx_XDECREF((PyObject *)__pyx_v_py_data);
+ __Pyx_XDECREF(__pyx_v_clabels);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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) {
+ int __pyx_r;
+ __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;
+}
+
+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;
+ int __pyx_v_ndim;
+ int __pyx_v_endian_detector;
+ int __pyx_v_little_endian;
+ int __pyx_v_t;
+ char *__pyx_v_f;
+ PyArray_Descr *__pyx_v_descr = 0;
+ int __pyx_v_offset;
+ int __pyx_v_hasfields;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ char *__pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ if (__pyx_v_info != NULL) {
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_info->obj);
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
+ *
+ * cdef int copy_shape, i, ndim
+ * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ *
+ */
+ __pyx_v_endian_detector = 1;
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ *
+ * ndim = PyArray_NDIM(self)
+ */
+ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ *
+ * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
+ *
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
+ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
+
+ /* "../../../usr/lib/python2.7/dist-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))) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209
+ *
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * copy_shape = 1 # <<<<<<<<<<<<<<
+ * else:
+ * copy_shape = 0
+ */
+ __pyx_v_copy_shape = 1;
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
+ * copy_shape = 1
+ * else:
+ * copy_shape = 0 # <<<<<<<<<<<<<<
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ */
+ __pyx_v_copy_shape = 0;
+ }
+ __pyx_L4:;
+
+ /* "../../../usr/lib/python2.7/dist-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_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/lib/python2.7/dist-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) != 0)) != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L6_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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) {
+
+ /* "../../../usr/lib/python2.7/dist-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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
+ * raise ValueError(u"ndarray is not Fortran contiguous")
+ *
+ * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
+ * info.ndim = ndim
+ * if copy_shape:
+ */
+ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
+ *
+ * info.buf = PyArray_DATA(self)
+ * info.ndim = ndim # <<<<<<<<<<<<<<
+ * if copy_shape:
+ * # Allocate new buffer for strides and shape info.
+ */
+ __pyx_v_info->ndim = __pyx_v_ndim;
+
+ /* "../../../usr/lib/python2.7/dist-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.
+ */
+ __pyx_t_1 = (__pyx_v_copy_shape != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ * info.shape = info.strides + ndim
+ * for i in range(ndim):
+ */
+ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
+
+ /* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i]
+ */
+ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229
+ * info.shape = info.strides + ndim
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ * else:
+ */
+ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
+
+ /* "../../../usr/lib/python2.7/dist-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] # <<<<<<<<<<<<<<
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ */
+ (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
+ }
+ goto __pyx_L11;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ * info.suboffsets = NULL
+ */
+ __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ */
+ __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
+ }
+ __pyx_L11:;
+
+ /* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ * info.readonly = not PyArray_ISWRITEABLE(self)
+ */
+ __pyx_v_info->suboffsets = NULL;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
+ * info.readonly = not PyArray_ISWRITEABLE(self)
+ *
+ */
+ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
+
+ /* "../../../usr/lib/python2.7/dist-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) != 0));
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
+ *
+ * cdef int t
+ * cdef char* f = NULL # <<<<<<<<<<<<<<
+ * cdef dtype descr = self.descr
+ * cdef list stack
+ */
+ __pyx_v_f = NULL;
+
+ /* "../../../usr/lib/python2.7/dist-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_3 = ((PyObject *)__pyx_v_self->descr);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":244
+ * cdef int offset
+ *
+ * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
+ *
+ * if not hasfields and not copy_shape:
+ */
+ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
+
+ /* "../../../usr/lib/python2.7/dist-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 != 0)) != 0);
+ if (__pyx_t_2) {
+ } 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) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
+ * if not hasfields and not copy_shape:
+ * # do not call releasebuffer
+ * info.obj = None # <<<<<<<<<<<<<<
+ * else:
+ * # need to call releasebuffer
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = Py_None;
+ goto __pyx_L14;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251
+ * else:
+ * # need to call releasebuffer
+ * info.obj = self # <<<<<<<<<<<<<<
+ *
+ * if not hasfields:
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
+ }
+ __pyx_L14:;
+
+ /* "../../../usr/lib/python2.7/dist-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 != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-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_4 = __pyx_v_descr->type_num;
+ __pyx_v_t = __pyx_t_4;
+
+ /* "../../../usr/lib/python2.7/dist-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_2 = ((__pyx_v_descr->byteorder == '>') != 0);
+ if (!__pyx_t_2) {
+ goto __pyx_L20_next_or;
+ } else {
+ }
+ __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:;
+
+ /* "../../../usr/lib/python2.7/dist-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_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) {
+
+ /* "../../../usr/lib/python2.7/dist-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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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/lib/python2.7/dist-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"
+ */
+ case NPY_BYTE:
+ __pyx_v_f = __pyx_k_b;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_UBYTE:
+ __pyx_v_f = __pyx_k_B;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_SHORT:
+ __pyx_v_f = __pyx_k_h;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_USHORT:
+ __pyx_v_f = __pyx_k_H;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_INT:
+ __pyx_v_f = __pyx_k_i;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_UINT:
+ __pyx_v_f = __pyx_k_I;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_LONG:
+ __pyx_v_f = __pyx_k_l;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_ULONG:
+ __pyx_v_f = __pyx_k_L;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_LONGLONG:
+ __pyx_v_f = __pyx_k_q;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_ULONGLONG:
+ __pyx_v_f = __pyx_k_Q;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_FLOAT:
+ __pyx_v_f = __pyx_k_f;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_DOUBLE:
+ __pyx_v_f = __pyx_k_d;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_LONGDOUBLE:
+ __pyx_v_f = __pyx_k_g;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_CFLOAT:
+ __pyx_v_f = __pyx_k_Zf;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_CDOUBLE:
+ __pyx_v_f = __pyx_k_Zd;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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:
+ */
+ case NPY_CLONGDOUBLE:
+ __pyx_v_f = __pyx_k_Zg;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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)
+ */
+ case NPY_OBJECT:
+ __pyx_v_f = __pyx_k_O;
+ break;
+ default:
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * info.format = f # <<<<<<<<<<<<<<
+ * return
+ * else:
+ */
+ __pyx_v_info->format = __pyx_v_f;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * info.format = f
+ * return # <<<<<<<<<<<<<<
+ * else:
+ * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
+ * return
+ * else:
+ * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
+ * info.format[0] = c'^' # Native data types, manual alignment
+ * offset = 0
+ */
+ __pyx_v_info->format = ((char *)malloc(255));
+
+ /* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * offset = 0
+ * f = _util_dtypestring(descr, info.format + 1,
+ */
+ (__pyx_v_info->format[0]) = '^';
+
+ /* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * f = _util_dtypestring(descr, info.format + 1,
+ * info.format + _buffer_format_string_len,
+ */
+ __pyx_v_offset = 0;
+
+ /* "../../../usr/lib/python2.7/dist-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)
+ */
+ __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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286
+ * info.format + _buffer_format_string_len,
+ * &offset)
+ * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ */
+ (__pyx_v_f[0]) = '\x00';
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
+ }
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
+ __Pyx_GOTREF(Py_None);
+ __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
+ }
+ __pyx_L2:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_descr);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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();
+}
+
+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);
+
+ /* "../../../usr/lib/python2.7/dist-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) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self):
+ * stdlib.free(info.format) # <<<<<<<<<<<<<<
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * stdlib.free(info.strides)
+ */
+ free(__pyx_v_info->format);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "../../../usr/lib/python2.7/dist-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))) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292
+ * 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
+ *
+ */
+ free(__pyx_v_info->strides);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "../../../usr/lib/python2.7/dist-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();
+}
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
+ * ctypedef npy_cdouble complex_t
+ *
+ * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(1, <void*>a)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":769
+ *
+ * cdef inline object PyArray_MultiIterNew1(a):
+ * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":772
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b):
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ *
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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.
+ */
+
+static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
+ PyArray_Descr *__pyx_v_child = 0;
+ int __pyx_v_endian_detector;
+ int __pyx_v_little_endian;
+ PyObject *__pyx_v_fields = 0;
+ PyObject *__pyx_v_childname = NULL;
+ PyObject *__pyx_v_new_offset = NULL;
+ PyObject *__pyx_v_t = NULL;
+ char *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ 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);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790
+ * cdef int delta_offset
+ * cdef tuple i
+ * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ * cdef tuple fields
+ */
+ __pyx_v_endian_detector = 1;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791
+ * cdef tuple i
+ * cdef int endian_detector = 1
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
+ * cdef tuple fields
+ *
+ */
+ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
+
+ /* "../../../usr/lib/python2.7/dist-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(__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 = __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
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #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_SET(__pyx_v_childname, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "../../../usr/lib/python2.7/dist-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 (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 %.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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":796
+ * for childname in descr.names:
+ * fields = descr.fields[childname]
+ * child, new_offset = fields # <<<<<<<<<<<<<<
+ *
+ * if (end - f) - <int>(new_offset - offset[0]) < 15:
+ */
+ 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
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ #else
+ __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __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 {
+ __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ 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_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
+ __pyx_t_3 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":798
+ * child, new_offset = fields
+ *
+ * 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 = __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 = 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_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_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
+ if (__pyx_t_6) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
+ *
+ * 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_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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 == '>') != 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_6 = __pyx_t_7;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_L8_next_or:;
+
+ /* "../../../usr/lib/python2.7/dist-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 == '<') != 0);
+ if (__pyx_t_7) {
+ } else {
+ __pyx_t_6 = __pyx_t_7;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
+ __pyx_t_6 = __pyx_t_7;
+ __pyx_L7_bool_binop_done:;
+ if (__pyx_t_6) {
+
+ /* "../../../usr/lib/python2.7/dist-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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
+ *
+ * # Output padding bytes
+ * while offset[0] < new_offset: # <<<<<<<<<<<<<<
+ * f[0] = 120 # "x"; pad byte
+ * f += 1
+ */
+ while (1) {
+ __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;
+ __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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":814
+ * # Output padding bytes
+ * while offset[0] < new_offset:
+ * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
+ * f += 1
+ * offset[0] += 1
+ */
+ (__pyx_v_f[0]) = 120;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815
+ * while offset[0] < new_offset:
+ * f[0] = 120 # "x"; pad byte
+ * f += 1 # <<<<<<<<<<<<<<
+ * offset[0] += 1
+ *
+ */
+ __pyx_v_f = (__pyx_v_f + 1);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
+ * f[0] = 120 # "x"; pad byte
+ * f += 1
+ * offset[0] += 1 # <<<<<<<<<<<<<<
+ *
+ * offset[0] += child.itemsize
+ */
+ __pyx_t_8 = 0;
+ (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818
+ * offset[0] += 1
+ *
+ * offset[0] += child.itemsize # <<<<<<<<<<<<<<
+ *
+ * if not PyDataType_HASFIELDS(child):
+ */
+ __pyx_t_8 = 0;
+ (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
+
+ /* "../../../usr/lib/python2.7/dist-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_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
+ if (__pyx_t_6) {
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+
+ /* "../../../usr/lib/python2.7/dist-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_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
+ if (__pyx_t_6) {
+
+ /* "../../../usr/lib/python2.7/dist-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_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 98;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 104;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 105;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 108;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 113;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 102;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 103;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 90;
+ (__pyx_v_f[1]) = 100;
+ __pyx_v_f = (__pyx_v_f + 1);
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 79;
+ goto __pyx_L15;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-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_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);
+ __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_L15:;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * f += 1 # <<<<<<<<<<<<<<
+ * else:
+ * # Cython ignores struct boundary information ("T{...}"),
+ */
+ __pyx_v_f = (__pyx_v_f + 1);
+ goto __pyx_L13;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-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_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_L13:;
+
+ /* "../../../usr/lib/python2.7/dist-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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850
+ * # so don't output it
+ * f = _util_dtypestring(child, f, end, offset)
+ * return f # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_f;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_child);
+ __Pyx_XDECREF(__pyx_v_fields);
+ __Pyx_XDECREF(__pyx_v_childname);
+ __Pyx_XDECREF(__pyx_v_new_offset);
+ __Pyx_XDECREF(__pyx_v_t);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
+ *
+ *
+ * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
+ * cdef PyObject* baseptr
+ * if base is None:
+ */
+
+static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
+ PyObject *__pyx_v_baseptr;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ __Pyx_RefNannySetupContext("set_array_base", 0);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968
+ * cdef inline void set_array_base(ndarray arr, object base):
+ * cdef PyObject* baseptr
+ * if base is None: # <<<<<<<<<<<<<<
+ * baseptr = NULL
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_base == Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
+ * cdef PyObject* baseptr
+ * if base is None:
+ * baseptr = NULL # <<<<<<<<<<<<<<
+ * else:
+ * Py_INCREF(base) # important to do this before decref below!
+ */
+ __pyx_v_baseptr = NULL;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971
+ * baseptr = NULL
+ * else:
+ * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base)
+ */
+ Py_INCREF(__pyx_v_base);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972
+ * else:
+ * Py_INCREF(base) # important to do this before decref below!
+ * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
+ * Py_XDECREF(arr.base)
+ * arr.base = baseptr
+ */
+ __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
+ }
+ __pyx_L3:;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973
+ * Py_INCREF(base) # important to do this before decref below!
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
+ * arr.base = baseptr
+ *
+ */
+ Py_XDECREF(__pyx_v_arr->base);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base)
+ * arr.base = baseptr # <<<<<<<<<<<<<<
+ *
+ * cdef inline object get_array_base(ndarray arr):
+ */
+ __pyx_v_arr->base = __pyx_v_baseptr;
+
+ /* "../../../usr/lib/python2.7/dist-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();
+}
+
+/* "../../../usr/lib/python2.7/dist-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
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("get_array_base", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":978
+ * cdef inline object get_array_base(ndarray arr):
+ * if arr.base is NULL:
+ * return None # <<<<<<<<<<<<<<
+ * else:
+ * return <object>arr.base
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(Py_None);
+ __pyx_r = Py_None;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
+ * return None
+ * else:
+ * return <object>arr.base # <<<<<<<<<<<<<<
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
+ __pyx_r = ((PyObject *)__pyx_v_arr->base);
+ goto __pyx_L0;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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();
+ return __pyx_r;
+}
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef __pyx_moduledef = {
+ #if PY_VERSION_HEX < 0x03020000
+ { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
+ #else
+ PyModuleDef_HEAD_INIT,
+ #endif
+ "cf_io",
+ __pyx_k_New_Cython_version_of_cf_iomodul, /* m_doc */
+ -1, /* m_size */
+ __pyx_methods /* m_methods */,
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_kp_s_2013_European_Synchrotron_Radiat, __pyx_k_2013_European_Synchrotron_Radiat, sizeof(__pyx_k_2013_European_Synchrotron_Radiat), 0, 0, 1, 0},
+ {&__pyx_n_s_CF_BIN, __pyx_k_CF_BIN, sizeof(__pyx_k_CF_BIN), 0, 0, 1, 1},
+ {&__pyx_n_s_CF_GZ_COMP, __pyx_k_CF_GZ_COMP, sizeof(__pyx_k_CF_GZ_COMP), 0, 0, 1, 1},
+ {&__pyx_n_s_CF_H, __pyx_k_CF_H, sizeof(__pyx_k_CF_H), 0, 0, 1, 1},
+ {&__pyx_n_s_CF_HEADER_ITEM, __pyx_k_CF_HEADER_ITEM, sizeof(__pyx_k_CF_HEADER_ITEM), 0, 0, 1, 1},
+ {&__pyx_n_s_CF_INIT_COLS, __pyx_k_CF_INIT_COLS, sizeof(__pyx_k_CF_INIT_COLS), 0, 0, 1, 1},
+ {&__pyx_n_s_CF_INIT_ROWS, __pyx_k_CF_INIT_ROWS, sizeof(__pyx_k_CF_INIT_ROWS), 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_s_Jerome_Kieffer, __pyx_k_Jerome_Kieffer, sizeof(__pyx_k_Jerome_Kieffer), 0, 0, 1, 0},
+ {&__pyx_n_s_MIT, __pyx_k_MIT, sizeof(__pyx_k_MIT), 0, 0, 1, 1},
+ {&__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_Unrecognized_mode_for_columnfile, __pyx_k_Unrecognized_mode_for_columnfile, sizeof(__pyx_k_Unrecognized_mode_for_columnfile), 0, 0, 1, 0},
+ {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
+ {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
+ {&__pyx_n_s_authors, __pyx_k_authors, sizeof(__pyx_k_authors), 0, 0, 1, 1},
+ {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
+ {&__pyx_n_s_cf, __pyx_k_cf, sizeof(__pyx_k_cf), 0, 0, 1, 1},
+ {&__pyx_n_s_clabels, __pyx_k_clabels, sizeof(__pyx_k_clabels), 0, 0, 1, 1},
+ {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
+ {&__pyx_n_s_contact, __pyx_k_contact, sizeof(__pyx_k_contact), 0, 0, 1, 1},
+ {&__pyx_n_s_copyright, __pyx_k_copyright, sizeof(__pyx_k_copyright), 0, 0, 1, 1},
+ {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 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_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
+ {&__pyx_n_s_fabio_ext_cf_io, __pyx_k_fabio_ext_cf_io, sizeof(__pyx_k_fabio_ext_cf_io), 0, 0, 1, 1},
+ {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1},
+ {&__pyx_n_s_fdopen, __pyx_k_fdopen, sizeof(__pyx_k_fdopen), 0, 0, 1, 1},
+ {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
+ {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
+ {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
+ {&__pyx_n_s_fname, __pyx_k_fname, sizeof(__pyx_k_fname), 0, 0, 1, 1},
+ {&__pyx_n_s_getLogger, __pyx_k_getLogger, sizeof(__pyx_k_getLogger), 0, 0, 1, 1},
+ {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+ {&__pyx_kp_s_jerome_kieffer_esrf_eu, __pyx_k_jerome_kieffer_esrf_eu, sizeof(__pyx_k_jerome_kieffer_esrf_eu), 0, 0, 1, 0},
+ {&__pyx_n_s_license, __pyx_k_license, sizeof(__pyx_k_license), 0, 0, 1, 1},
+ {&__pyx_n_s_logger, __pyx_k_logger, sizeof(__pyx_k_logger), 0, 0, 1, 1},
+ {&__pyx_n_s_logging, __pyx_k_logging, sizeof(__pyx_k_logging), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_mkstemp, __pyx_k_mkstemp, sizeof(__pyx_k_mkstemp), 0, 0, 1, 1},
+ {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
+ {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 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_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+ {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
+ {&__pyx_n_s_py_data, __pyx_k_py_data, sizeof(__pyx_k_py_data), 0, 0, 1, 1},
+ {&__pyx_n_s_py_file, __pyx_k_py_file, sizeof(__pyx_k_py_file), 0, 0, 1, 1},
+ {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+ {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
+ {&__pyx_n_s_tempfile, __pyx_k_tempfile, sizeof(__pyx_k_tempfile), 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_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 0, 1, 1},
+ {&__pyx_kp_s_workspace_valls_fabio_git_fabio, __pyx_k_workspace_valls_fabio_git_fabio, sizeof(__pyx_k_workspace_valls_fabio_git_fabio), 0, 0, 1, 0},
+ {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
+ {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static int __Pyx_InitCachedBuiltins(void) {
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __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;
+}
+
+static int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "fabio/ext/cf_io.pyx":104
+ * # check for failure to read
+ * if (cf__ == NULL):
+ * return None, None # <<<<<<<<<<<<<<
+ * dims = (cf__.nrows, cf__.ncols)
+ *
+ */
+ __pyx_tuple_ = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple_);
+ __Pyx_GIVEREF(__pyx_tuple_);
+
+ /* "../../../usr/lib/python2.7/dist-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_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__2);
+ __Pyx_GIVEREF(__pyx_tuple__2);
+
+ /* "../../../usr/lib/python2.7/dist-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_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__3);
+ __Pyx_GIVEREF(__pyx_tuple__3);
+
+ /* "../../../usr/lib/python2.7/dist-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_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__4);
+ __Pyx_GIVEREF(__pyx_tuple__4);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
+ *
+ * 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_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__5);
+ __Pyx_GIVEREF(__pyx_tuple__5);
+
+ /* "../../../usr/lib/python2.7/dist-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_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 = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__6);
+ __Pyx_GIVEREF(__pyx_tuple__6);
+
+ /* "../../../usr/lib/python2.7/dist-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_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__7);
+ __Pyx_GIVEREF(__pyx_tuple__7);
+
+ /* "fabio/ext/cf_io.pyx":71
+ *
+ *
+ * def read(py_file, mode="a"): # <<<<<<<<<<<<<<
+ * """
+ * Call the c-columnfile reading interface.
+ */
+ __pyx_tuple__8 = PyTuple_Pack(11, __pyx_n_s_py_file, __pyx_n_s_mode, __pyx_n_s_cf, __pyx_n_s_flags, __pyx_n_s_fd, __pyx_n_s_i, __pyx_n_s_file, __pyx_n_s_fname, __pyx_n_s_dims, __pyx_n_s_py_data, __pyx_n_s_clabels); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__8);
+ __Pyx_GIVEREF(__pyx_tuple__8);
+ __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_workspace_valls_fabio_git_fabio, __pyx_n_s_read, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+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_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_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_int_128 = PyInt_FromLong(128); if (unlikely(!__pyx_int_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_int_8192 = PyInt_FromLong(8192); if (unlikely(!__pyx_int_8192)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+#if PY_MAJOR_VERSION < 3
+PyMODINIT_FUNC initcf_io(void); /*proto*/
+PyMODINIT_FUNC initcf_io(void)
+#else
+PyMODINIT_FUNC PyInit_cf_io(void); /*proto*/
+PyMODINIT_FUNC PyInit_cf_io(void)
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_REFNANNY
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+ if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+ }
+ #endif
+ __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_cf_io(void)", 0);
+ if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #ifdef __Pyx_CyFunction_USED
+ if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
+ /*--- Module creation code ---*/
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("cf_io", __pyx_methods, __pyx_k_New_Cython_version_of_cf_iomodul, 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_fabio__ext__cf_io) {
+ 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;}
+ if (!PyDict_GetItemString(modules, "fabio.ext.cf_io")) {
+ if (unlikely(PyDict_SetItemString(modules, "fabio.ext.cf_io", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+ /*--- 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 ---*/
+ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Global init code ---*/
+ /*--- Variable export code ---*/
+ /*--- Function export code ---*/
+ /*--- Type init code ---*/
+ /*--- Type import code ---*/
+ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
+ #if CYTHON_COMPILING_IN_PYPY
+ sizeof(PyTypeObject),
+ #else
+ sizeof(PyHeapTypeObject),
+ #endif
+ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Variable import code ---*/
+ /*--- Function import code ---*/
+ /*--- Execution code ---*/
+
+ /* "fabio/ext/cf_io.pyx":30
+ * """New Cython version of cf_iomodule.c for preparing the migration to Python3"""
+ *
+ * __authors__ = ["Jerome Kieffer"] # <<<<<<<<<<<<<<
+ * __contact__ = "jerome.kieffer@esrf.eu"
+ * __license__ = "MIT"
+ */
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_kp_s_Jerome_Kieffer);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_Jerome_Kieffer);
+ __Pyx_GIVEREF(__pyx_kp_s_Jerome_Kieffer);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/cf_io.pyx":31
+ *
+ * __authors__ = ["Jerome Kieffer"]
+ * __contact__ = "jerome.kieffer@esrf.eu" # <<<<<<<<<<<<<<
+ * __license__ = "MIT"
+ * __copyright__ = "2013, European Synchrotron Radiation Facility, Grenoble, France"
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_contact, __pyx_kp_s_jerome_kieffer_esrf_eu) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/cf_io.pyx":32
+ * __authors__ = ["Jerome Kieffer"]
+ * __contact__ = "jerome.kieffer@esrf.eu"
+ * __license__ = "MIT" # <<<<<<<<<<<<<<
+ * __copyright__ = "2013, European Synchrotron Radiation Facility, Grenoble, France"
+ *
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/cf_io.pyx":33
+ * __contact__ = "jerome.kieffer@esrf.eu"
+ * __license__ = "MIT"
+ * __copyright__ = "2013, European Synchrotron Radiation Facility, Grenoble, France" # <<<<<<<<<<<<<<
+ *
+ * import cython
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_2013_European_Synchrotron_Radiat) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/cf_io.pyx":37
+ * import cython
+ * cimport numpy
+ * import numpy # <<<<<<<<<<<<<<
+ * import os
+ * import tempfile
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/cf_io.pyx":38
+ * cimport numpy
+ * import numpy
+ * import os # <<<<<<<<<<<<<<
+ * import tempfile
+ * import logging
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/cf_io.pyx":39
+ * import numpy
+ * import os
+ * import tempfile # <<<<<<<<<<<<<<
+ * import logging
+ * logger = logging.getLogger(__name__)
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_tempfile, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_tempfile, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/cf_io.pyx":40
+ * import os
+ * import tempfile
+ * import logging # <<<<<<<<<<<<<<
+ * logger = logging.getLogger(__name__)
+ *
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/cf_io.pyx":41
+ * import tempfile
+ * import logging
+ * logger = logging.getLogger(__name__) # <<<<<<<<<<<<<<
+ *
+ * from libc.string cimport memcpy
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (!__pyx_t_4) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ 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+1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __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;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/cf_io.pyx":46
+ * from libc.stdio cimport fopen, FILE
+ *
+ * CF_H = 1 # <<<<<<<<<<<<<<
+ *
+ * CF_INIT_ROWS = 8192
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CF_H, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/cf_io.pyx":48
+ * CF_H = 1
+ *
+ * CF_INIT_ROWS = 8192 # <<<<<<<<<<<<<<
+ * CF_INIT_COLS = 32
+ * CF_HEADER_ITEM = 128
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CF_INIT_ROWS, __pyx_int_8192) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/cf_io.pyx":49
+ *
+ * CF_INIT_ROWS = 8192
+ * CF_INIT_COLS = 32 # <<<<<<<<<<<<<<
+ * CF_HEADER_ITEM = 128
+ *
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CF_INIT_COLS, __pyx_int_32) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/cf_io.pyx":50
+ * CF_INIT_ROWS = 8192
+ * CF_INIT_COLS = 32
+ * CF_HEADER_ITEM = 128 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CF_HEADER_ITEM, __pyx_int_128) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/cf_io.pyx":53
+ *
+ *
+ * CF_GZ_COMP = 1 # <<<<<<<<<<<<<<
+ * CF_BIN = 2
+ *
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CF_GZ_COMP, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/cf_io.pyx":54
+ *
+ * CF_GZ_COMP = 1
+ * CF_BIN = 2 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CF_BIN, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/cf_io.pyx":71
+ *
+ *
+ * def read(py_file, mode="a"): # <<<<<<<<<<<<<<
+ * """
+ * Call the c-columnfile reading interface.
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5fabio_3ext_5cf_io_1read, NULL, __pyx_n_s_fabio_ext_cf_io); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_read, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/cf_io.pyx":1
+ * # coding: utf-8 # <<<<<<<<<<<<<<
+ * #
+ * # Project: X-ray image reader
+ */
+ __pyx_t_1 = PyDict_New(); 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 (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __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;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init fabio.ext.cf_io", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_DECREF(__pyx_m); __pyx_m = 0;
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init fabio.ext.cf_io");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if PY_MAJOR_VERSION < 3
+ return;
+ #else
+ return __pyx_m;
+ #endif
+}
+
+/* Runtime support code */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+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;
+}
+
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AsString(kw_name));
+ #endif
+}
+
+static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ name = first_kw_arg;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ values[name-argnames] = value;
+ continue;
+ }
+ name = first_kw_arg;
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
+ while (*name) {
+ if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**name, key)) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ if ((**argname == key) || (
+ (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**argname, key))) {
+ goto arg_passed_twice;
+ }
+ argname++;
+ }
+ }
+ } else
+ #endif
+ if (likely(PyUnicode_Check(key))) {
+ while (*name) {
+ int cmp = (**name == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**name, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ int cmp = (**argname == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**argname, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) goto arg_passed_twice;
+ argname++;
+ }
+ }
+ } else
+ goto invalid_keyword_type;
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, key);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+bad:
+ return -1;
+}
+
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *more_or_less;
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+ func_name, more_or_less, num_expected,
+ (num_expected == 1) ? "" : "s", num_found);
+}
+
+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
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+ PyObject *self, *result;
+ PyCFunction cfunc;
+ cfunc = PyCFunction_GET_FUNCTION(func);
+ self = PyCFunction_GET_SELF(func);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = cfunc(self, arg);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_New(1);
+ if (unlikely(!args)) return NULL;
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(args, 0, arg);
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+ return __Pyx_PyObject_CallMethO(func, arg);
+ }
+ }
+ return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject* args = PyTuple_Pack(1, arg);
+ return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
+ return __Pyx_PyObject_CallMethO(func, NULL);
+ }
+ }
+ return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
+}
+#endif
+
+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 int __Pyx_IterFinish(void) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject* exc_type = tstate->curexc_type;
+ if (unlikely(exc_type)) {
+ if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
+ PyObject *exc_value, *exc_tb;
+ exc_value = tstate->curexc_value;
+ exc_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+ Py_DECREF(exc_type);
+ Py_XDECREF(exc_value);
+ Py_XDECREF(exc_tb);
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+ return 0;
+#else
+ if (unlikely(PyErr_Occurred())) {
+ if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
+ PyErr_Clear();
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+ return 0;
+#endif
+}
+
+static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
+ if (unlikely(retval)) {
+ Py_DECREF(retval);
+ __Pyx_RaiseTooManyValuesError(expected);
+ return -1;
+ } else {
+ return __Pyx_IterFinish();
+ }
+ return 0;
+}
+
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ if (likely(PyObject_TypeCheck(obj, type)))
+ return 1;
+ PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
+ Py_TYPE(obj)->tp_name, type->tp_name);
+ return 0;
+}
+
+static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
+ unsigned int n = 1;
+ return *(unsigned char*)(&n) != 0;
+}
+static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type) {
+ stack[0].field = &ctx->root;
+ stack[0].parent_offset = 0;
+ ctx->root.type = type;
+ ctx->root.name = "buffer dtype";
+ ctx->root.offset = 0;
+ ctx->head = stack;
+ ctx->head->field = &ctx->root;
+ ctx->fmt_offset = 0;
+ ctx->head->parent_offset = 0;
+ ctx->new_packmode = '@';
+ ctx->enc_packmode = '@';
+ ctx->new_count = 1;
+ ctx->enc_count = 0;
+ ctx->enc_type = 0;
+ ctx->is_complex = 0;
+ ctx->is_valid_array = 0;
+ ctx->struct_alignment = 0;
+ while (type->typegroup == 'S') {
+ ++ctx->head;
+ ctx->head->field = type->fields;
+ ctx->head->parent_offset = 0;
+ type = type->fields->type;
+ }
+}
+static int __Pyx_BufFmt_ParseNumber(const char** ts) {
+ int count;
+ const char* t = *ts;
+ if (*t < '0' || *t > '9') {
+ return -1;
+ } else {
+ count = *t++ - '0';
+ while (*t >= '0' && *t < '9') {
+ count *= 10;
+ count += *t++ - '0';
+ }
+ }
+ *ts = t;
+ return count;
+}
+static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
+ int number = __Pyx_BufFmt_ParseNumber(ts);
+ if (number == -1)
+ PyErr_Format(PyExc_ValueError,\
+ "Does not understand character buffer dtype format string ('%c')", **ts);
+ return number;
+}
+static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
+ PyErr_Format(PyExc_ValueError,
+ "Unexpected format string character: '%c'", ch);
+}
+static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
+ switch (ch) {
+ case 'c': return "'char'";
+ case 'b': return "'signed char'";
+ case 'B': return "'unsigned char'";
+ case 'h': return "'short'";
+ case 'H': return "'unsigned short'";
+ case 'i': return "'int'";
+ case 'I': return "'unsigned int'";
+ case 'l': return "'long'";
+ case 'L': return "'unsigned long'";
+ case 'q': return "'long long'";
+ case 'Q': return "'unsigned long long'";
+ case 'f': return (is_complex ? "'complex float'" : "'float'");
+ case 'd': return (is_complex ? "'complex double'" : "'double'");
+ case 'g': return (is_complex ? "'complex long double'" : "'long double'");
+ case 'T': return "a struct";
+ case 'O': return "Python object";
+ case 'P': return "a pointer";
+ case 's': case 'p': return "a string";
+ case 0: return "end";
+ default: return "unparseable format string";
+ }
+}
+static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return 2;
+ case 'i': case 'I': case 'l': case 'L': return 4;
+ case 'q': case 'Q': return 8;
+ case 'f': return (is_complex ? 8 : 4);
+ case 'd': return (is_complex ? 16 : 8);
+ case 'g': {
+ PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
+ return 0;
+ }
+ case 'O': case 'P': return sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
+ switch (ch) {
+ case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(short);
+ case 'i': case 'I': return sizeof(int);
+ case 'l': case 'L': return sizeof(long);
+ #ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(PY_LONG_LONG);
+ #endif
+ case 'f': return sizeof(float) * (is_complex ? 2 : 1);
+ case 'd': return sizeof(double) * (is_complex ? 2 : 1);
+ case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
+ case 'O': case 'P': return sizeof(void*);
+ default: {
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+ }
+}
+typedef struct { char c; short x; } __Pyx_st_short;
+typedef struct { char c; int x; } __Pyx_st_int;
+typedef struct { char c; long x; } __Pyx_st_long;
+typedef struct { char c; float x; } __Pyx_st_float;
+typedef struct { char c; double x; } __Pyx_st_double;
+typedef struct { char c; long double x; } __Pyx_st_longdouble;
+typedef struct { char c; void *x; } __Pyx_st_void_p;
+#ifdef HAVE_LONG_LONG
+typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
+#endif
+static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
+ case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
+ case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
+#ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
+#endif
+ case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
+ case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
+ case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
+ case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+/* These are for computing the padding at the end of the struct to align
+ on the first member of the struct. This will probably the same as above,
+ but we don't have any guarantees.
+ */
+typedef struct { short x; char c; } __Pyx_pad_short;
+typedef struct { int x; char c; } __Pyx_pad_int;
+typedef struct { long x; char c; } __Pyx_pad_long;
+typedef struct { float x; char c; } __Pyx_pad_float;
+typedef struct { double x; char c; } __Pyx_pad_double;
+typedef struct { long double x; char c; } __Pyx_pad_longdouble;
+typedef struct { void *x; char c; } __Pyx_pad_void_p;
+#ifdef HAVE_LONG_LONG
+typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
+#endif
+static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
+ case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
+ case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
+#ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
+#endif
+ case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
+ case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
+ case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
+ case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
+ switch (ch) {
+ case 'c':
+ return 'H';
+ case 'b': case 'h': case 'i':
+ case 'l': case 'q': case 's': case 'p':
+ return 'I';
+ case 'B': case 'H': case 'I': case 'L': case 'Q':
+ return 'U';
+ case 'f': case 'd': case 'g':
+ return (is_complex ? 'C' : 'R');
+ case 'O':
+ return 'O';
+ case 'P':
+ return 'P';
+ default: {
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+ }
+}
+static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
+ if (ctx->head == NULL || ctx->head->field == &ctx->root) {
+ const char* expected;
+ const char* quote;
+ if (ctx->head == NULL) {
+ expected = "end";
+ quote = "";
+ } else {
+ expected = ctx->head->field->type->name;
+ quote = "'";
+ }
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch, expected %s%s%s but got %s",
+ quote, expected, quote,
+ __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
+ } else {
+ __Pyx_StructField* field = ctx->head->field;
+ __Pyx_StructField* parent = (ctx->head - 1)->field;
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
+ field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
+ parent->type->name, field->name);
+ }
+}
+static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
+ char group;
+ size_t size, offset, arraysize = 1;
+ if (ctx->enc_type == 0) return 0;
+ if (ctx->head->field->type->arraysize[0]) {
+ int i, ndim = 0;
+ if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
+ ctx->is_valid_array = ctx->head->field->type->ndim == 1;
+ ndim = 1;
+ if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
+ PyErr_Format(PyExc_ValueError,
+ "Expected a dimension of size %zu, got %zu",
+ ctx->head->field->type->arraysize[0], ctx->enc_count);
+ return -1;
+ }
+ }
+ if (!ctx->is_valid_array) {
+ PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
+ ctx->head->field->type->ndim, ndim);
+ return -1;
+ }
+ for (i = 0; i < ctx->head->field->type->ndim; i++) {
+ arraysize *= ctx->head->field->type->arraysize[i];
+ }
+ ctx->is_valid_array = 0;
+ ctx->enc_count = 1;
+ }
+ group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
+ do {
+ __Pyx_StructField* field = ctx->head->field;
+ __Pyx_TypeInfo* type = field->type;
+ if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
+ size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
+ } else {
+ size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
+ }
+ if (ctx->enc_packmode == '@') {
+ size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
+ size_t align_mod_offset;
+ if (align_at == 0) return -1;
+ align_mod_offset = ctx->fmt_offset % align_at;
+ if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
+ if (ctx->struct_alignment == 0)
+ ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
+ ctx->is_complex);
+ }
+ if (type->size != size || type->typegroup != group) {
+ if (type->typegroup == 'C' && type->fields != NULL) {
+ size_t parent_offset = ctx->head->parent_offset + field->offset;
+ ++ctx->head;
+ ctx->head->field = type->fields;
+ ctx->head->parent_offset = parent_offset;
+ continue;
+ }
+ if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
+ } else {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return -1;
+ }
+ }
+ offset = ctx->head->parent_offset + field->offset;
+ if (ctx->fmt_offset != offset) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
+ (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
+ return -1;
+ }
+ ctx->fmt_offset += size;
+ if (arraysize)
+ ctx->fmt_offset += (arraysize - 1) * size;
+ --ctx->enc_count;
+ while (1) {
+ if (field == &ctx->root) {
+ ctx->head = NULL;
+ if (ctx->enc_count != 0) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return -1;
+ }
+ break;
+ }
+ ctx->head->field = ++field;
+ if (field->type == NULL) {
+ --ctx->head;
+ field = ctx->head->field;
+ continue;
+ } else if (field->type->typegroup == 'S') {
+ size_t parent_offset = ctx->head->parent_offset + field->offset;
+ if (field->type->fields->type == NULL) continue;
+ field = field->type->fields;
+ ++ctx->head;
+ ctx->head->field = field;
+ ctx->head->parent_offset = parent_offset;
+ break;
+ } else {
+ break;
+ }
+ }
+ } while (ctx->enc_count);
+ ctx->enc_type = 0;
+ ctx->is_complex = 0;
+ return 0;
+}
+static CYTHON_INLINE PyObject *
+__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
+{
+ const char *ts = *tsp;
+ int i = 0, number;
+ int ndim = ctx->head->field->type->ndim;
+;
+ ++ts;
+ if (ctx->new_count != 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "Cannot handle repeated arrays in format string");
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ while (*ts && *ts != ')') {
+ 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])
+ return PyErr_Format(PyExc_ValueError,
+ "Expected a dimension of size %zu, got %d",
+ ctx->head->field->type->arraysize[i], number);
+ if (*ts != ',' && *ts != ')')
+ return PyErr_Format(PyExc_ValueError,
+ "Expected a comma in format string, got '%c'", *ts);
+ if (*ts == ',') ts++;
+ i++;
+ }
+ if (i != ndim)
+ return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
+ ctx->head->field->type->ndim, i);
+ if (!*ts) {
+ PyErr_SetString(PyExc_ValueError,
+ "Unexpected end of format string, expected ')'");
+ return NULL;
+ }
+ ctx->is_valid_array = 1;
+ ctx->new_count = 1;
+ *tsp = ++ts;
+ return Py_None;
+}
+static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
+ int got_Z = 0;
+ while (1) {
+ switch(*ts) {
+ case 0:
+ if (ctx->enc_type != 0 && ctx->head == NULL) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ if (ctx->head != NULL) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return NULL;
+ }
+ return ts;
+ case ' ':
+ case '\r':
+ case '\n':
+ ++ts;
+ break;
+ case '<':
+ if (!__Pyx_IsLittleEndian()) {
+ PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
+ return NULL;
+ }
+ ctx->new_packmode = '=';
+ ++ts;
+ break;
+ case '>':
+ case '!':
+ if (__Pyx_IsLittleEndian()) {
+ PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
+ return NULL;
+ }
+ ctx->new_packmode = '=';
+ ++ts;
+ break;
+ case '=':
+ case '@':
+ case '^':
+ ctx->new_packmode = *ts++;
+ break;
+ case 'T':
+ {
+ const char* ts_after_sub;
+ size_t i, struct_count = ctx->new_count;
+ size_t struct_alignment = ctx->struct_alignment;
+ ctx->new_count = 1;
+ ++ts;
+ if (*ts != '{') {
+ PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->enc_type = 0;
+ ctx->enc_count = 0;
+ ctx->struct_alignment = 0;
+ ++ts;
+ ts_after_sub = ts;
+ for (i = 0; i != struct_count; ++i) {
+ ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
+ if (!ts_after_sub) return NULL;
+ }
+ ts = ts_after_sub;
+ if (struct_alignment) ctx->struct_alignment = struct_alignment;
+ }
+ break;
+ case '}':
+ {
+ size_t alignment = ctx->struct_alignment;
+ ++ts;
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->enc_type = 0;
+ if (alignment && ctx->fmt_offset % alignment) {
+ ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
+ }
+ }
+ return ts;
+ case 'x':
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->fmt_offset += ctx->new_count;
+ ctx->new_count = 1;
+ ctx->enc_count = 0;
+ ctx->enc_type = 0;
+ ctx->enc_packmode = ctx->new_packmode;
+ ++ts;
+ break;
+ case 'Z':
+ got_Z = 1;
+ ++ts;
+ if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
+ __Pyx_BufFmt_RaiseUnexpectedChar('Z');
+ return NULL;
+ }
+ 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 'p':
+ if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
+ ctx->enc_packmode == ctx->new_packmode) {
+ ctx->enc_count += ctx->new_count;
+ 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;
+ break;
+ case ':':
+ ++ts;
+ while(*ts != ':') ++ts;
+ ++ts;
+ break;
+ case '(':
+ if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
+ break;
+ default:
+ {
+ int number = __Pyx_BufFmt_ExpectNumber(&ts);
+ if (number == -1) return NULL;
+ ctx->new_count = (size_t)number;
+ }
+ }
+ }
+}
+static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
+ buf->buf = NULL;
+ buf->obj = NULL;
+ buf->strides = __Pyx_zeros;
+ buf->shape = __Pyx_zeros;
+ buf->suboffsets = __Pyx_minusones;
+}
+static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
+ Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
+ int nd, int cast, __Pyx_BufFmt_StackElem* stack)
+{
+ if (obj == Py_None || obj == NULL) {
+ __Pyx_ZeroBuffer(buf);
+ return 0;
+ }
+ buf->buf = NULL;
+ if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
+ if (buf->ndim != nd) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer has wrong number of dimensions (expected %d, got %d)",
+ nd, buf->ndim);
+ goto fail;
+ }
+ if (!cast) {
+ __Pyx_BufFmt_Context ctx;
+ __Pyx_BufFmt_Init(&ctx, stack, dtype);
+ if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
+ }
+ if ((unsigned)buf->itemsize != dtype->size) {
+ PyErr_Format(PyExc_ValueError,
+ "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
+ buf->itemsize, (buf->itemsize > 1) ? "s" : "",
+ dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
+ goto fail;
+ }
+ if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
+ return 0;
+fail:;
+ __Pyx_ZeroBuffer(buf);
+ return -1;
+}
+static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
+ if (info->buf == NULL) return;
+ if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
+ __Pyx_ReleaseBuffer(info);
+}
+
+static void __Pyx_RaiseBufferIndexError(int axis) {
+ PyErr_Format(PyExc_IndexError,
+ "Out of bounds on buffer access (axis %d)", axis);
+}
+
+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;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_Restore(type, value, tb);
+#endif
+}
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(type, value, tb);
+#endif
+}
+
+#if PY_MAJOR_VERSION < 3
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
+ CYTHON_UNUSED PyObject *cause) {
+ Py_XINCREF(type);
+ if (!value || value == Py_None)
+ value = NULL;
+ else
+ Py_INCREF(value);
+ if (!tb || tb == Py_None)
+ tb = NULL;
+ else {
+ Py_INCREF(tb);
+ if (!PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto raise_error;
+ }
+ }
+ if (PyType_Check(type)) {
+#if CYTHON_COMPILING_IN_PYPY
+ if (!value) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#endif
+ PyErr_NormalizeException(&type, &value, &tb);
+ } else {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto raise_error;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(type);
+ Py_INCREF(type);
+ if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto raise_error;
+ }
+ }
+ __Pyx_ErrRestore(type, value, tb);
+ return;
+raise_error:
+ Py_XDECREF(value);
+ Py_XDECREF(type);
+ Py_XDECREF(tb);
+ return;
+}
+#else
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
+ PyObject* owned_instance = NULL;
+ if (tb == Py_None) {
+ tb = 0;
+ } else if (tb && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto bad;
+ }
+ if (value == Py_None)
+ value = 0;
+ if (PyExceptionInstance_Check(type)) {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto bad;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(value);
+ } else if (PyExceptionClass_Check(type)) {
+ PyObject *instance_class = NULL;
+ if (value && PyExceptionInstance_Check(value)) {
+ instance_class = (PyObject*) Py_TYPE(value);
+ if (instance_class != type) {
+ if (PyObject_IsSubclass(instance_class, type)) {
+ type = instance_class;
+ } else {
+ instance_class = NULL;
+ }
+ }
+ }
+ if (!instance_class) {
+ PyObject *args;
+ if (!value)
+ args = PyTuple_New(0);
+ else if (PyTuple_Check(value)) {
+ Py_INCREF(value);
+ args = value;
+ } else
+ args = PyTuple_Pack(1, value);
+ if (!args)
+ goto bad;
+ owned_instance = PyObject_Call(type, args, NULL);
+ Py_DECREF(args);
+ if (!owned_instance)
+ goto bad;
+ value = owned_instance;
+ if (!PyExceptionInstance_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "calling %R should have returned an instance of "
+ "BaseException, not %R",
+ type, Py_TYPE(value));
+ goto bad;
+ }
+ }
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto bad;
+ }
+#if PY_VERSION_HEX >= 0x03030000
+ if (cause) {
+#else
+ if (cause && cause != Py_None) {
+#endif
+ PyObject *fixed_cause;
+ if (cause == Py_None) {
+ fixed_cause = NULL;
+ } else if (PyExceptionClass_Check(cause)) {
+ fixed_cause = PyObject_CallObject(cause, NULL);
+ if (fixed_cause == NULL)
+ goto bad;
+ } else if (PyExceptionInstance_Check(cause)) {
+ fixed_cause = cause;
+ Py_INCREF(fixed_cause);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "exception causes must derive from "
+ "BaseException");
+ goto bad;
+ }
+ PyException_SetCause(value, fixed_cause);
+ }
+ PyErr_SetObject(type, value);
+ if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
+ Py_INCREF(tb);
+ PyErr_Restore(tmp_type, tmp_value, tb);
+ Py_XDECREF(tmp_tb);
+#else
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject* tmp_tb = tstate->curexc_traceback;
+ if (tb != tmp_tb) {
+ Py_INCREF(tb);
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_tb);
+ }
+#endif
+ }
+bad:
+ Py_XDECREF(owned_instance);
+ return;
+}
+#endif
+
+static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+}
+
+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) {
+ if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
+ if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
+ 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;
+ if (!obj) return;
+ if (PyObject_CheckBuffer(obj)) {
+ PyBuffer_Release(view);
+ return;
+ }
+ if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(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;
+}
+
+#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 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_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;
+}
+
+#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;
+ z.real = a.real + b.real;
+ z.imag = a.imag + b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ z.real = a.real - b.real;
+ z.imag = a.imag - b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ z.real = a.real * b.real - a.imag * b.imag;
+ z.imag = a.real * b.imag + a.imag * b.real;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ float denom = b.real * b.real + b.imag * b.imag;
+ z.real = (a.real * b.real + a.imag * b.imag) / denom;
+ z.imag = (a.imag * b.real - a.real * b.imag) / denom;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
+ __pyx_t_float_complex z;
+ z.real = -a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
+ return (a.real == 0) && (a.imag == 0);
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
+ __pyx_t_float_complex z;
+ z.real = a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ #if 1
+ static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
+ #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
+ return sqrtf(z.real*z.real + z.imag*z.imag);
+ #else
+ return hypotf(z.real, z.imag);
+ #endif
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ float r, lnr, theta, z_r, z_theta;
+ if (b.imag == 0 && b.real == (int)b.real) {
+ if (b.real < 0) {
+ float denom = a.real * a.real + a.imag * a.imag;
+ a.real = a.real / denom;
+ a.imag = -a.imag / denom;
+ b.real = -b.real;
+ }
+ switch ((int)b.real) {
+ case 0:
+ z.real = 1;
+ z.imag = 0;
+ return z;
+ case 1:
+ return a;
+ case 2:
+ z = __Pyx_c_prodf(a, a);
+ return __Pyx_c_prodf(a, a);
+ case 3:
+ z = __Pyx_c_prodf(a, a);
+ return __Pyx_c_prodf(z, a);
+ case 4:
+ z = __Pyx_c_prodf(a, a);
+ return __Pyx_c_prodf(z, z);
+ }
+ }
+ if (a.imag == 0) {
+ if (a.real == 0) {
+ return a;
+ }
+ r = a.real;
+ theta = 0;
+ } else {
+ r = __Pyx_c_absf(a);
+ theta = atan2f(a.imag, a.real);
+ }
+ lnr = logf(r);
+ z_r = expf(lnr * b.real - theta * b.imag);
+ z_theta = theta * b.real + lnr * b.imag;
+ z.real = z_r * cosf(z_theta);
+ z.imag = z_r * sinf(z_theta);
+ return z;
+ }
+ #endif
+#endif
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ return ::std::complex< double >(x, y);
+ }
+ #else
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ return x + y*(__pyx_t_double_complex)_Complex_I;
+ }
+ #endif
+#else
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ __pyx_t_double_complex z;
+ z.real = x;
+ z.imag = y;
+ return z;
+ }
+#endif
+
+#if CYTHON_CCOMPLEX
+#else
+ static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ return (a.real == b.real) && (a.imag == b.imag);
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real + b.real;
+ z.imag = a.imag + b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real - b.real;
+ z.imag = a.imag - b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real * b.real - a.imag * b.imag;
+ z.imag = a.real * b.imag + a.imag * b.real;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ double denom = b.real * b.real + b.imag * b.imag;
+ z.real = (a.real * b.real + a.imag * b.imag) / denom;
+ z.imag = (a.imag * b.real - a.real * b.imag) / denom;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
+ __pyx_t_double_complex z;
+ z.real = -a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
+ return (a.real == 0) && (a.imag == 0);
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
+ __pyx_t_double_complex z;
+ z.real = a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ #if 1
+ static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
+ #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
+ return sqrt(z.real*z.real + z.imag*z.imag);
+ #else
+ return hypot(z.real, z.imag);
+ #endif
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ double r, lnr, theta, z_r, z_theta;
+ if (b.imag == 0 && b.real == (int)b.real) {
+ if (b.real < 0) {
+ double denom = a.real * a.real + a.imag * a.imag;
+ a.real = a.real / denom;
+ a.imag = -a.imag / denom;
+ b.real = -b.real;
+ }
+ switch ((int)b.real) {
+ case 0:
+ z.real = 1;
+ z.imag = 0;
+ return z;
+ case 1:
+ 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 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);
+ }
+}
+
+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
+ 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
+ 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;
+}
+
+static int __Pyx_check_binary_version(void) {
+ char ctversion[4], rtversion[4];
+ PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
+ if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
+ char message[200];
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+#ifndef __PYX_HAVE_RT_ImportModule
+#define __PYX_HAVE_RT_ImportModule
+static PyObject *__Pyx_ImportModule(const char *name) {
+ PyObject *py_name = 0;
+ PyObject *py_module = 0;
+ py_name = __Pyx_PyIdentifier_FromString(name);
+ if (!py_name)
+ goto bad;
+ py_module = PyImport_Import(py_name);
+ Py_DECREF(py_name);
+ return py_module;
+bad:
+ Py_XDECREF(py_name);
+ return 0;
+}
+#endif
+
+#ifndef __PYX_HAVE_RT_ImportType
+#define __PYX_HAVE_RT_ImportType
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
+ size_t size, int strict)
+{
+ PyObject *py_module = 0;
+ PyObject *result = 0;
+ PyObject *py_name = 0;
+ char warning[200];
+ Py_ssize_t basicsize;
+#ifdef Py_LIMITED_API
+ PyObject *py_basicsize;
+#endif
+ py_module = __Pyx_ImportModule(module_name);
+ if (!py_module)
+ goto bad;
+ py_name = __Pyx_PyIdentifier_FromString(class_name);
+ if (!py_name)
+ goto bad;
+ result = PyObject_GetAttr(py_module, py_name);
+ Py_DECREF(py_name);
+ py_name = 0;
+ Py_DECREF(py_module);
+ py_module = 0;
+ if (!result)
+ goto bad;
+ if (!PyType_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.%.200s is not a type object",
+ module_name, class_name);
+ goto bad;
+ }
+#ifndef Py_LIMITED_API
+ basicsize = ((PyTypeObject *)result)->tp_basicsize;
+#else
+ py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
+ if (!py_basicsize)
+ goto bad;
+ basicsize = PyLong_AsSsize_t(py_basicsize);
+ Py_DECREF(py_basicsize);
+ py_basicsize = 0;
+ if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
+ goto bad;
+#endif
+ if (!strict && (size_t)basicsize > size) {
+ PyOS_snprintf(warning, sizeof(warning),
+ "%s.%s size changed, may indicate binary incompatibility",
+ module_name, class_name);
+ if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
+ }
+ else if ((size_t)basicsize != size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s has the wrong size, try recompiling",
+ module_name, class_name);
+ goto bad;
+ }
+ return (PyTypeObject *)result;
+bad:
+ Py_XDECREF(py_module);
+ Py_XDECREF(result);
+ return NULL;
+}
+#endif
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __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;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+ PyNumberMethods *m;
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (PyInt_Check(x) || PyLong_Check(x))
+#else
+ if (PyLong_Check(x))
+#endif
+ return Py_INCREF(x), x;
+ m = Py_TYPE(x)->tp_as_number;
+#if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = PyNumber_Long(x);
+ }
+#else
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Long(x);
+ }
+#endif
+ if (res) {
+#if PY_MAJOR_VERSION < 3
+ if (!PyInt_Check(res) && !PyLong_Check(res)) {
+#else
+ if (!PyLong_Check(res)) {
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ name, name, Py_TYPE(res)->tp_name);
+ Py_DECREF(res);
+ return NULL;
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b)))
+ 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) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/fabio/ext/cf_io.pyx b/fabio/ext/cf_io.pyx
new file mode 100644
index 0000000..305e44a
--- /dev/null
+++ b/fabio/ext/cf_io.pyx
@@ -0,0 +1,119 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/kif/fabio
+#
+# Copyright (C) 2015 European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+"""New Cython version of cf_iomodule.c for preparing the migration to Python3"""
+
+__authors__ = ["Jerome Kieffer"]
+__contact__ = "jerome.kieffer@esrf.eu"
+__license__ = "MIT"
+__copyright__ = "2013, European Synchrotron Radiation Facility, Grenoble, France"
+
+import cython
+cimport numpy
+import numpy
+import os
+import tempfile
+import logging
+logger = logging.getLogger(__name__)
+
+from libc.string cimport memcpy
+from libc.stdio cimport fopen, FILE
+
+CF_H = 1
+
+CF_INIT_ROWS = 8192
+CF_INIT_COLS = 32
+CF_HEADER_ITEM = 128
+
+
+CF_GZ_COMP = 1
+CF_BIN = 2
+
+
+cdef extern from "columnfile.h":
+ struct cf_data:
+ int ncols, nrows
+ unsigned int nralloc
+ double **data
+ char **clabels
+ void * cf_read_ascii(void *fp, void *dest, unsigned int FLAGS)nogil
+ void * cf_read_bin(void *fp, void *dest, unsigned int FLAGS)nogil
+ int cf_write(char *fname, void *cf_handle, unsigned int FLAGS)nogil
+ int cf_write_bin(void *fp, void *cf_handle)nogil
+ int cf_write_ascii(void *fp, void *cf_handle,unsigned int FLAGS)nogil
+ void cf_free( cf_data *cf_handle)nogil
+
+
+def read(py_file, mode="a"):
+ """
+ Call the c-columnfile reading interface.
+ The mode keyword argument is either:
+ "a" for ascii (the default)
+ "b" for binary
+ """
+ cdef cf_data *cf__
+ cdef unsigned int flags = 0, fd
+
+ # perhaps not const
+ cdef int i
+ cdef FILE *file
+
+ # Here is a big issue !!! and I got an even worse solution !
+ # file = PyFile_AsFile(py_file)
+ (fd, fname) = tempfile.mkstemp()
+ os.fdopen(fd, mode="wb").write(py_file.read())
+ os.close(fd)
+ file = fopen(fname, "r")
+
+ if "z" in mode:
+ flags |= CF_GZ_COMP
+ if "b" in mode:
+ cf__ = <cf_data *> cf_read_bin(file, NULL, flags)
+ elif "a" in mode:
+ cf__ = <cf_data *> cf_read_ascii(file, NULL, flags)
+ else:
+ logger.error("Unrecognized mode for columnfile %s (assuming ascii)", mode)
+ cf__ = <cf_data *> cf_read_ascii(file, NULL, flags)
+
+ # check for failure to read
+ if (cf__ == NULL):
+ return None, None
+ dims = (cf__.nrows, cf__.ncols)
+
+ # since data may be non-contigous we can't simply create a numpy-array from
+ # cf__->data, as Numpy's memory model prohibits it
+ # i.e. py_data=(PyArrayObject*)PyArray_SimpleNewFromData(2, dims, NPY_DOUBLE, (void*)(&(cf__->data[0][0])))
+ # won't work
+ cdef numpy.ndarray[numpy.float64_t, ndim=2] py_data = numpy.empty(dims, dtype=numpy.float64)
+ for i in range(cf__.nrows):
+ memcpy(&py_data[i, 0], cf__.data[i], cf__.ncols * sizeof(double))
+ clabels = []
+ for i in range(cf__.ncols):
+ clabels.append(str(cf__.clabels[i]))
+ cf_free(cf__)
+
+ return py_data, clabels
diff --git a/fabio/ext/include/ccp4_pack.h b/fabio/ext/include/ccp4_pack.h
new file mode 100644
index 0000000..30c1906
--- /dev/null
+++ b/fabio/ext/include/ccp4_pack.h
@@ -0,0 +1,94 @@
+/* Fabio Mar345 ccp4_pack decompressor
+ Copyright (C) 2007-2009 Henning O. Sorensen & Erik Knudsen
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General
+ Public License along with this library; if not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301 USA */
+
+#ifndef CPP4_PACK_H
+#define CPP4_PACK_H
+
+#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
+#include <stdint.h>
+#else
+#include "msvc\\stdint.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+
+
+#define CCP4_PCK_BLOCK_HEADER_LENGTH 6
+#define CCP4_PCK_BLOCK_HEADER_LENGTH_V2 8
+
+
+#define PACKIDENTIFIER "\nCCP4 packed image, X: %04d, Y: %04d\n"
+// This string defines the start of a packed image. An image file is scanned
+// until this string is encountered, the size of the unpacked image is
+// determined from the values of X and Y (which are written out as formatted
+// ascii numbers), and the packed image is expected to start immediately after
+// the null-character ending the string.
+
+#define V2IDENTIFIER "\nCCP4 packed image V2, X: %04d, Y: %04d\n"
+// This string defines the start of a packed image. An image file is scanned
+// until this string is encountered, the size of the unpacked image is
+// determined from the values of X and Y (which are written out as formatted
+// ascii numbers), and the packed image is expected to start immediately after
+// the null-character ending the string.
+
+#define PACKBUFSIZ BUFSIZ
+// Size of internal buffer in which the packed array is stored during transit
+// form an unpacked image to a packed image on disk. It is set to the size
+// used by the buffered io-routines given in <stdio.h>, but it could be
+// anything.
+
+#define DIFFBUFSIZ 16384L
+// Size of the internal buffer in which the differences between neighbouring
+// pixels are stored prior to compression. The image is therefore compressed
+// in DIFFBUFSIZ chunks. Decompression does not need to know what DIFFBUFSIZ
+// was when the image was compressed. By increasing this value, the image
+// can be compressed into a packed image which is a few bytes smaller. Do
+// not decrease the value of DIFFBUFSIZ below 128L.
+
+
+#define pfail_nonzero(a) if ((a)) return NULL;
+#define max(x, y) (((x) > (y)) ? (x) : (y))
+#define min(x, y) (((x) < (y)) ? (x) : (y))
+
+#define shift_left(x, n) (((x) & CCP4_PCK_MASK_32[32 - (n)]) << (n))
+#define shift_right(x, n) (((x) >> (n)) & CCP4_PCK_MASK_32[32 - (n)])
+// This macro is included because the C standard does not properly define a
+// left shift: on some machines the bits which are pushed out at the left are
+// popped back in at the right. By masking, the macro prevents this behaviour.
+// If you are sure that your machine does not pops bits back in, you can speed
+// up the code insignificantly by taking out the masking.
+
+// read data from a file
+void* mar345_read_data(FILE *file, int ocount, int dim1, int dim2);
+// read data from a stream
+void* mar345_read_data_string(char *instring, int ocount, int dim1, int dim2);
+
+// unpack the given data
+void* ccp4_unpack(void *unpacked_array, void *packed, size_t dim1, size_t dim2, size_t max_num_int);
+// unpack the given data
+void* ccp4_unpack_v2(void *unpacked_array, void *packed, size_t dim1, size_t dim2, size_t max_num_int);
+// unpack the given data
+void* ccp4_unpack_string(void *unpacked_array, void *packed, size_t dim1, size_t dim2, size_t max_num_int);
+// unpack the given data
+void* ccp4_unpack_v2_string(void *unpacked_array, void *packed, size_t dim1, size_t dim2, size_t max_num_int);
+
+void pack_wordimage_c(short int *img, int x, int y, char *filename);
+
+#endif // CPP4_PACK_H
diff --git a/fabio/ext/include/columnfile.h b/fabio/ext/include/columnfile.h
new file mode 100644
index 0000000..6d11e4b
--- /dev/null
+++ b/fabio/ext/include/columnfile.h
@@ -0,0 +1,55 @@
+#ifndef CF_H
+#define CF_H 1
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define CF_INIT_ROWS 8192
+#define CF_INIT_COLS 32
+#define CF_HEADER_ITEM 128
+
+
+#define CF_GZ_COMP 1
+#define CF_BIN 2
+
+
+#define repeat16_inc(name,offset) \
+ *((name)+(offset)),*((name)+(offset)+1),*((name)+(offset)+2),*((name)+(offset)+3),*((name)+(offset)+4), \
+ *((name)+(offset)+5),*((name)+(offset)+6),*((name)+(offset)+7),*((name)+(offset)+8),*((name)+(offset)+9), \
+ *((name)+(offset)+10),*((name)+(offset)+11),*((name)+(offset)+12),*((name)+(offset)+13),*((name)+(offset)+14),*((name)+(offset)+15)
+
+#define cf_check_realloc(p,i,chunk_size,item_size) \
+ do {\
+ if((i)%(chunk_size)==0){\
+ } while (0);
+
+#define cf_sscan_column(source,conversion,dest,prefix) \
+ do {\
+ int tmpi=0;\
+ if ((prefix)!=NULL) sscanf(source,prefix);\
+ while (sscanf( (source) , (conversion) , ((dest) +tmpi))){\
+ tmpi++;\
+ }\
+ } while (0);
+
+#define is_ws(character) \
+ ( (character==' ') || ((character)=='\t') || ((character)=='\v') || ((character) =='\r') || ((character) =='\n') )
+
+typedef struct cf_data{
+ int ncols,nrows;
+ unsigned int nralloc;
+ double **data;
+ char **clabels;
+} cf_data;
+
+void * cf_read_ascii(void *fp, void *dest, unsigned int FLAGS);
+void * cf_read_bin(void *fp, void *dest, unsigned int FLAGS);
+int cf_write(char *fname, void *cf_handle, unsigned int FLAGS);
+int cf_write_bin(void *fp, void *cf_handle);
+int cf_write_ascii(void *fp, void *cf_handle,unsigned int FLAGS);
+void cf_free( cf_data *cf_handle);
+
+
+
+#endif
diff --git a/fabio/ext/include/msvc/stdint.h b/fabio/ext/include/msvc/stdint.h
new file mode 100644
index 0000000..c55d95d
--- /dev/null
+++ b/fabio/ext/include/msvc/stdint.h
@@ -0,0 +1,247 @@
+// ISO C9x compliant stdint.h for Microsoft Visual Studio
+// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
+//
+// Copyright (c) 2006-2008 Alexander Chemeris
+//
+// 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.
+//
+// 3. The name of the author may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// 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.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _MSC_VER // [
+#error "Use this header only with Microsoft Visual C++ compilers!"
+#endif // _MSC_VER ]
+
+#ifndef _MSC_STDINT_H_ // [
+#define _MSC_STDINT_H_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif
+
+#include <limits.h>
+
+// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
+// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
+// or compiler give many errors like this:
+// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
+#ifdef __cplusplus
+extern "C" {
+#endif
+# include <wchar.h>
+#ifdef __cplusplus
+}
+#endif
+
+// Define _W64 macros to mark types changing their size, like intptr_t.
+#ifndef _W64
+# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
+# define _W64 __w64
+# else
+# define _W64
+# endif
+#endif
+
+
+// 7.18.1 Integer types
+
+// 7.18.1.1 Exact-width integer types
+
+// Visual Studio 6 and Embedded Visual C++ 4 doesn't
+// realize that, e.g. char has the same size as __int8
+// so we give up on __intX for them.
+#if (_MSC_VER < 1300)
+ typedef char int8_t;
+ typedef short int16_t;
+ typedef int int32_t;
+ typedef unsigned char uint8_t;
+ typedef unsigned short uint16_t;
+ typedef unsigned int uint32_t;
+#else
+ typedef __int8 int8_t;
+ typedef __int16 int16_t;
+ typedef __int32 int32_t;
+ typedef unsigned __int8 uint8_t;
+ typedef unsigned __int16 uint16_t;
+ typedef unsigned __int32 uint32_t;
+#endif
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+
+
+// 7.18.1.2 Minimum-width integer types
+typedef int8_t int_least8_t;
+typedef int16_t int_least16_t;
+typedef int32_t int_least32_t;
+typedef int64_t int_least64_t;
+typedef uint8_t uint_least8_t;
+typedef uint16_t uint_least16_t;
+typedef uint32_t uint_least32_t;
+typedef uint64_t uint_least64_t;
+
+// 7.18.1.3 Fastest minimum-width integer types
+typedef int8_t int_fast8_t;
+typedef int16_t int_fast16_t;
+typedef int32_t int_fast32_t;
+typedef int64_t int_fast64_t;
+typedef uint8_t uint_fast8_t;
+typedef uint16_t uint_fast16_t;
+typedef uint32_t uint_fast32_t;
+typedef uint64_t uint_fast64_t;
+
+// 7.18.1.4 Integer types capable of holding object pointers
+#ifdef _WIN64 // [
+ typedef __int64 intptr_t;
+ typedef unsigned __int64 uintptr_t;
+#else // _WIN64 ][
+ typedef _W64 int intptr_t;
+ typedef _W64 unsigned int uintptr_t;
+#endif // _WIN64 ]
+
+// 7.18.1.5 Greatest-width integer types
+typedef int64_t intmax_t;
+typedef uint64_t uintmax_t;
+
+
+// 7.18.2 Limits of specified-width integer types
+
+#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
+
+// 7.18.2.1 Limits of exact-width integer types
+#define INT8_MIN ((int8_t)_I8_MIN)
+#define INT8_MAX _I8_MAX
+#define INT16_MIN ((int16_t)_I16_MIN)
+#define INT16_MAX _I16_MAX
+#define INT32_MIN ((int32_t)_I32_MIN)
+#define INT32_MAX _I32_MAX
+#define INT64_MIN ((int64_t)_I64_MIN)
+#define INT64_MAX _I64_MAX
+#define UINT8_MAX _UI8_MAX
+#define UINT16_MAX _UI16_MAX
+#define UINT32_MAX _UI32_MAX
+#define UINT64_MAX _UI64_MAX
+
+// 7.18.2.2 Limits of minimum-width integer types
+#define INT_LEAST8_MIN INT8_MIN
+#define INT_LEAST8_MAX INT8_MAX
+#define INT_LEAST16_MIN INT16_MIN
+#define INT_LEAST16_MAX INT16_MAX
+#define INT_LEAST32_MIN INT32_MIN
+#define INT_LEAST32_MAX INT32_MAX
+#define INT_LEAST64_MIN INT64_MIN
+#define INT_LEAST64_MAX INT64_MAX
+#define UINT_LEAST8_MAX UINT8_MAX
+#define UINT_LEAST16_MAX UINT16_MAX
+#define UINT_LEAST32_MAX UINT32_MAX
+#define UINT_LEAST64_MAX UINT64_MAX
+
+// 7.18.2.3 Limits of fastest minimum-width integer types
+#define INT_FAST8_MIN INT8_MIN
+#define INT_FAST8_MAX INT8_MAX
+#define INT_FAST16_MIN INT16_MIN
+#define INT_FAST16_MAX INT16_MAX
+#define INT_FAST32_MIN INT32_MIN
+#define INT_FAST32_MAX INT32_MAX
+#define INT_FAST64_MIN INT64_MIN
+#define INT_FAST64_MAX INT64_MAX
+#define UINT_FAST8_MAX UINT8_MAX
+#define UINT_FAST16_MAX UINT16_MAX
+#define UINT_FAST32_MAX UINT32_MAX
+#define UINT_FAST64_MAX UINT64_MAX
+
+// 7.18.2.4 Limits of integer types capable of holding object pointers
+#ifdef _WIN64 // [
+# define INTPTR_MIN INT64_MIN
+# define INTPTR_MAX INT64_MAX
+# define UINTPTR_MAX UINT64_MAX
+#else // _WIN64 ][
+# define INTPTR_MIN INT32_MIN
+# define INTPTR_MAX INT32_MAX
+# define UINTPTR_MAX UINT32_MAX
+#endif // _WIN64 ]
+
+// 7.18.2.5 Limits of greatest-width integer types
+#define INTMAX_MIN INT64_MIN
+#define INTMAX_MAX INT64_MAX
+#define UINTMAX_MAX UINT64_MAX
+
+// 7.18.3 Limits of other integer types
+
+#ifdef _WIN64 // [
+# define PTRDIFF_MIN _I64_MIN
+# define PTRDIFF_MAX _I64_MAX
+#else // _WIN64 ][
+# define PTRDIFF_MIN _I32_MIN
+# define PTRDIFF_MAX _I32_MAX
+#endif // _WIN64 ]
+
+#define SIG_ATOMIC_MIN INT_MIN
+#define SIG_ATOMIC_MAX INT_MAX
+
+#ifndef SIZE_MAX // [
+# ifdef _WIN64 // [
+# define SIZE_MAX _UI64_MAX
+# else // _WIN64 ][
+# define SIZE_MAX _UI32_MAX
+# endif // _WIN64 ]
+#endif // SIZE_MAX ]
+
+// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
+#ifndef WCHAR_MIN // [
+# define WCHAR_MIN 0
+#endif // WCHAR_MIN ]
+#ifndef WCHAR_MAX // [
+# define WCHAR_MAX _UI16_MAX
+#endif // WCHAR_MAX ]
+
+#define WINT_MIN 0
+#define WINT_MAX _UI16_MAX
+
+#endif // __STDC_LIMIT_MACROS ]
+
+
+// 7.18.4 Limits of other integer types
+
+#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
+
+// 7.18.4.1 Macros for minimum-width integer constants
+
+#define INT8_C(val) val##i8
+#define INT16_C(val) val##i16
+#define INT32_C(val) val##i32
+#define INT64_C(val) val##i64
+
+#define UINT8_C(val) val##ui8
+#define UINT16_C(val) val##ui16
+#define UINT32_C(val) val##ui32
+#define UINT64_C(val) val##ui64
+
+// 7.18.4.2 Macros for greatest-width integer constants
+#define INTMAX_C INT64_C
+#define UINTMAX_C UINT64_C
+
+#endif // __STDC_CONSTANT_MACROS ]
+
+
+#endif // _MSC_STDINT_H_ ]
diff --git a/fabio/ext/mar345_IO.c b/fabio/ext/mar345_IO.c
new file mode 100644
index 0000000..4823b51
--- /dev/null
+++ b/fabio/ext/mar345_IO.c
@@ -0,0 +1,31475 @@
+/* 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 < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+ #error Cython requires Python 2.6+ or Python 3.2+.
+#else
+#define CYTHON_ABI "0_21_1"
+#include <stddef.h>
+#ifndef offsetof
+#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+#define CYTHON_COMPILING_IN_PYPY 1
+#define CYTHON_COMPILING_IN_CPYTHON 0
+#else
+#define CYTHON_COMPILING_IN_PYPY 0
+#define CYTHON_COMPILING_IN_CPYTHON 1
+#endif
+#if 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+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define Py_TPFLAGS_CHECKTYPES 0
+ #define Py_TPFLAGS_HAVE_INDEX 0
+ #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_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
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t PyInt_AsLong
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#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_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
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+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
+
+
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+#define _USE_MATH_DEFINES
+#endif
+#include <math.h>
+#define __PYX_HAVE__fabio__ext__mar345_IO
+#define __PYX_HAVE_API__fabio__ext__mar345_IO
+#include "string.h"
+#include "stdio.h"
+#include "stdlib.h"
+#include "numpy/arrayobject.h"
+#include "numpy/ufuncobject.h"
+#include "ccp4_pack.h"
+#include "pythread.h"
+#include "pystate.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#ifdef PYREX_WITHOUT_ASSERTIONS
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+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);
+#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
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+#if !defined(CYTHON_CCOMPLEX)
+ #if defined(__cplusplus)
+ #define CYTHON_CCOMPLEX 1
+ #elif defined(_Complex_I)
+ #define CYTHON_CCOMPLEX 1
+ #else
+ #define CYTHON_CCOMPLEX 0
+ #endif
+#endif
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ #include <complex>
+ #else
+ #include <complex.h>
+ #endif
+#endif
+#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
+ #undef _Complex_I
+ #define _Complex_I 1.0fj
+#endif
+
+
+static const char *__pyx_f[] = {
+ "fabio/ext/mar345_IO.pyx",
+ "__init__.pxd",
+ "stringsource",
+ "type.pxd",
+};
+struct __pyx_memoryview_obj;
+typedef struct {
+ struct __pyx_memoryview_obj *memview;
+ char *data;
+ Py_ssize_t shape[8];
+ Py_ssize_t strides[8];
+ Py_ssize_t suboffsets[8];
+} __Pyx_memviewslice;
+
+#define IS_UNSIGNED(type) (((type) -1) > 0)
+struct __Pyx_StructField_;
+#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
+typedef struct {
+ const char* name;
+ struct __Pyx_StructField_* fields;
+ size_t size;
+ size_t arraysize[8];
+ int ndim;
+ char typegroup;
+ char is_unsigned;
+ int flags;
+} __Pyx_TypeInfo;
+typedef struct __Pyx_StructField_ {
+ __Pyx_TypeInfo* type;
+ const char* name;
+ size_t offset;
+} __Pyx_StructField;
+typedef struct {
+ __Pyx_StructField* field;
+ size_t parent_offset;
+} __Pyx_BufFmt_StackElem;
+typedef struct {
+ __Pyx_StructField root;
+ __Pyx_BufFmt_StackElem* head;
+ size_t fmt_offset;
+ size_t new_count, enc_count;
+ size_t struct_alignment;
+ int is_complex;
+ char enc_type;
+ char new_packmode;
+ char enc_packmode;
+ char is_valid_array;
+} __Pyx_BufFmt_Context;
+
+#include <pythread.h>
+#ifndef CYTHON_ATOMICS
+ #define CYTHON_ATOMICS 1
+#endif
+#define __pyx_atomic_int_type int
+#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 || \
+ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) && \
+ !defined(__i386__)
+ #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
+ #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Using GNU atomics"
+ #endif
+#elif CYTHON_ATOMICS && MSC_VER
+ #include <Windows.h>
+ #define __pyx_atomic_int_type LONG
+ #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
+ #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Using MSVC atomics"
+ #endif
+#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
+ #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
+ #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Using Intel atomics"
+ #endif
+#else
+ #undef CYTHON_ATOMICS
+ #define CYTHON_ATOMICS 0
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Not using atomics"
+ #endif
+#endif
+typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
+#if CYTHON_ATOMICS
+ #define __pyx_add_acquisition_count(memview) \
+ __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
+ #define __pyx_sub_acquisition_count(memview) \
+ __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
+#else
+ #define __pyx_add_acquisition_count(memview) \
+ __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
+ #define __pyx_sub_acquisition_count(memview) \
+ __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
+#endif
+
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":723
+ * # in Cython to enable them only on the right systems.
+ *
+ * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t
+ */
+typedef npy_int8 __pyx_t_5numpy_int8_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724
+ *
+ * ctypedef npy_int8 int8_t
+ * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int32 int32_t
+ * ctypedef npy_int64 int64_t
+ */
+typedef npy_int16 __pyx_t_5numpy_int16_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
+ * ctypedef npy_int8 int8_t
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int64 int64_t
+ * #ctypedef npy_int96 int96_t
+ */
+typedef npy_int32 __pyx_t_5numpy_int32_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t
+ * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_int96 int96_t
+ * #ctypedef npy_int128 int128_t
+ */
+typedef npy_int64 __pyx_t_5numpy_int64_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730
+ * #ctypedef npy_int128 int128_t
+ *
+ * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t
+ */
+typedef npy_uint8 __pyx_t_5numpy_uint8_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731
+ *
+ * ctypedef npy_uint8 uint8_t
+ * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint32 uint32_t
+ * ctypedef npy_uint64 uint64_t
+ */
+typedef npy_uint16 __pyx_t_5numpy_uint16_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
+ * ctypedef npy_uint8 uint8_t
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint64 uint64_t
+ * #ctypedef npy_uint96 uint96_t
+ */
+typedef npy_uint32 __pyx_t_5numpy_uint32_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t
+ * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_uint96 uint96_t
+ * #ctypedef npy_uint128 uint128_t
+ */
+typedef npy_uint64 __pyx_t_5numpy_uint64_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737
+ * #ctypedef npy_uint128 uint128_t
+ *
+ * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_float64 float64_t
+ * #ctypedef npy_float80 float80_t
+ */
+typedef npy_float32 __pyx_t_5numpy_float32_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738
+ *
+ * ctypedef npy_float32 float32_t
+ * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_float80 float80_t
+ * #ctypedef npy_float128 float128_t
+ */
+typedef npy_float64 __pyx_t_5numpy_float64_t;
+
+/* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * ctypedef npy_longlong long_t
+ * ctypedef npy_longlong longlong_t
+ */
+typedef npy_long __pyx_t_5numpy_int_t;
+
+/* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * ctypedef npy_longlong longlong_t
+ *
+ */
+typedef npy_longlong __pyx_t_5numpy_long_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
+ * ctypedef npy_long int_t
+ * ctypedef npy_longlong long_t
+ * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_ulong uint_t
+ */
+typedef npy_longlong __pyx_t_5numpy_longlong_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
+ * ctypedef npy_longlong longlong_t
+ *
+ * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
+ * ctypedef npy_ulonglong ulong_t
+ * ctypedef npy_ulonglong ulonglong_t
+ */
+typedef npy_ulong __pyx_t_5numpy_uint_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752
+ *
+ * ctypedef npy_ulong uint_t
+ * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
+ * ctypedef npy_ulonglong ulonglong_t
+ *
+ */
+typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
+ * ctypedef npy_ulong uint_t
+ * ctypedef npy_ulonglong ulong_t
+ * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_intp intp_t
+ */
+typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
+ * ctypedef npy_ulonglong ulonglong_t
+ *
+ * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uintp uintp_t
+ *
+ */
+typedef npy_intp __pyx_t_5numpy_intp_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756
+ *
+ * ctypedef npy_intp intp_t
+ * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_double float_t
+ */
+typedef npy_uintp __pyx_t_5numpy_uintp_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
+ * ctypedef npy_uintp uintp_t
+ *
+ * ctypedef npy_double float_t # <<<<<<<<<<<<<<
+ * ctypedef npy_double double_t
+ * ctypedef npy_longdouble longdouble_t
+ */
+typedef npy_double __pyx_t_5numpy_float_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759
+ *
+ * ctypedef npy_double float_t
+ * ctypedef npy_double double_t # <<<<<<<<<<<<<<
+ * ctypedef npy_longdouble longdouble_t
+ *
+ */
+typedef npy_double __pyx_t_5numpy_double_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
+ * ctypedef npy_double float_t
+ * ctypedef npy_double double_t
+ * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_cfloat cfloat_t
+ */
+typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ typedef ::std::complex< float > __pyx_t_float_complex;
+ #else
+ typedef float _Complex __pyx_t_float_complex;
+ #endif
+#else
+ typedef struct { float real, imag; } __pyx_t_float_complex;
+#endif
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ typedef ::std::complex< double > __pyx_t_double_complex;
+ #else
+ typedef double _Complex __pyx_t_double_complex;
+ #endif
+#else
+ typedef struct { double real, imag; } __pyx_t_double_complex;
+#endif
+
+
+/*--- Type declarations ---*/
+struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer;
+struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer;
+struct __pyx_array_obj;
+struct __pyx_MemviewEnum_obj;
+struct __pyx_memoryview_obj;
+struct __pyx_memoryviewslice_obj;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762
+ * ctypedef npy_longdouble longdouble_t
+ *
+ * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
+ * ctypedef npy_cdouble cdouble_t
+ * ctypedef npy_clongdouble clongdouble_t
+ */
+typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763
+ *
+ * ctypedef npy_cfloat cfloat_t
+ * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
+ * ctypedef npy_clongdouble clongdouble_t
+ *
+ */
+typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
+ * ctypedef npy_cfloat cfloat_t
+ * ctypedef npy_cdouble cdouble_t
+ * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_cdouble complex_t
+ */
+typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
+ * ctypedef npy_clongdouble clongdouble_t
+ *
+ * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew1(a):
+ */
+typedef npy_cdouble __pyx_t_5numpy_complex_t;
+
+/* "fabio/ext/mar345_IO.pyx":451
+ *
+ *
+ * cdef class PackContainer: # <<<<<<<<<<<<<<
+ * cdef:
+ * readonly cnp.uint32_t position, offset, allocated
+ */
+struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_5fabio_3ext_9mar345_IO_PackContainer *__pyx_vtab;
+ __pyx_t_5numpy_uint32_t position;
+ __pyx_t_5numpy_uint32_t offset;
+ __pyx_t_5numpy_uint32_t allocated;
+ __Pyx_memviewslice data;
+};
+
+
+/* "fabio/ext/mar345_IO.pyx":641
+ *
+ *
+ * cdef class UnpackContainer: # <<<<<<<<<<<<<<
+ * cdef:
+ * readonly cnp.uint32_t nrow, ncol, position, size
+ */
+struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_vtab;
+ __pyx_t_5numpy_uint32_t nrow;
+ __pyx_t_5numpy_uint32_t ncol;
+ __pyx_t_5numpy_uint32_t position;
+ __pyx_t_5numpy_uint32_t size;
+ __Pyx_memviewslice data;
+};
+
+
+/* "View.MemoryView":99
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+struct __pyx_array_obj {
+ PyObject_HEAD
+ char *data;
+ Py_ssize_t len;
+ char *format;
+ int ndim;
+ Py_ssize_t *_shape;
+ Py_ssize_t *_strides;
+ Py_ssize_t itemsize;
+ PyObject *mode;
+ PyObject *_format;
+ void (*callback_free_data)(void *);
+ int free_data;
+ int dtype_is_object;
+};
+
+
+/* "View.MemoryView":269
+ *
+ * @cname('__pyx_MemviewEnum')
+ * cdef class Enum(object): # <<<<<<<<<<<<<<
+ * cdef object name
+ * def __init__(self, name):
+ */
+struct __pyx_MemviewEnum_obj {
+ PyObject_HEAD
+ PyObject *name;
+};
+
+
+/* "View.MemoryView":302
+ *
+ * @cname('__pyx_memoryview')
+ * cdef class memoryview(object): # <<<<<<<<<<<<<<
+ *
+ * cdef object obj
+ */
+struct __pyx_memoryview_obj {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_memoryview *__pyx_vtab;
+ PyObject *obj;
+ PyObject *_size;
+ PyObject *_array_interface;
+ PyThread_type_lock lock;
+ __pyx_atomic_int acquisition_count[2];
+ __pyx_atomic_int *acquisition_count_aligned_p;
+ Py_buffer view;
+ int flags;
+ int dtype_is_object;
+ __Pyx_TypeInfo *typeinfo;
+};
+
+
+/* "View.MemoryView":922
+ *
+ * @cname('__pyx_memoryviewslice')
+ * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
+ * "Internal class for passing memoryview slices to Python"
+ *
+ */
+struct __pyx_memoryviewslice_obj {
+ struct __pyx_memoryview_obj __pyx_base;
+ __Pyx_memviewslice from_slice;
+ PyObject *from_object;
+ PyObject *(*to_object_func)(char *);
+ int (*to_dtype_func)(char *, PyObject *);
+};
+
+
+
+/* "fabio/ext/mar345_IO.pyx":451
+ *
+ *
+ * cdef class PackContainer: # <<<<<<<<<<<<<<
+ * cdef:
+ * readonly cnp.uint32_t position, offset, allocated
+ */
+
+struct __pyx_vtabstruct_5fabio_3ext_9mar345_IO_PackContainer {
+ PyObject *(*append)(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *, __Pyx_memviewslice, __pyx_t_5numpy_uint32_t, __pyx_t_5numpy_uint32_t, __pyx_t_5numpy_uint32_t, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_5fabio_3ext_9mar345_IO_PackContainer *__pyx_vtabptr_5fabio_3ext_9mar345_IO_PackContainer;
+
+
+/* "fabio/ext/mar345_IO.pyx":641
+ *
+ *
+ * cdef class UnpackContainer: # <<<<<<<<<<<<<<
+ * cdef:
+ * readonly cnp.uint32_t nrow, ncol, position, size
+ */
+
+struct __pyx_vtabstruct_5fabio_3ext_9mar345_IO_UnpackContainer {
+ __Pyx_memviewslice (*get1d)(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *, int __pyx_skip_dispatch);
+ PyObject *(*set_zero)(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *, int, int __pyx_skip_dispatch);
+ PyObject *(*unpack)(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *, __Pyx_memviewslice, __pyx_t_5numpy_uint32_t, __pyx_t_5numpy_uint32_t, __pyx_t_5numpy_uint32_t, __pyx_t_5numpy_uint32_t, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_vtabptr_5fabio_3ext_9mar345_IO_UnpackContainer;
+
+
+/* "View.MemoryView":302
+ *
+ * @cname('__pyx_memoryview')
+ * cdef class memoryview(object): # <<<<<<<<<<<<<<
+ *
+ * cdef object obj
+ */
+
+struct __pyx_vtabstruct_memoryview {
+ char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
+ PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
+ PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
+ PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
+};
+static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
+
+
+/* "View.MemoryView":922
+ *
+ * @cname('__pyx_memoryviewslice')
+ * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
+ * "Internal class for passing memoryview slices to Python"
+ *
+ */
+
+struct __pyx_vtabstruct__memoryviewslice {
+ struct __pyx_vtabstruct_memoryview __pyx_base;
+};
+static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ if (acquire_gil) { \
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ PyGILState_Release(__pyx_gilstate_save); \
+ } else { \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext() \
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_XDECREF(tmp); \
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_DECREF(tmp); \
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+ const char* function_name);
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+#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 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
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
+#else
+#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
+#endif
+
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+
+static CYTHON_INLINE int __Pyx_IterFinish(void);
+
+static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
+
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
+static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
+ PyObject *res;
+ PyTypeObject *tp = Py_TYPE(obj);
+#if PY_MAJOR_VERSION < 3
+ if (unlikely(PyInstance_Check(obj)))
+ return __Pyx_PyObject_GetAttrStr(obj, attr_name);
+#endif
+ res = _PyType_Lookup(tp, attr_name);
+ if (likely(res)) {
+ descrgetfunc f = Py_TYPE(res)->tp_descr_get;
+ if (!f) {
+ Py_INCREF(res);
+ } else {
+ res = f(res, obj, (PyObject *)tp);
+ }
+ } else {
+ PyErr_SetObject(PyExc_AttributeError, attr_name);
+ }
+ return res;
+}
+#else
+#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
+#endif
+
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
+static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
+
+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_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
+#define __Pyx_MEMVIEW_DIRECT 1
+#define __Pyx_MEMVIEW_PTR 2
+#define __Pyx_MEMVIEW_FULL 4
+#define __Pyx_MEMVIEW_CONTIG 8
+#define __Pyx_MEMVIEW_STRIDED 16
+#define __Pyx_MEMVIEW_FOLLOW 32
+#define __Pyx_IS_C_CONTIG 1
+#define __Pyx_IS_F_CONTIG 2
+static int __Pyx_init_memviewslice(
+ struct __pyx_memoryview_obj *memview,
+ int ndim,
+ __Pyx_memviewslice *memviewslice,
+ int memview_is_new_reference);
+static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
+ __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
+static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
+ __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
+#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
+#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
+#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
+#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
+static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
+static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+
+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 CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
+
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+ const char *name, int exact);
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+
+static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) {
+ int result = PyDict_Contains(dict, item);
+ return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
+}
+
+#if PY_MAJOR_VERSION >= 3
+static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
+ PyObject *value;
+ value = PyDict_GetItemWithError(d, key);
+ if (unlikely(!value)) {
+ if (!PyErr_Occurred()) {
+ PyObject* args = PyTuple_Pack(1, key);
+ if (likely(args))
+ PyErr_SetObject(PyExc_KeyError, args);
+ Py_XDECREF(args);
+ }
+ return NULL;
+ }
+ Py_INCREF(value);
+ return value;
+}
+#else
+ #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
+#endif
+
+#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 PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
+
+static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+
+static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
+
+static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
+ int is_tuple, int has_known_size, int decref_tuple);
+
+static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
+ Py_ssize_t* p_orig_length, int* p_is_dict);
+static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
+ PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
+ PyListObject* L = (PyListObject*) list;
+ Py_ssize_t len = Py_SIZE(list);
+ if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
+ Py_INCREF(x);
+ PyList_SET_ITEM(list, len, x);
+ Py_SIZE(list) = len+1;
+ return 0;
+ }
+ return PyList_Append(list, x);
+}
+#else
+#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
+#endif
+
+static void __Pyx_WriteUnraisable(const char *name, int clineno,
+ int lineno, const char *filename,
+ int full_traceback);
+
+#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound) \
+ __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
+static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
+ PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
+ PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
+ int has_cstart, int has_cstop, int wraparound);
+
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
+
+#include <string.h>
+
+static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
+
+static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
+#else
+#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
+#endif
+
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */
+
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
+
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+
+static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+ const char* cstring, Py_ssize_t start, Py_ssize_t stop,
+ const char* encoding, const char* errors,
+ PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
+
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+
+static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
+ PyListObject* L = (PyListObject*) list;
+ Py_ssize_t len = Py_SIZE(list);
+ if (likely(L->allocated > len)) {
+ Py_INCREF(x);
+ PyList_SET_ITEM(list, len, x);
+ Py_SIZE(list) = len+1;
+ return 0;
+ }
+ return PyList_Append(list, x);
+}
+#else
+#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
+#endif
+
+static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/
+static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject* none = _PyList_Extend((PyListObject*)L, v);
+ if (unlikely(!none))
+ return -1;
+ Py_DECREF(none);
+ return 0;
+#else
+ return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
+#endif
+}
+
+static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
+
+static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
+static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+
+static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
+
+#define __Pyx_CyFunction_USED 1
+#include <structmember.h>
+#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
+#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
+#define __Pyx_CYFUNCTION_CCLASS 0x04
+#define __Pyx_CyFunction_GetClosure(f) \
+ (((__pyx_CyFunctionObject *) (f))->func_closure)
+#define __Pyx_CyFunction_GetClassObj(f) \
+ (((__pyx_CyFunctionObject *) (f))->func_classobj)
+#define __Pyx_CyFunction_Defaults(type, f) \
+ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
+#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \
+ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
+typedef struct {
+ PyCFunctionObject func;
+#if PY_VERSION_HEX < 0x030500A0
+ PyObject *func_weakreflist;
+#endif
+ PyObject *func_dict;
+ PyObject *func_name;
+ PyObject *func_qualname;
+ PyObject *func_doc;
+ PyObject *func_globals;
+ PyObject *func_code;
+ PyObject *func_closure;
+ PyObject *func_classobj;
+ void *defaults;
+ int defaults_pyobjects;
+ int flags;
+ PyObject *defaults_tuple;
+ PyObject *defaults_kwdict;
+ PyObject *(*defaults_getter)(PyObject *);
+ PyObject *func_annotations;
+} __pyx_CyFunctionObject;
+static PyTypeObject *__pyx_CyFunctionType = 0;
+#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
+ __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
+static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
+ int flags, PyObject* qualname,
+ PyObject *self,
+ PyObject *module, PyObject *globals,
+ PyObject* code);
+static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
+ size_t size,
+ int pyobjects);
+static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
+ PyObject *tuple);
+static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
+ PyObject *dict);
+static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
+ PyObject *dict);
+static int __Pyx_CyFunction_init(void);
+
+typedef struct {
+ __pyx_CyFunctionObject func;
+ PyObject *__signatures__;
+ PyObject *type;
+ PyObject *self;
+} __pyx_FusedFunctionObject;
+#define __pyx_FusedFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
+ __pyx_FusedFunction_New(__pyx_FusedFunctionType, ml, flags, qualname, self, module, globals, code)
+static PyObject *__pyx_FusedFunction_New(PyTypeObject *type,
+ PyMethodDef *ml, int flags,
+ PyObject *qualname, PyObject *self,
+ PyObject *module, PyObject *globals,
+ PyObject *code);
+static int __pyx_FusedFunction_clear(__pyx_FusedFunctionObject *self);
+static PyTypeObject *__pyx_FusedFunctionType = NULL;
+static int __pyx_FusedFunction_init(void);
+#define __Pyx_FusedFunction_USED
+
+typedef struct {
+ int code_line;
+ PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint32(npy_uint32 value);
+
+static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
+
+static int __Pyx_ValidateAndInit_memviewslice(
+ int *axes_specs,
+ int c_or_f_flag,
+ int buf_flags,
+ int ndim,
+ __Pyx_TypeInfo *dtype,
+ __Pyx_BufFmt_StackElem stack[],
+ __Pyx_memviewslice *memviewslice,
+ PyObject *original_obj);
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int8_t(PyObject *);
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int16_t(PyObject *);
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(PyObject *);
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(PyObject *);
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+typedef struct {
+ Py_ssize_t shape, strides, suboffsets;
+} __Pyx_Buf_DimInfo;
+typedef struct {
+ size_t refcount;
+ Py_buffer pybuffer;
+} __Pyx_Buffer;
+typedef struct {
+ __Pyx_Buffer *rcbuffer;
+ char *data;
+ __Pyx_Buf_DimInfo diminfo[8];
+} __Pyx_LocalBuf_ND;
+
+#if PY_MAJOR_VERSION < 3
+ static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
+ static void __Pyx_ReleaseBuffer(Py_buffer *view);
+#else
+ #define __Pyx_GetBuffer PyObject_GetBuffer
+ #define __Pyx_ReleaseBuffer PyBuffer_Release
+#endif
+
+
+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 CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *);
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(PyObject *);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
+
+static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
+
+static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int32_t(const char *itemp);
+static int __pyx_memview_set_nn___pyx_t_5numpy_int32_t(const char *itemp, PyObject *obj);
+
+static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint32_t(const char *itemp);
+static int __pyx_memview_set_nn___pyx_t_5numpy_uint32_t(const char *itemp, PyObject *obj);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int16(npy_int16 value);
+
+static CYTHON_INLINE npy_int16 __Pyx_PyInt_As_npy_int16(PyObject *);
+
+static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int16_t(const char *itemp);
+static int __pyx_memview_set_nn___pyx_t_5numpy_int16_t(const char *itemp, PyObject *obj);
+
+static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+
+static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value);
+
+static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp);
+static int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj);
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ #define __Pyx_CREAL(z) ((z).real())
+ #define __Pyx_CIMAG(z) ((z).imag())
+ #else
+ #define __Pyx_CREAL(z) (__real__(z))
+ #define __Pyx_CIMAG(z) (__imag__(z))
+ #endif
+#else
+ #define __Pyx_CREAL(z) ((z).real)
+ #define __Pyx_CIMAG(z) ((z).imag)
+#endif
+#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
+ #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
+ #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
+#endif
+
+static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
+
+#if CYTHON_CCOMPLEX
+ #define __Pyx_c_eqf(a, b) ((a)==(b))
+ #define __Pyx_c_sumf(a, b) ((a)+(b))
+ #define __Pyx_c_difff(a, b) ((a)-(b))
+ #define __Pyx_c_prodf(a, b) ((a)*(b))
+ #define __Pyx_c_quotf(a, b) ((a)/(b))
+ #define __Pyx_c_negf(a) (-(a))
+ #ifdef __cplusplus
+ #define __Pyx_c_is_zerof(z) ((z)==(float)0)
+ #define __Pyx_c_conjf(z) (::std::conj(z))
+ #if 1
+ #define __Pyx_c_absf(z) (::std::abs(z))
+ #define __Pyx_c_powf(a, b) (::std::pow(a, b))
+ #endif
+ #else
+ #define __Pyx_c_is_zerof(z) ((z)==0)
+ #define __Pyx_c_conjf(z) (conjf(z))
+ #if 1
+ #define __Pyx_c_absf(z) (cabsf(z))
+ #define __Pyx_c_powf(a, b) (cpowf(a, b))
+ #endif
+ #endif
+#else
+ static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
+ #if 1
+ static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
+ #endif
+#endif
+
+static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
+
+#if CYTHON_CCOMPLEX
+ #define __Pyx_c_eq(a, b) ((a)==(b))
+ #define __Pyx_c_sum(a, b) ((a)+(b))
+ #define __Pyx_c_diff(a, b) ((a)-(b))
+ #define __Pyx_c_prod(a, b) ((a)*(b))
+ #define __Pyx_c_quot(a, b) ((a)/(b))
+ #define __Pyx_c_neg(a) (-(a))
+ #ifdef __cplusplus
+ #define __Pyx_c_is_zero(z) ((z)==(double)0)
+ #define __Pyx_c_conj(z) (::std::conj(z))
+ #if 1
+ #define __Pyx_c_abs(z) (::std::abs(z))
+ #define __Pyx_c_pow(a, b) (::std::pow(a, b))
+ #endif
+ #else
+ #define __Pyx_c_is_zero(z) ((z)==0)
+ #define __Pyx_c_conj(z) (conj(z))
+ #if 1
+ #define __Pyx_c_abs(z) (cabs(z))
+ #define __Pyx_c_pow(a, b) (cpow(a, b))
+ #endif
+ #endif
+#else
+ static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
+ #if 1
+ static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
+ #endif
+#endif
+
+static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
+ char order, int ndim);
+
+static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize);
+
+static __Pyx_memviewslice
+__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
+ const char *mode, int ndim,
+ size_t sizeof_dtype, int contig_flag,
+ int dtype_is_object);
+
+static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_uint32_t(PyObject *);
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int32_t(PyObject *);
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint32_t(PyObject *);
+
+static int __Pyx_check_binary_version(void);
+
+#if !defined(__Pyx_PyIdentifier_FromString)
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
+#else
+ #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
+#endif
+#endif
+
+static PyObject *__Pyx_ImportModule(const char *name);
+
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+static PyObject *__pyx_f_5fabio_3ext_9mar345_IO_13PackContainer_append(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *__pyx_v_self, __Pyx_memviewslice __pyx_v_data, __pyx_t_5numpy_uint32_t __pyx_v_position, __pyx_t_5numpy_uint32_t __pyx_v_nb_val, __pyx_t_5numpy_uint32_t __pyx_v_block_size, int __pyx_skip_dispatch); /* proto*/
+static __Pyx_memviewslice __pyx_f_5fabio_3ext_9mar345_IO_15UnpackContainer_get1d(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
+static PyObject *__pyx_f_5fabio_3ext_9mar345_IO_15UnpackContainer_set_zero(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self, int __pyx_v_number, int __pyx_skip_dispatch); /* proto*/
+static PyObject *__pyx_f_5fabio_3ext_9mar345_IO_15UnpackContainer_unpack(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self, __Pyx_memviewslice __pyx_v_stream, __pyx_t_5numpy_uint32_t __pyx_v_pos, __pyx_t_5numpy_uint32_t __pyx_v_offset, __pyx_t_5numpy_uint32_t __pyx_v_nb_value, __pyx_t_5numpy_uint32_t __pyx_v_value_size, int __pyx_skip_dispatch); /* proto*/
+static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
+static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
+static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
+static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
+static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
+static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
+static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
+static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
+static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
+
+/* Module declarations from 'cython.view' */
+
+/* Module declarations from 'cython' */
+
+/* Module declarations from 'cpython.buffer' */
+
+/* Module declarations from 'cpython.ref' */
+
+/* Module declarations from 'libc.string' */
+
+/* Module declarations from 'libc.stdio' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.type' */
+static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
+
+/* Module declarations from 'libc.stdlib' */
+
+/* Module declarations from 'numpy' */
+
+/* Module declarations from 'numpy' */
+static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
+static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
+static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
+static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
+static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
+static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
+
+/* Module declarations from 'fabio.ext.mar345_IO' */
+static PyTypeObject *__pyx_ptype_5fabio_3ext_9mar345_IO_PackContainer = 0;
+static PyTypeObject *__pyx_ptype_5fabio_3ext_9mar345_IO_UnpackContainer = 0;
+static PyTypeObject *__pyx_array_type = 0;
+static PyTypeObject *__pyx_MemviewEnum_type = 0;
+static PyTypeObject *__pyx_memoryview_type = 0;
+static PyTypeObject *__pyx_memoryviewslice_type = 0;
+static __pyx_t_5numpy_uint8_t *__pyx_v_5fabio_3ext_9mar345_IO_CCP4_PCK_BIT_COUNT;
+static __pyx_t_5numpy_uint8_t *__pyx_v_5fabio_3ext_9mar345_IO_CCP4_BITSIZE;
+static int __pyx_v_5fabio_3ext_9mar345_IO_CCP4_PCK_BLOCK_HEADER_LENGTH;
+static int __pyx_v_5fabio_3ext_9mar345_IO_PACK_SIZE_HIGH;
+static PyObject *generic = 0;
+static PyObject *strided = 0;
+static PyObject *indirect = 0;
+static PyObject *contiguous = 0;
+static PyObject *indirect_contiguous = 0;
+static CYTHON_INLINE __Pyx_memviewslice __pyx_f_5fabio_3ext_9mar345_IO_precomp(__Pyx_memviewslice, __pyx_t_5numpy_uint32_t, int __pyx_skip_dispatch); /*proto*/
+static CYTHON_INLINE __Pyx_memviewslice __pyx_f_5fabio_3ext_9mar345_IO_postdec(__Pyx_memviewslice, int, int __pyx_skip_dispatch); /*proto*/
+static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_5fabio_3ext_9mar345_IO_pack_nb_val(__pyx_t_5numpy_uint8_t, __pyx_t_5numpy_uint8_t, int __pyx_skip_dispatch); /*proto*/
+static struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_f_5fabio_3ext_9mar345_IO_unpack_pck(__Pyx_memviewslice, int, int, int __pyx_skip_dispatch); /*proto*/
+static CYTHON_INLINE int __pyx_fuse_0__pyx_f_5fabio_3ext_9mar345_IO_calc_nb_bits(__Pyx_memviewslice, unsigned int, unsigned int, int __pyx_skip_dispatch); /*proto*/
+static CYTHON_INLINE int __pyx_fuse_1__pyx_f_5fabio_3ext_9mar345_IO_calc_nb_bits(__Pyx_memviewslice, unsigned int, unsigned int, int __pyx_skip_dispatch); /*proto*/
+static CYTHON_INLINE int __pyx_fuse_2__pyx_f_5fabio_3ext_9mar345_IO_calc_nb_bits(__Pyx_memviewslice, unsigned int, unsigned int, int __pyx_skip_dispatch); /*proto*/
+static CYTHON_INLINE int __pyx_fuse_3__pyx_f_5fabio_3ext_9mar345_IO_calc_nb_bits(__Pyx_memviewslice, unsigned int, unsigned int, int __pyx_skip_dispatch); /*proto*/
+static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
+static void *__pyx_align_pointer(void *, size_t); /*proto*/
+static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
+static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
+static PyObject *_unellipsify(PyObject *, int); /*proto*/
+static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
+static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
+static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
+static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
+static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
+static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
+static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
+static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
+static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
+static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
+static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
+static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
+static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
+static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
+static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
+static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
+static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
+static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
+static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
+static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
+static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
+static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
+static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
+static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t = { "int8_t", NULL, sizeof(__pyx_t_5numpy_int8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int8_t), 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t = { "int16_t", NULL, sizeof(__pyx_t_5numpy_int16_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int16_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int16_t), 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint32_t = { "uint32_t", NULL, sizeof(__pyx_t_5numpy_uint32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint32_t), 0 };
+#define __Pyx_MODULE_NAME "fabio.ext.mar345_IO"
+int __pyx_module_is_main_fabio__ext__mar345_IO = 0;
+
+/* Implementation of 'fabio.ext.mar345_IO' */
+static PyObject *__pyx_builtin_open;
+static PyObject *__pyx_builtin_RuntimeError;
+static PyObject *__pyx_builtin_range;
+static PyObject *__pyx_builtin_ImportError;
+static PyObject *__pyx_builtin_AttributeError;
+static PyObject *__pyx_builtin_TypeError;
+static PyObject *__pyx_builtin_ord;
+static PyObject *__pyx_builtin_zip;
+static PyObject *__pyx_builtin_ValueError;
+static PyObject *__pyx_builtin_MemoryError;
+static PyObject *__pyx_builtin_enumerate;
+static PyObject *__pyx_builtin_Ellipsis;
+static PyObject *__pyx_builtin_xrange;
+static PyObject *__pyx_builtin_id;
+static PyObject *__pyx_builtin_IndexError;
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_compress_pck(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_image, int __pyx_v_use_CCP4); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_2uncompress_pck(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_raw, PyObject *__pyx_v_dim1, PyObject *__pyx_v_dim2, PyObject *__pyx_v_overflowPix, PyObject *__pyx_v_version, PyObject *__pyx_v_normal_start, PyObject *__pyx_v_swap_needed, int __pyx_v_use_CCP4); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_4precomp(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_img, __pyx_t_5numpy_uint32_t __pyx_v_width); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_6postdec(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_comp, int __pyx_v_width); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_8calc_nb_bits(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_16__pyx_fuse_0calc_nb_bits(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, __pyx_t_5numpy_uint32_t __pyx_v_start, __pyx_t_5numpy_uint32_t __pyx_v_stop); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_18__pyx_fuse_1calc_nb_bits(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, __pyx_t_5numpy_uint32_t __pyx_v_start, __pyx_t_5numpy_uint32_t __pyx_v_stop); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_20__pyx_fuse_2calc_nb_bits(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, __pyx_t_5numpy_uint32_t __pyx_v_start, __pyx_t_5numpy_uint32_t __pyx_v_stop); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_22__pyx_fuse_3calc_nb_bits(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, __pyx_t_5numpy_uint32_t __pyx_v_start, __pyx_t_5numpy_uint32_t __pyx_v_stop); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_10pack_image(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_img, int __pyx_v_do_precomp); /* proto */
+static int __pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer___cinit__(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *__pyx_v_self, __pyx_t_5numpy_uint32_t __pyx_v_size); /* proto */
+static void __pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_2__dealloc__(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_4get(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_6append(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *__pyx_v_self, __Pyx_memviewslice __pyx_v_data, __pyx_t_5numpy_uint32_t __pyx_v_position, __pyx_t_5numpy_uint32_t __pyx_v_nb_val, __pyx_t_5numpy_uint32_t __pyx_v_block_size); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_8position___get__(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_6offset___get__(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_9allocated___get__(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_12pack_nb_val(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_uint8_t __pyx_v_nb_val, __pyx_t_5numpy_uint8_t __pyx_v_value_size); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_14unpack_pck(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_stream, int __pyx_v_ncol, int __pyx_v_nrow); /* proto */
+static int __pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer___cinit__(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self, int __pyx_v_ncol, int __pyx_v_nrow); /* proto */
+static void __pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_2__dealloc__(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_4get(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_6get1d(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_8set_zero(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self, int __pyx_v_number); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_10unpack(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self, __Pyx_memviewslice __pyx_v_stream, __pyx_t_5numpy_uint32_t __pyx_v_pos, __pyx_t_5numpy_uint32_t __pyx_v_offset, __pyx_t_5numpy_uint32_t __pyx_v_nb_value, __pyx_t_5numpy_uint32_t __pyx_v_value_size); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_4nrow___get__(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_4ncol___get__(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_8position___get__(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_4size___get__(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_4data___get__(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self); /* 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 int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
+static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
+static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
+static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
+static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
+static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
+static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
+static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_tp_new_5fabio_3ext_9mar345_IO_PackContainer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_5fabio_3ext_9mar345_IO_UnpackContainer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+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_c[] = "c";
+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_q[] = "q";
+static char __pyx_k_Zd[] = "Zd";
+static char __pyx_k_Zf[] = "Zf";
+static char __pyx_k_Zg[] = "Zg";
+static char __pyx_k__8[] = "\n";
+static char __pyx_k_fd[] = "fd";
+static char __pyx_k_id[] = "id";
+static char __pyx_k_os[] = "os";
+static char __pyx_k_rb[] = "rb";
+static char __pyx_k_MIT[] = "MIT";
+static char __pyx_k__13[] = "()";
+static char __pyx_k__15[] = "|";
+static char __pyx_k_end[] = "end";
+static char __pyx_k_get[] = "get";
+static char __pyx_k_idx[] = "idx";
+static char __pyx_k_img[] = "img";
+static char __pyx_k_key[] = "key";
+static char __pyx_k_obj[] = "obj";
+static char __pyx_k_ord[] = "ord";
+static char __pyx_k_out[] = "out";
+static char __pyx_k_pos[] = "pos";
+static char __pyx_k_raw[] = "raw";
+static char __pyx_k_ret[] = "ret";
+static char __pyx_k_zip[] = "zip";
+static char __pyx_k_HIGH[] = "HIGH";
+static char __pyx_k_args[] = "args";
+static char __pyx_k_base[] = "base";
+static char __pyx_k_comp[] = "comp";
+static char __pyx_k_cont[] = "cont";
+static char __pyx_k_data[] = "data";
+static char __pyx_k_date[] = "__date__";
+static char __pyx_k_dim0[] = "dim0";
+static char __pyx_k_dim1[] = "dim1";
+static char __pyx_k_dim2[] = "dim2";
+static char __pyx_k_exit[] = "__exit__";
+static char __pyx_k_find[] = "find";
+static char __pyx_k_key1[] = "key1";
+static char __pyx_k_key2[] = "key2";
+static char __pyx_k_kind[] = "kind";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_mode[] = "mode";
+static char __pyx_k_name[] = "name";
+static char __pyx_k_ncol[] = "ncol";
+static char __pyx_k_ndim[] = "ndim";
+static char __pyx_k_nrow[] = "nrow";
+static char __pyx_k_open[] = "open";
+static char __pyx_k_pack[] = "pack";
+static char __pyx_k_read[] = "read";
+static char __pyx_k_seek[] = "seek";
+static char __pyx_k_size[] = "size";
+static char __pyx_k_step[] = "step";
+static char __pyx_k_stop[] = "stop";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_word[] = "word";
+static char __pyx_k_ASCII[] = "ASCII";
+static char __pyx_k_cdimx[] = "cdimx";
+static char __pyx_k_cdimy[] = "cdimy";
+static char __pyx_k_chigh[] = "chigh";
+static char __pyx_k_class[] = "__class__";
+static char __pyx_k_close[] = "close";
+static char __pyx_k_dtype[] = "dtype";
+static char __pyx_k_empty[] = "empty";
+static char __pyx_k_enter[] = "__enter__";
+static char __pyx_k_error[] = "error";
+static char __pyx_k_flags[] = "flags";
+static char __pyx_k_fname[] = "fname";
+static char __pyx_k_get1d[] = "get1d";
+static char __pyx_k_image[] = "image";
+static char __pyx_k_index[] = "index";
+static char __pyx_k_int16[] = "int16";
+static char __pyx_k_int32[] = "int32";
+static char __pyx_k_numpy[] = "numpy";
+static char __pyx_k_odata[] = "odata";
+static char __pyx_k_range[] = "range";
+static char __pyx_k_ravel[] = "ravel";
+static char __pyx_k_shape[] = "shape";
+static char __pyx_k_sizes[] = "sizes";
+static char __pyx_k_split[] = "split";
+static char __pyx_k_start[] = "start";
+static char __pyx_k_strip[] = "strip";
+static char __pyx_k_uint8[] = "uint8";
+static char __pyx_k_value[] = "value";
+static char __pyx_k_width[] = "width";
+static char __pyx_k_zeros[] = "zeros";
+static char __pyx_k_append[] = "append";
+static char __pyx_k_encode[] = "encode";
+static char __pyx_k_format[] = "format";
+static char __pyx_k_hiLine[] = "hiLine";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_int8_t[] = "int8_t";
+static char __pyx_k_kwargs[] = "kwargs";
+static char __pyx_k_lenkey[] = "lenkey";
+static char __pyx_k_logger[] = "logger";
+static char __pyx_k_lstrip[] = "lstrip";
+static char __pyx_k_name_2[] = "__name__";
+static char __pyx_k_nb_val[] = "nb_val";
+static char __pyx_k_offset[] = "offset";
+static char __pyx_k_output[] = "output";
+static char __pyx_k_stream[] = "stream";
+static char __pyx_k_struct[] = "struct";
+static char __pyx_k_uint32[] = "uint32";
+static char __pyx_k_unlink[] = "unlink";
+static char __pyx_k_unpack[] = "unpack";
+static char __pyx_k_xrange[] = "xrange";
+static char __pyx_k_asarray[] = "asarray";
+static char __pyx_k_authors[] = "__authors__";
+static char __pyx_k_contact[] = "__contact__";
+static char __pyx_k_fortran[] = "fortran";
+static char __pyx_k_int16_t[] = "int16_t";
+static char __pyx_k_int32_t[] = "int32_t";
+static char __pyx_k_int64_t[] = "int64_t";
+static char __pyx_k_license[] = "__license__";
+static char __pyx_k_logging[] = "logging";
+static char __pyx_k_memview[] = "memview";
+static char __pyx_k_mkstemp[] = "mkstemp";
+static char __pyx_k_ndarray[] = "ndarray";
+static char __pyx_k_records[] = "records";
+static char __pyx_k_reshape[] = "reshape";
+static char __pyx_k_version[] = "version";
+static char __pyx_k_warning[] = "warning";
+static char __pyx_k_Ellipsis[] = "Ellipsis";
+static char __pyx_k_byteswap[] = "byteswap";
+static char __pyx_k_cversion[] = "cversion";
+static char __pyx_k_defaults[] = "defaults";
+static char __pyx_k_instream[] = "instream";
+static char __pyx_k_itemsize[] = "itemsize";
+static char __pyx_k_nb_value[] = "nb_value";
+static char __pyx_k_position[] = "position";
+static char __pyx_k_set_zero[] = "set_zero";
+static char __pyx_k_tempfile[] = "tempfile";
+static char __pyx_k_tostring[] = "tostring";
+static char __pyx_k_unpacked[] = "unpacked";
+static char __pyx_k_use_CCP4[] = "use_CCP4";
+static char __pyx_k_TypeError[] = "TypeError";
+static char __pyx_k_container[] = "container";
+static char __pyx_k_copyright[] = "__copyright__";
+static char __pyx_k_enumerate[] = "enumerate";
+static char __pyx_k_getLogger[] = "getLogger";
+static char __pyx_k_25_07_2017[] = "25/07/2017";
+static char __pyx_k_Gael_Goret[] = "Gael Goret";
+static char __pyx_k_IndexError[] = "IndexError";
+static char __pyx_k_ValueError[] = "ValueError";
+static char __pyx_k_block_size[] = "block_size";
+static char __pyx_k_do_precomp[] = "do_precomp";
+static char __pyx_k_fromstring[] = "fromstring";
+static char __pyx_k_pack_image[] = "pack_image";
+static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static char __pyx_k_signatures[] = "signatures";
+static char __pyx_k_value_size[] = "value_size";
+static char __pyx_k_ImportError[] = "ImportError";
+static char __pyx_k_MemoryError[] = "MemoryError";
+static char __pyx_k_input_image[] = "input_image";
+static char __pyx_k_overflowPix[] = "overflowPix";
+static char __pyx_k_stream_size[] = "stream_size";
+static char __pyx_k_swap_needed[] = "swap_needed";
+static char __pyx_k_RuntimeError[] = "RuntimeError";
+static char __pyx_k_calc_nb_bits[] = "calc_nb_bits";
+static char __pyx_k_compress_pck[] = "compress_pck";
+static char __pyx_k_normal_start[] = "normal_start";
+static char __pyx_k_END_OF_HEADER[] = "END OF HEADER";
+static char __pyx_k_nb_val_packed[] = "nb_val_packed";
+static char __pyx_k_normal_offset[] = "normal_offset";
+static char __pyx_k_overflow_data[] = "overflow_data";
+static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
+static char __pyx_k_AttributeError[] = "AttributeError";
+static char __pyx_k_Jerome_Kieffer[] = "Jerome Kieffer";
+static char __pyx_k_Thomas_Vincent[] = "Thomas Vincent";
+static char __pyx_k_next_bock_size[] = "next_bock_size";
+static char __pyx_k_uncompress_pck[] = "uncompress_pck";
+static char __pyx_k_allocate_buffer[] = "allocate_buffer";
+static char __pyx_k_dtype_is_object[] = "dtype_is_object";
+static char __pyx_k_ascontiguousarray[] = "ascontiguousarray";
+static char __pyx_k_current_block_size[] = "current_block_size";
+static char __pyx_k_strided_and_direct[] = "<strided and direct>";
+static char __pyx_k_CCP4_packed_image_X[] = "CCP4 packed image, X: ";
+static char __pyx_k_fabio_ext_mar345_IO[] = "fabio.ext.mar345_IO";
+static char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
+static char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
+static char __pyx_k_CCP4_packed_image_V2_X[] = "CCP4 packed image V2, X: ";
+static char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
+static char __pyx_k_jerome_kieffer_esrf_eu[] = "jerome.kieffer@esrf.eu";
+static char __pyx_k_pyx_fuse_0calc_nb_bits[] = "__pyx_fuse_0calc_nb_bits";
+static char __pyx_k_pyx_fuse_1calc_nb_bits[] = "__pyx_fuse_1calc_nb_bits";
+static char __pyx_k_pyx_fuse_2calc_nb_bits[] = "__pyx_fuse_2calc_nb_bits";
+static char __pyx_k_pyx_fuse_3calc_nb_bits[] = "__pyx_fuse_3calc_nb_bits";
+static char __pyx_k_Input_image_shape_is_2D[] = "Input image shape is 2D";
+static char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
+static char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
+static char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
+static char __pyx_k_getbuffer_obj_view_flags[] = "getbuffer(obj, view, flags)";
+static char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
+static char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
+static char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)";
+static char __pyx_k_No_matching_signature_found[] = "No matching signature found";
+static char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)";
+static char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
+static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static char __pyx_k_CCP4_packed_image_X_04d_Y_04d[] = "\nCCP4 packed image, X: %04d, Y: %04d\n";
+static char __pyx_k_Expected_at_least_d_arguments[] = "Expected at least %d arguments";
+static char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
+static char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
+static char __pyx_k_New_Cython_version_of_mar345_IO[] = "\nNew Cython version of mar345_IO for preparing the migration to Python3\n\nCompressor & decompressor for \"pack\" algorithm by JPA, binding to CCP4 libraries\nthose libraries are re-implemented in Cython.\n\nKnown bugs:\n-----------\n\nThe precomp/postdec part need to be performed operation in int16 and exports\nuint16. Some calculation are overflowing, this is needed to reproduce the\noriginal implementation which is buggy\n\n";
+static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static char __pyx_k_workspace_valls_fabio_git_fabio[] = "/workspace/valls/fabio.git/fabio/ext/mar345_IO.pyx";
+static char __pyx_k_2012_2016_European_Synchrotron_R[] = "2012-2016, European Synchrotron Radiation Facility, Grenoble, France";
+static char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
+static char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
+static char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
+static char __pyx_k_Cannot_determine_the_compression[] = "Cannot determine the compression scheme for PCK compression (either version 1 or 2)";
+static char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
+static char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
+static char __pyx_k_Error_while_looking_for_overflow[] = "Error while looking for overflowed pixels in line %s";
+static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static char __pyx_k_Function_call_with_ambiguous_arg[] = "Function call with ambiguous argument types";
+static char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
+static char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
+static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
+static char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
+static char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
+static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
+static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static PyObject *__pyx_kp_s_2012_2016_European_Synchrotron_R;
+static PyObject *__pyx_kp_s_25_07_2017;
+static PyObject *__pyx_n_s_ASCII;
+static PyObject *__pyx_n_s_AttributeError;
+static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
+static PyObject *__pyx_kp_b_CCP4_packed_image_V2_X;
+static PyObject *__pyx_kp_b_CCP4_packed_image_X;
+static PyObject *__pyx_kp_s_CCP4_packed_image_X_04d_Y_04d;
+static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
+static PyObject *__pyx_kp_s_Cannot_determine_the_compression;
+static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
+static PyObject *__pyx_kp_s_END_OF_HEADER;
+static PyObject *__pyx_n_s_Ellipsis;
+static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
+static PyObject *__pyx_kp_s_Error_while_looking_for_overflow;
+static PyObject *__pyx_kp_s_Expected_at_least_d_arguments;
+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_s_Function_call_with_ambiguous_arg;
+static PyObject *__pyx_kp_s_Gael_Goret;
+static PyObject *__pyx_n_s_HIGH;
+static PyObject *__pyx_n_s_ImportError;
+static PyObject *__pyx_n_s_IndexError;
+static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
+static PyObject *__pyx_kp_s_Input_image_shape_is_2D;
+static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
+static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
+static PyObject *__pyx_kp_s_Jerome_Kieffer;
+static PyObject *__pyx_n_s_MIT;
+static PyObject *__pyx_n_s_MemoryError;
+static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
+static PyObject *__pyx_kp_s_MemoryView_of_r_object;
+static PyObject *__pyx_kp_s_No_matching_signature_found;
+static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
+static PyObject *__pyx_n_b_O;
+static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
+static PyObject *__pyx_n_s_RuntimeError;
+static PyObject *__pyx_kp_s_Thomas_Vincent;
+static PyObject *__pyx_n_s_TypeError;
+static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_kp_s__13;
+static PyObject *__pyx_kp_s__15;
+static PyObject *__pyx_kp_s__8;
+static PyObject *__pyx_n_s_allocate_buffer;
+static PyObject *__pyx_n_s_append;
+static PyObject *__pyx_n_s_args;
+static PyObject *__pyx_n_s_asarray;
+static PyObject *__pyx_n_s_ascontiguousarray;
+static PyObject *__pyx_n_s_authors;
+static PyObject *__pyx_n_s_base;
+static PyObject *__pyx_n_s_block_size;
+static PyObject *__pyx_n_s_byteswap;
+static PyObject *__pyx_n_s_c;
+static PyObject *__pyx_n_u_c;
+static PyObject *__pyx_n_s_calc_nb_bits;
+static PyObject *__pyx_n_s_cdimx;
+static PyObject *__pyx_n_s_cdimy;
+static PyObject *__pyx_n_s_chigh;
+static PyObject *__pyx_n_s_class;
+static PyObject *__pyx_n_s_close;
+static PyObject *__pyx_n_s_comp;
+static PyObject *__pyx_n_s_compress_pck;
+static PyObject *__pyx_n_s_cont;
+static PyObject *__pyx_n_s_contact;
+static PyObject *__pyx_n_s_container;
+static PyObject *__pyx_kp_s_contiguous_and_direct;
+static PyObject *__pyx_kp_s_contiguous_and_indirect;
+static PyObject *__pyx_n_s_copyright;
+static PyObject *__pyx_n_s_current_block_size;
+static PyObject *__pyx_n_s_cversion;
+static PyObject *__pyx_n_s_data;
+static PyObject *__pyx_n_s_date;
+static PyObject *__pyx_n_s_defaults;
+static PyObject *__pyx_n_s_dim0;
+static PyObject *__pyx_n_s_dim1;
+static PyObject *__pyx_n_s_dim2;
+static PyObject *__pyx_n_s_do_precomp;
+static PyObject *__pyx_n_s_dtype;
+static PyObject *__pyx_n_s_dtype_is_object;
+static PyObject *__pyx_n_s_empty;
+static PyObject *__pyx_n_s_encode;
+static PyObject *__pyx_n_s_end;
+static PyObject *__pyx_n_s_enter;
+static PyObject *__pyx_n_s_enumerate;
+static PyObject *__pyx_n_s_error;
+static PyObject *__pyx_n_s_exit;
+static PyObject *__pyx_n_s_f;
+static PyObject *__pyx_n_s_fabio_ext_mar345_IO;
+static PyObject *__pyx_n_s_fd;
+static PyObject *__pyx_n_s_find;
+static PyObject *__pyx_n_s_flags;
+static PyObject *__pyx_n_s_fname;
+static PyObject *__pyx_n_s_format;
+static PyObject *__pyx_n_s_fortran;
+static PyObject *__pyx_n_u_fortran;
+static PyObject *__pyx_n_s_fromstring;
+static PyObject *__pyx_n_s_get;
+static PyObject *__pyx_n_s_get1d;
+static PyObject *__pyx_n_s_getLogger;
+static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
+static PyObject *__pyx_n_s_hiLine;
+static PyObject *__pyx_n_s_i;
+static PyObject *__pyx_n_s_id;
+static PyObject *__pyx_n_s_idx;
+static PyObject *__pyx_n_s_image;
+static PyObject *__pyx_n_s_img;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_index;
+static PyObject *__pyx_n_s_input_image;
+static PyObject *__pyx_n_s_instream;
+static PyObject *__pyx_n_s_int16;
+static PyObject *__pyx_n_s_int16_t;
+static PyObject *__pyx_n_s_int32;
+static PyObject *__pyx_n_s_int32_t;
+static PyObject *__pyx_n_s_int64_t;
+static PyObject *__pyx_n_s_int8_t;
+static PyObject *__pyx_n_s_itemsize;
+static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
+static PyObject *__pyx_n_s_j;
+static PyObject *__pyx_kp_s_jerome_kieffer_esrf_eu;
+static PyObject *__pyx_n_s_key;
+static PyObject *__pyx_n_s_key1;
+static PyObject *__pyx_n_s_key2;
+static PyObject *__pyx_n_s_kind;
+static PyObject *__pyx_n_s_kwargs;
+static PyObject *__pyx_n_s_lenkey;
+static PyObject *__pyx_n_s_license;
+static PyObject *__pyx_n_s_logger;
+static PyObject *__pyx_n_s_logging;
+static PyObject *__pyx_n_s_lstrip;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_memview;
+static PyObject *__pyx_n_s_mkstemp;
+static PyObject *__pyx_n_s_mode;
+static PyObject *__pyx_n_s_name;
+static PyObject *__pyx_n_s_name_2;
+static PyObject *__pyx_n_s_nb_val;
+static PyObject *__pyx_n_s_nb_val_packed;
+static PyObject *__pyx_n_s_nb_value;
+static PyObject *__pyx_n_s_ncol;
+static PyObject *__pyx_n_s_ndarray;
+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_ndim;
+static PyObject *__pyx_n_s_next_bock_size;
+static PyObject *__pyx_n_s_normal_offset;
+static PyObject *__pyx_n_s_normal_start;
+static PyObject *__pyx_n_s_nrow;
+static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_n_s_obj;
+static PyObject *__pyx_n_s_odata;
+static PyObject *__pyx_n_s_offset;
+static PyObject *__pyx_n_s_open;
+static PyObject *__pyx_n_s_ord;
+static PyObject *__pyx_n_s_os;
+static PyObject *__pyx_n_s_out;
+static PyObject *__pyx_n_s_output;
+static PyObject *__pyx_n_s_overflowPix;
+static PyObject *__pyx_n_s_overflow_data;
+static PyObject *__pyx_n_s_pack;
+static PyObject *__pyx_n_s_pack_image;
+static PyObject *__pyx_n_s_pos;
+static PyObject *__pyx_n_s_position;
+static PyObject *__pyx_n_s_pyx_fuse_0calc_nb_bits;
+static PyObject *__pyx_n_s_pyx_fuse_1calc_nb_bits;
+static PyObject *__pyx_n_s_pyx_fuse_2calc_nb_bits;
+static PyObject *__pyx_n_s_pyx_fuse_3calc_nb_bits;
+static PyObject *__pyx_n_s_pyx_getbuffer;
+static PyObject *__pyx_n_s_pyx_vtable;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_ravel;
+static PyObject *__pyx_n_s_raw;
+static PyObject *__pyx_n_s_rb;
+static PyObject *__pyx_n_s_read;
+static PyObject *__pyx_n_s_records;
+static PyObject *__pyx_n_s_reshape;
+static PyObject *__pyx_n_s_ret;
+static PyObject *__pyx_n_s_seek;
+static PyObject *__pyx_n_s_set_zero;
+static PyObject *__pyx_n_s_shape;
+static PyObject *__pyx_n_s_signatures;
+static PyObject *__pyx_n_s_size;
+static PyObject *__pyx_n_s_sizes;
+static PyObject *__pyx_n_s_split;
+static PyObject *__pyx_n_s_start;
+static PyObject *__pyx_n_s_step;
+static PyObject *__pyx_n_s_stop;
+static PyObject *__pyx_n_s_stream;
+static PyObject *__pyx_n_s_stream_size;
+static PyObject *__pyx_kp_s_strided_and_direct;
+static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
+static PyObject *__pyx_kp_s_strided_and_indirect;
+static PyObject *__pyx_n_s_strip;
+static PyObject *__pyx_n_s_struct;
+static PyObject *__pyx_n_s_swap_needed;
+static PyObject *__pyx_n_s_tempfile;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_tostring;
+static PyObject *__pyx_n_s_uint32;
+static PyObject *__pyx_n_s_uint8;
+static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
+static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
+static PyObject *__pyx_n_s_uncompress_pck;
+static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
+static PyObject *__pyx_n_s_unlink;
+static PyObject *__pyx_n_s_unpack;
+static PyObject *__pyx_n_s_unpacked;
+static PyObject *__pyx_n_s_use_CCP4;
+static PyObject *__pyx_n_s_value;
+static PyObject *__pyx_n_s_value_size;
+static PyObject *__pyx_n_s_version;
+static PyObject *__pyx_n_s_warning;
+static PyObject *__pyx_n_s_width;
+static PyObject *__pyx_n_s_word;
+static PyObject *__pyx_kp_s_workspace_valls_fabio_git_fabio;
+static PyObject *__pyx_n_s_xrange;
+static PyObject *__pyx_n_s_zeros;
+static PyObject *__pyx_n_s_zip;
+static PyObject *__pyx_int_0;
+static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_2;
+static PyObject *__pyx_int_13;
+static PyObject *__pyx_int_neg_1;
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_tuple__2;
+static PyObject *__pyx_tuple__3;
+static PyObject *__pyx_tuple__4;
+static PyObject *__pyx_tuple__5;
+static PyObject *__pyx_tuple__6;
+static PyObject *__pyx_tuple__7;
+static PyObject *__pyx_tuple__9;
+static PyObject *__pyx_slice__32;
+static PyObject *__pyx_slice__33;
+static PyObject *__pyx_slice__34;
+static PyObject *__pyx_tuple__10;
+static PyObject *__pyx_tuple__11;
+static PyObject *__pyx_tuple__12;
+static PyObject *__pyx_tuple__14;
+static PyObject *__pyx_tuple__16;
+static PyObject *__pyx_tuple__17;
+static PyObject *__pyx_tuple__18;
+static PyObject *__pyx_tuple__19;
+static PyObject *__pyx_tuple__20;
+static PyObject *__pyx_tuple__21;
+static PyObject *__pyx_tuple__22;
+static PyObject *__pyx_tuple__23;
+static PyObject *__pyx_tuple__24;
+static PyObject *__pyx_tuple__25;
+static PyObject *__pyx_tuple__26;
+static PyObject *__pyx_tuple__27;
+static PyObject *__pyx_tuple__28;
+static PyObject *__pyx_tuple__29;
+static PyObject *__pyx_tuple__30;
+static PyObject *__pyx_tuple__31;
+static PyObject *__pyx_tuple__35;
+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__45;
+static PyObject *__pyx_tuple__46;
+static PyObject *__pyx_tuple__47;
+static PyObject *__pyx_tuple__48;
+static PyObject *__pyx_codeobj__37;
+static PyObject *__pyx_codeobj__39;
+static PyObject *__pyx_codeobj__41;
+static PyObject *__pyx_codeobj__43;
+
+/* "fabio/ext/mar345_IO.pyx":81
+ *
+ * @cython.boundscheck(False)
+ * def compress_pck(image not None, bint use_CCP4=False): # <<<<<<<<<<<<<<
+ * """
+ * :param image: numpy array as input
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_1compress_pck(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_5fabio_3ext_9mar345_IO_compress_pck[] = "\n :param image: numpy array as input\n :param use_CCP4: use the former LGPL implementation provided by CCP4\n :return: binary stream\n ";
+static PyMethodDef __pyx_mdef_5fabio_3ext_9mar345_IO_1compress_pck = {"compress_pck", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_1compress_pck, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_9mar345_IO_compress_pck};
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_1compress_pck(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_image = 0;
+ int __pyx_v_use_CCP4;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("compress_pck (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_image,&__pyx_n_s_use_CCP4,0};
+ PyObject* values[2] = {0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_image)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_CCP4);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compress_pck") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_image = values[0];
+ if (values[1]) {
+ __pyx_v_use_CCP4 = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_use_CCP4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+ __pyx_v_use_CCP4 = ((int)0);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("compress_pck", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.compress_pck", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ if (unlikely(((PyObject *)__pyx_v_image) == Py_None)) {
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "image"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_compress_pck(__pyx_self, __pyx_v_image, __pyx_v_use_CCP4);
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_compress_pck(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_image, int __pyx_v_use_CCP4) {
+ CYTHON_UNUSED __pyx_t_5numpy_uint32_t __pyx_v_size;
+ __pyx_t_5numpy_uint32_t __pyx_v_dim0;
+ __pyx_t_5numpy_uint32_t __pyx_v_dim1;
+ int __pyx_v_fd;
+ char *__pyx_v_name;
+ __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_v_raw = { 0, 0, { 0 }, { 0 }, { 0 } };
+ PyObject *__pyx_v_output = 0;
+ PyObject *__pyx_v_fname = NULL;
+ PyObject *__pyx_v_f = NULL;
+ PyObject *__pyx_v_cont = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ __pyx_t_5numpy_uint32_t __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ PyObject *(*__pyx_t_9)(PyObject *);
+ int __pyx_t_10;
+ char *__pyx_t_11;
+ Py_ssize_t __pyx_t_12;
+ PyObject *__pyx_t_13 = NULL;
+ PyObject *__pyx_t_14 = NULL;
+ PyObject *__pyx_t_15 = NULL;
+ PyObject *__pyx_t_16 = NULL;
+ PyObject *__pyx_t_17 = NULL;
+ int __pyx_t_18;
+ __Pyx_memviewslice __pyx_t_19 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ Py_ssize_t __pyx_t_20;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("compress_pck", 0);
+
+ /* "fabio/ext/mar345_IO.pyx":95
+ * bytes output
+ *
+ * assert image.ndim == 2, "Input image shape is 2D" # <<<<<<<<<<<<<<
+ * size = image.size
+ * dim0 = image.shape[0]
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_image, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (unlikely(!__pyx_t_3)) {
+ PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Input_image_shape_is_2D);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+
+ /* "fabio/ext/mar345_IO.pyx":96
+ *
+ * assert image.ndim == 2, "Input image shape is 2D"
+ * size = image.size # <<<<<<<<<<<<<<
+ * dim0 = image.shape[0]
+ * dim1 = image.shape[1]
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_image, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = __Pyx_PyInt_As_npy_uint32(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_size = __pyx_t_4;
+
+ /* "fabio/ext/mar345_IO.pyx":97
+ * assert image.ndim == 2, "Input image shape is 2D"
+ * size = image.size
+ * dim0 = image.shape[0] # <<<<<<<<<<<<<<
+ * dim1 = image.shape[1]
+ * data = numpy.ascontiguousarray(image.ravel(), dtype=numpy.int16)
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_image, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_As_npy_uint32(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_dim0 = __pyx_t_4;
+
+ /* "fabio/ext/mar345_IO.pyx":98
+ * size = image.size
+ * dim0 = image.shape[0]
+ * dim1 = image.shape[1] # <<<<<<<<<<<<<<
+ * data = numpy.ascontiguousarray(image.ravel(), dtype=numpy.int16)
+ * if use_CCP4:
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_image, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __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 = 98; __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_As_npy_uint32(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_dim1 = __pyx_t_4;
+
+ /* "fabio/ext/mar345_IO.pyx":99
+ * dim0 = image.shape[0]
+ * dim1 = image.shape[1]
+ * data = numpy.ascontiguousarray(image.ravel(), dtype=numpy.int16) # <<<<<<<<<<<<<<
+ * if use_CCP4:
+ * (fd, fname) = tempfile.mkstemp()
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_image, __pyx_n_s_ravel); 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_6 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ }
+ }
+ if (__pyx_t_6) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else {
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_5); __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);
+ PyTuple_SET_ITEM(__pyx_t_5, 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 = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); 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_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int16); 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_6); __pyx_t_6 = 0;
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __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 = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int16_t(__pyx_t_7);
+ if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_v_data = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
+
+ /* "fabio/ext/mar345_IO.pyx":100
+ * dim1 = image.shape[1]
+ * data = numpy.ascontiguousarray(image.ravel(), dtype=numpy.int16)
+ * if use_CCP4: # <<<<<<<<<<<<<<
+ * (fd, fname) = tempfile.mkstemp()
+ * fname = fname.encode("ASCII")
+ */
+ __pyx_t_3 = (__pyx_v_use_CCP4 != 0);
+ if (__pyx_t_3) {
+
+ /* "fabio/ext/mar345_IO.pyx":101
+ * data = numpy.ascontiguousarray(image.ravel(), dtype=numpy.int16)
+ * if use_CCP4:
+ * (fd, fname) = tempfile.mkstemp() # <<<<<<<<<<<<<<
+ * fname = fname.encode("ASCII")
+ * name = <char*> fname
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_tempfile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_mkstemp); 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_2); __pyx_t_2 = 0;
+ __pyx_t_2 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_2)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ }
+ }
+ if (__pyx_t_2) {
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else {
+ __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_5); 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);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
+ PyObject* sequence = __pyx_t_7;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ Py_ssize_t size = Py_SIZE(sequence);
+ #else
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ if (likely(PyTuple_CheckExact(sequence))) {
+ __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
+ } else {
+ __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
+ }
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_2);
+ #else
+ __pyx_t_5 = PySequence_ITEM(sequence, 0); 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_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ #endif
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else {
+ Py_ssize_t index = -1;
+ __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext;
+ index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_5);
+ index = 1; __pyx_t_2 = __pyx_t_9(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_2);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = NULL;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ goto __pyx_L5_unpacking_done;
+ __pyx_L4_unpacking_failed:;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_9 = NULL;
+ if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_L5_unpacking_done:;
+ }
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_fd = __pyx_t_10;
+ __pyx_v_fname = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":102
+ * if use_CCP4:
+ * (fd, fname) = tempfile.mkstemp()
+ * fname = fname.encode("ASCII") # <<<<<<<<<<<<<<
+ * name = <char*> fname
+ * with nogil:
+ */
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_fname, __pyx_n_s_encode); 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_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF_SET(__pyx_v_fname, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":103
+ * (fd, fname) = tempfile.mkstemp()
+ * fname = fname.encode("ASCII")
+ * name = <char*> fname # <<<<<<<<<<<<<<
+ * with nogil:
+ * pack_wordimage_c(<short int *> &data[0], dim1, dim0, name)
+ */
+ __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v_fname); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_name = ((char *)__pyx_t_11);
+
+ /* "fabio/ext/mar345_IO.pyx":104
+ * fname = fname.encode("ASCII")
+ * name = <char*> fname
+ * with nogil: # <<<<<<<<<<<<<<
+ * pack_wordimage_c(<short int *> &data[0], dim1, dim0, name)
+ * with open(name, "rb") as f:
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":105
+ * name = <char*> fname
+ * with nogil:
+ * pack_wordimage_c(<short int *> &data[0], dim1, dim0, name) # <<<<<<<<<<<<<<
+ * with open(name, "rb") as f:
+ * f.seek(0)
+ */
+ __pyx_t_12 = 0;
+ if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_data.shape[0];
+ pack_wordimage_c(((short *)(&(*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int16_t *) __pyx_v_data.data) + __pyx_t_12)) ))))), __pyx_v_dim1, __pyx_v_dim0, __pyx_v_name);
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":104
+ * fname = fname.encode("ASCII")
+ * name = <char*> fname
+ * with nogil: # <<<<<<<<<<<<<<
+ * pack_wordimage_c(<short int *> &data[0], dim1, dim0, name)
+ * with open(name, "rb") as f:
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+ }
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":106
+ * with nogil:
+ * pack_wordimage_c(<short int *> &data[0], dim1, dim0, name)
+ * with open(name, "rb") as f: # <<<<<<<<<<<<<<
+ * f.seek(0)
+ * output = f.read()
+ */
+ /*with:*/ {
+ __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_n_s_rb);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_rb);
+ __Pyx_GIVEREF(__pyx_n_s_rb);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_13 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_1 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_1)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_1);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ }
+ }
+ if (__pyx_t_1) {
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else {
+ __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __pyx_t_7;
+ __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ /*try:*/ {
+ {
+ __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
+ __Pyx_XGOTREF(__pyx_t_14);
+ __Pyx_XGOTREF(__pyx_t_15);
+ __Pyx_XGOTREF(__pyx_t_16);
+ /*try:*/ {
+ __pyx_v_f = __pyx_t_5;
+ __pyx_t_5 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":107
+ * pack_wordimage_c(<short int *> &data[0], dim1, dim0, name)
+ * with open(name, "rb") as f:
+ * f.seek(0) # <<<<<<<<<<<<<<
+ * output = f.read()
+ * os.close(fd)
+ */
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_seek); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":108
+ * with open(name, "rb") as f:
+ * f.seek(0)
+ * output = f.read() # <<<<<<<<<<<<<<
+ * os.close(fd)
+ * os.unlink(fname)
+ */
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_read); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_7 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_7)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ }
+ }
+ if (__pyx_t_7) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else {
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
+ __pyx_v_output = ((PyObject*)__pyx_t_2);
+ __pyx_t_2 = 0;
+ }
+ __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+ goto __pyx_L20_try_end;
+ __pyx_L13_error:;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
+
+ /* "fabio/ext/mar345_IO.pyx":106
+ * with nogil:
+ * pack_wordimage_c(<short int *> &data[0], dim1, dim0, name)
+ * with open(name, "rb") as f: # <<<<<<<<<<<<<<
+ * f.seek(0)
+ * output = f.read()
+ */
+ /*except:*/ {
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.compress_pck", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_5, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_1 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_1, NULL);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ if (__pyx_t_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
+ __pyx_t_18 = ((!(__pyx_t_3 != 0)) != 0);
+ if (__pyx_t_18) {
+ __Pyx_GIVEREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __Pyx_XGIVEREF(__pyx_t_7);
+ __Pyx_ErrRestore(__pyx_t_2, __pyx_t_5, __pyx_t_7);
+ __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_7 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ goto __pyx_L14_exception_handled;
+ }
+ __pyx_L15_except_error:;
+ __Pyx_XGIVEREF(__pyx_t_14);
+ __Pyx_XGIVEREF(__pyx_t_15);
+ __Pyx_XGIVEREF(__pyx_t_16);
+ __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+ goto __pyx_L1_error;
+ __pyx_L14_exception_handled:;
+ __Pyx_XGIVEREF(__pyx_t_14);
+ __Pyx_XGIVEREF(__pyx_t_15);
+ __Pyx_XGIVEREF(__pyx_t_16);
+ __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+ __pyx_L20_try_end:;
+ }
+ }
+ /*finally:*/ {
+ /*normal exit:*/{
+ if (__pyx_t_13) {
+ __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__3, NULL);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_16);
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ }
+ goto __pyx_L12;
+ }
+ __pyx_L12:;
+ }
+ goto __pyx_L24;
+ __pyx_L9_error:;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ goto __pyx_L1_error;
+ __pyx_L24:;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":109
+ * f.seek(0)
+ * output = f.read()
+ * os.close(fd) # <<<<<<<<<<<<<<
+ * os.unlink(fname)
+ * else:
+ */
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_1 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_1)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_1);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
+ }
+ if (!__pyx_t_1) {
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ } else {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":110
+ * output = f.read()
+ * os.close(fd)
+ * os.unlink(fname) # <<<<<<<<<<<<<<
+ * else:
+ * output = ("\nCCP4 packed image, X: %04d, Y: %04d\n" % (dim1, dim0)).encode("ASCII")
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unlink); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_2)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ }
+ }
+ if (!__pyx_t_2) {
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_fname); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ } else {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_INCREF(__pyx_v_fname);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_fname);
+ __Pyx_GIVEREF(__pyx_v_fname);
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":112
+ * os.unlink(fname)
+ * else:
+ * output = ("\nCCP4 packed image, X: %04d, Y: %04d\n" % (dim1, dim0)).encode("ASCII") # <<<<<<<<<<<<<<
+ * raw = precomp(data, dim1)
+ * cont = pack_image(raw, False)
+ */
+ __pyx_t_7 = __Pyx_PyInt_From_npy_uint32(__pyx_v_dim1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_6 = __Pyx_PyInt_From_npy_uint32(__pyx_v_dim0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __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 = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ __pyx_t_7 = 0;
+ __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_CCP4_packed_image_X_04d_Y_04d, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_output = ((PyObject*)__pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":113
+ * else:
+ * output = ("\nCCP4 packed image, X: %04d, Y: %04d\n" % (dim1, dim0)).encode("ASCII")
+ * raw = precomp(data, dim1) # <<<<<<<<<<<<<<
+ * cont = pack_image(raw, False)
+ * output += cont.get().tostring()
+ */
+ __pyx_t_19 = __pyx_f_5fabio_3ext_9mar345_IO_precomp(__pyx_v_data, __pyx_v_dim1, 0); if (unlikely(!__pyx_t_19.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_raw = __pyx_t_19;
+ __pyx_t_19.memview = NULL;
+ __pyx_t_19.data = NULL;
+
+ /* "fabio/ext/mar345_IO.pyx":114
+ * output = ("\nCCP4 packed image, X: %04d, Y: %04d\n" % (dim1, dim0)).encode("ASCII")
+ * raw = precomp(data, dim1)
+ * cont = pack_image(raw, False) # <<<<<<<<<<<<<<
+ * output += cont.get().tostring()
+ * return output
+ */
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pack_image); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_raw, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_2 = NULL;
+ __pyx_t_20 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_2)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ __pyx_t_20 = 1;
+ }
+ }
+ __pyx_t_1 = PyTuple_New(2+__pyx_t_20); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (__pyx_t_2) {
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
+ }
+ PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_20, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __Pyx_INCREF(Py_False);
+ PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_20, Py_False);
+ __Pyx_GIVEREF(Py_False);
+ __pyx_t_7 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_cont = __pyx_t_6;
+ __pyx_t_6 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":115
+ * raw = precomp(data, dim1)
+ * cont = pack_image(raw, False)
+ * output += cont.get().tostring() # <<<<<<<<<<<<<<
+ * return output
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cont, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_7 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_7)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ }
+ }
+ if (__pyx_t_7) {
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else {
+ __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_tostring); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ }
+ }
+ if (__pyx_t_5) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else {
+ __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_output, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_1));
+ __pyx_t_1 = 0;
+ }
+ __pyx_L3:;
+
+ /* "fabio/ext/mar345_IO.pyx":116
+ * cont = pack_image(raw, False)
+ * output += cont.get().tostring()
+ * return output # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ if (unlikely(!__pyx_v_output)) { __Pyx_RaiseUnboundLocalError("output"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __Pyx_INCREF(__pyx_v_output);
+ __pyx_r = __pyx_v_output;
+ goto __pyx_L0;
+
+ /* "fabio/ext/mar345_IO.pyx":81
+ *
+ * @cython.boundscheck(False)
+ * def compress_pck(image not None, bint use_CCP4=False): # <<<<<<<<<<<<<<
+ * """
+ * :param image: numpy array as input
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.compress_pck", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_raw, 1);
+ __Pyx_XDECREF(__pyx_v_output);
+ __Pyx_XDECREF(__pyx_v_fname);
+ __Pyx_XDECREF(__pyx_v_f);
+ __Pyx_XDECREF(__pyx_v_cont);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":121
+ * @cython.boundscheck(False)
+ * @cython.cdivision(True)
+ * def uncompress_pck(bytes raw not None, dim1=None, dim2=None, overflowPix=None, version=None, normal_start=None, swap_needed=None, bint use_CCP4=False): # <<<<<<<<<<<<<<
+ * """
+ * Unpack a mar345 compressed image
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_3uncompress_pck(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_5fabio_3ext_9mar345_IO_2uncompress_pck[] = "\n Unpack a mar345 compressed image\n\n :param raw: input string (bytes in python3)\n :param dim1,dim2: optional parameters size\n :param overflowPix: optional parameters: number of overflowed pixels\n :param version: PCK version 1 or 2\n :param normal_start: position of the normal value section (can be auto-guessed)\n :param swap_needed: set to True when reading data from a foreign endianness (little on big or big on little)\n @return : ndarray of 2D with the right size\n ";
+static PyMethodDef __pyx_mdef_5fabio_3ext_9mar345_IO_3uncompress_pck = {"uncompress_pck", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_3uncompress_pck, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_9mar345_IO_2uncompress_pck};
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_3uncompress_pck(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_raw = 0;
+ PyObject *__pyx_v_dim1 = 0;
+ PyObject *__pyx_v_dim2 = 0;
+ PyObject *__pyx_v_overflowPix = 0;
+ PyObject *__pyx_v_version = 0;
+ PyObject *__pyx_v_normal_start = 0;
+ PyObject *__pyx_v_swap_needed = 0;
+ int __pyx_v_use_CCP4;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("uncompress_pck (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_raw,&__pyx_n_s_dim1,&__pyx_n_s_dim2,&__pyx_n_s_overflowPix,&__pyx_n_s_version,&__pyx_n_s_normal_start,&__pyx_n_s_swap_needed,&__pyx_n_s_use_CCP4,0};
+ PyObject* values[8] = {0,0,0,0,0,0,0,0};
+ values[1] = ((PyObject *)Py_None);
+ values[2] = ((PyObject *)Py_None);
+ values[3] = ((PyObject *)Py_None);
+ values[4] = ((PyObject *)Py_None);
+ values[5] = ((PyObject *)Py_None);
+ values[6] = ((PyObject *)Py_None);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_raw)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dim1);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dim2);
+ if (value) { values[2] = value; kw_args--; }
+ }
+ case 3:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_overflowPix);
+ if (value) { values[3] = value; kw_args--; }
+ }
+ case 4:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_version);
+ if (value) { values[4] = value; kw_args--; }
+ }
+ case 5:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_normal_start);
+ if (value) { values[5] = value; kw_args--; }
+ }
+ case 6:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_swap_needed);
+ if (value) { values[6] = value; kw_args--; }
+ }
+ case 7:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_CCP4);
+ if (value) { values[7] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "uncompress_pck") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_raw = ((PyObject*)values[0]);
+ __pyx_v_dim1 = values[1];
+ __pyx_v_dim2 = values[2];
+ __pyx_v_overflowPix = values[3];
+ __pyx_v_version = values[4];
+ __pyx_v_normal_start = values[5];
+ __pyx_v_swap_needed = values[6];
+ if (values[7]) {
+ __pyx_v_use_CCP4 = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_use_CCP4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+ __pyx_v_use_CCP4 = ((int)0);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("uncompress_pck", 0, 1, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.uncompress_pck", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_raw), (&PyBytes_Type), 0, "raw", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_2uncompress_pck(__pyx_self, __pyx_v_raw, __pyx_v_dim1, __pyx_v_dim2, __pyx_v_overflowPix, __pyx_v_version, __pyx_v_normal_start, __pyx_v_swap_needed, __pyx_v_use_CCP4);
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_2uncompress_pck(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_raw, PyObject *__pyx_v_dim1, PyObject *__pyx_v_dim2, PyObject *__pyx_v_overflowPix, PyObject *__pyx_v_version, PyObject *__pyx_v_normal_start, PyObject *__pyx_v_swap_needed, int __pyx_v_use_CCP4) {
+ int __pyx_v_cdimx;
+ int __pyx_v_cdimy;
+ int __pyx_v_chigh;
+ int __pyx_v_cversion;
+ int __pyx_v_records;
+ int __pyx_v_normal_offset;
+ int __pyx_v_lenkey;
+ int __pyx_v_i;
+ int __pyx_v_stop;
+ int __pyx_v_idx;
+ int __pyx_v_value;
+ __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_v_instream = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_v_unpacked = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_v_overflow_data = { 0, 0, { 0 }, { 0 }, { 0 } };
+ PyObject *__pyx_v_end = NULL;
+ PyObject *__pyx_v_key1 = NULL;
+ PyObject *__pyx_v_key2 = NULL;
+ PyObject *__pyx_v_start = NULL;
+ PyObject *__pyx_v_key = NULL;
+ PyObject *__pyx_v_sizes = NULL;
+ PyObject *__pyx_v_hiLine = NULL;
+ PyObject *__pyx_v_word = NULL;
+ PyObject *__pyx_v_odata = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ int __pyx_t_10;
+ PyObject *__pyx_t_11 = NULL;
+ __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ Py_ssize_t __pyx_t_14;
+ Py_ssize_t __pyx_t_15;
+ Py_ssize_t __pyx_t_16;
+ Py_ssize_t __pyx_t_17;
+ __Pyx_memviewslice __pyx_t_18 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_t_19 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ PyObject *__pyx_t_20 = NULL;
+ Py_ssize_t __pyx_t_21;
+ PyObject *__pyx_t_22 = NULL;
+ __Pyx_memviewslice __pyx_t_23 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_t_24;
+ Py_ssize_t __pyx_t_25;
+ int __pyx_t_26;
+ Py_ssize_t __pyx_t_27;
+ int __pyx_t_28;
+ int __pyx_t_29;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("uncompress_pck", 0);
+
+ /* "fabio/ext/mar345_IO.pyx":140
+ * cnp.int32_t[:, ::1] overflow_data # handles overflows
+ * void* out
+ * end = None # <<<<<<<<<<<<<<
+ * key1 = b"CCP4 packed image, X: "
+ * key2 = b"CCP4 packed image V2, X: "
+ */
+ __Pyx_INCREF(Py_None);
+ __pyx_v_end = Py_None;
+
+ /* "fabio/ext/mar345_IO.pyx":141
+ * void* out
+ * end = None
+ * key1 = b"CCP4 packed image, X: " # <<<<<<<<<<<<<<
+ * key2 = b"CCP4 packed image V2, X: "
+ *
+ */
+ __Pyx_INCREF(__pyx_kp_b_CCP4_packed_image_X);
+ __pyx_v_key1 = __pyx_kp_b_CCP4_packed_image_X;
+
+ /* "fabio/ext/mar345_IO.pyx":142
+ * end = None
+ * key1 = b"CCP4 packed image, X: "
+ * key2 = b"CCP4 packed image V2, X: " # <<<<<<<<<<<<<<
+ *
+ * if (dim1 is None) or (dim2 is None) or \
+ */
+ __Pyx_INCREF(__pyx_kp_b_CCP4_packed_image_V2_X);
+ __pyx_v_key2 = __pyx_kp_b_CCP4_packed_image_V2_X;
+
+ /* "fabio/ext/mar345_IO.pyx":144
+ * key2 = b"CCP4 packed image V2, X: "
+ *
+ * if (dim1 is None) or (dim2 is None) or \ # <<<<<<<<<<<<<<
+ * (version not in [1, 2]) or \
+ * (version is None) or \
+ */
+ __pyx_t_2 = (__pyx_v_dim1 == Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (!__pyx_t_3) {
+ } else {
+ __pyx_t_1 = __pyx_t_3;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_3 = (__pyx_v_dim2 == Py_None);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L4_bool_binop_done;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":145
+ *
+ * if (dim1 is None) or (dim2 is None) or \
+ * (version not in [1, 2]) or \ # <<<<<<<<<<<<<<
+ * (version is None) or \
+ * (normal_start is None):
+ */
+ __Pyx_INCREF(__pyx_v_version);
+ __pyx_t_4 = __pyx_v_version;
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (__pyx_t_3) {
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L8_bool_binop_done;
+ }
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_int_2, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_2 = __pyx_t_3;
+ __pyx_L8_bool_binop_done:;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (!__pyx_t_3) {
+ } else {
+ __pyx_t_1 = __pyx_t_3;
+ goto __pyx_L4_bool_binop_done;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":146
+ * if (dim1 is None) or (dim2 is None) or \
+ * (version not in [1, 2]) or \
+ * (version is None) or \ # <<<<<<<<<<<<<<
+ * (normal_start is None):
+ * start = raw.find(key2)
+ */
+ __pyx_t_3 = (__pyx_v_version == Py_None);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L4_bool_binop_done;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":147
+ * (version not in [1, 2]) or \
+ * (version is None) or \
+ * (normal_start is None): # <<<<<<<<<<<<<<
+ * start = raw.find(key2)
+ * key = key2
+ */
+ __pyx_t_2 = (__pyx_v_normal_start == Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_L4_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "fabio/ext/mar345_IO.pyx":148
+ * (version is None) or \
+ * (normal_start is None):
+ * start = raw.find(key2) # <<<<<<<<<<<<<<
+ * key = key2
+ * cversion = 2
+ */
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_raw, __pyx_n_s_find); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ }
+ }
+ if (!__pyx_t_6) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_key2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ } else {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_INCREF(__pyx_v_key2);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_key2);
+ __Pyx_GIVEREF(__pyx_v_key2);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_start = __pyx_t_4;
+ __pyx_t_4 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":149
+ * (normal_start is None):
+ * start = raw.find(key2)
+ * key = key2 # <<<<<<<<<<<<<<
+ * cversion = 2
+ * if start == -1:
+ */
+ __Pyx_INCREF(__pyx_v_key2);
+ __pyx_v_key = __pyx_v_key2;
+
+ /* "fabio/ext/mar345_IO.pyx":150
+ * start = raw.find(key2)
+ * key = key2
+ * cversion = 2 # <<<<<<<<<<<<<<
+ * if start == -1:
+ * start = raw.find(key1)
+ */
+ __pyx_v_cversion = 2;
+
+ /* "fabio/ext/mar345_IO.pyx":151
+ * key = key2
+ * cversion = 2
+ * if start == -1: # <<<<<<<<<<<<<<
+ * start = raw.find(key1)
+ * key = key1
+ */
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_start, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_1) {
+
+ /* "fabio/ext/mar345_IO.pyx":152
+ * cversion = 2
+ * if start == -1:
+ * start = raw.find(key1) # <<<<<<<<<<<<<<
+ * key = key1
+ * cversion = 1
+ */
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_raw, __pyx_n_s_find); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_7 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_7)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ }
+ }
+ if (!__pyx_t_7) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_key1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ } else {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __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 = NULL;
+ __Pyx_INCREF(__pyx_v_key1);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_key1);
+ __Pyx_GIVEREF(__pyx_v_key1);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":153
+ * if start == -1:
+ * start = raw.find(key1)
+ * key = key1 # <<<<<<<<<<<<<<
+ * cversion = 1
+ * lenkey = len(key)
+ */
+ __Pyx_INCREF(__pyx_v_key1);
+ __Pyx_DECREF_SET(__pyx_v_key, __pyx_v_key1);
+
+ /* "fabio/ext/mar345_IO.pyx":154
+ * start = raw.find(key1)
+ * key = key1
+ * cversion = 1 # <<<<<<<<<<<<<<
+ * lenkey = len(key)
+ * start = raw.index(key) + lenkey
+ */
+ __pyx_v_cversion = 1;
+ goto __pyx_L11;
+ }
+ __pyx_L11:;
+
+ /* "fabio/ext/mar345_IO.pyx":155
+ * key = key1
+ * cversion = 1
+ * lenkey = len(key) # <<<<<<<<<<<<<<
+ * start = raw.index(key) + lenkey
+ * sizes = raw[start:start + 13]
+ */
+ __pyx_t_8 = PyBytes_GET_SIZE(__pyx_v_key); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_lenkey = __pyx_t_8;
+
+ /* "fabio/ext/mar345_IO.pyx":156
+ * cversion = 1
+ * lenkey = len(key)
+ * start = raw.index(key) + lenkey # <<<<<<<<<<<<<<
+ * sizes = raw[start:start + 13]
+ * cdimx = < int > int(sizes[:4])
+ */
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_raw, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ }
+ }
+ if (!__pyx_t_6) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ } else {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_INCREF(__pyx_v_key);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_key);
+ __Pyx_GIVEREF(__pyx_v_key);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_lenkey); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __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_SET(__pyx_v_start, __pyx_t_7);
+ __pyx_t_7 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":157
+ * lenkey = len(key)
+ * start = raw.index(key) + lenkey
+ * sizes = raw[start:start + 13] # <<<<<<<<<<<<<<
+ * cdimx = < int > int(sizes[:4])
+ * cdimy = < int > int(sizes[-4:])
+ */
+ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_start); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyNumber_Add(__pyx_v_start, __pyx_int_13); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = PySequence_GetSlice(__pyx_v_raw, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_v_sizes = ((PyObject*)__pyx_t_7);
+ __pyx_t_7 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":158
+ * start = raw.index(key) + lenkey
+ * sizes = raw[start:start + 13]
+ * cdimx = < int > int(sizes[:4]) # <<<<<<<<<<<<<<
+ * cdimy = < int > int(sizes[-4:])
+ * normal_offset = start + 13
+ */
+ __pyx_t_7 = PySequence_GetSlice(__pyx_v_sizes, 0, 4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_5 = PyNumber_Int(__pyx_t_7); 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_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_cdimx = ((int)__pyx_t_10);
+
+ /* "fabio/ext/mar345_IO.pyx":159
+ * sizes = raw[start:start + 13]
+ * cdimx = < int > int(sizes[:4])
+ * cdimy = < int > int(sizes[-4:]) # <<<<<<<<<<<<<<
+ * normal_offset = start + 13
+ * else:
+ */
+ __pyx_t_5 = PySequence_GetSlice(__pyx_v_sizes, -4, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_7 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_v_cdimy = ((int)__pyx_t_10);
+
+ /* "fabio/ext/mar345_IO.pyx":160
+ * cdimx = < int > int(sizes[:4])
+ * cdimy = < int > int(sizes[-4:])
+ * normal_offset = start + 13 # <<<<<<<<<<<<<<
+ * else:
+ * cdimx = < int > dim1
+ */
+ __pyx_t_7 = PyNumber_Add(__pyx_v_start, __pyx_int_13); 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_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__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_v_normal_offset = __pyx_t_10;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":162
+ * normal_offset = start + 13
+ * else:
+ * cdimx = < int > dim1 # <<<<<<<<<<<<<<
+ * cdimy = < int > dim2
+ * cversion = <int> version
+ */
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_dim1); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_cdimx = ((int)__pyx_t_10);
+
+ /* "fabio/ext/mar345_IO.pyx":163
+ * else:
+ * cdimx = < int > dim1
+ * cdimy = < int > dim2 # <<<<<<<<<<<<<<
+ * cversion = <int> version
+ * normal_offset = <int> normal_start
+ */
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_dim2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_cdimy = ((int)__pyx_t_10);
+
+ /* "fabio/ext/mar345_IO.pyx":164
+ * cdimx = < int > dim1
+ * cdimy = < int > dim2
+ * cversion = <int> version # <<<<<<<<<<<<<<
+ * normal_offset = <int> normal_start
+ * if cversion == 1:
+ */
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_version); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_cversion = ((int)__pyx_t_10);
+
+ /* "fabio/ext/mar345_IO.pyx":165
+ * cdimy = < int > dim2
+ * cversion = <int> version
+ * normal_offset = <int> normal_start # <<<<<<<<<<<<<<
+ * if cversion == 1:
+ * lenkey = len(key1)
+ */
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_normal_start); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_normal_offset = ((int)__pyx_t_10);
+
+ /* "fabio/ext/mar345_IO.pyx":166
+ * cversion = <int> version
+ * normal_offset = <int> normal_start
+ * if cversion == 1: # <<<<<<<<<<<<<<
+ * lenkey = len(key1)
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_cversion == 1) != 0);
+ if (__pyx_t_1) {
+
+ /* "fabio/ext/mar345_IO.pyx":167
+ * normal_offset = <int> normal_start
+ * if cversion == 1:
+ * lenkey = len(key1) # <<<<<<<<<<<<<<
+ * else:
+ * lenkey = len(key2)
+ */
+ __pyx_t_9 = PyBytes_GET_SIZE(__pyx_v_key1); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_lenkey = __pyx_t_9;
+ goto __pyx_L12;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":169
+ * lenkey = len(key1)
+ * else:
+ * lenkey = len(key2) # <<<<<<<<<<<<<<
+ * if cversion not in [1, 2]:
+ * raise RuntimeError("Cannot determine the compression scheme for PCK compression (either version 1 or 2)")
+ */
+ __pyx_t_9 = PyBytes_GET_SIZE(__pyx_v_key2); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_lenkey = __pyx_t_9;
+ }
+ __pyx_L12:;
+ }
+ __pyx_L3:;
+
+ /* "fabio/ext/mar345_IO.pyx":170
+ * else:
+ * lenkey = len(key2)
+ * if cversion not in [1, 2]: # <<<<<<<<<<<<<<
+ * raise RuntimeError("Cannot determine the compression scheme for PCK compression (either version 1 or 2)")
+ * if (overflowPix is None) and (overflowPix is not False):
+ */
+ switch (__pyx_v_cversion) {
+ case 1:
+ case 2:
+ __pyx_t_1 = 0;
+ break;
+ default:
+ __pyx_t_1 = 1;
+ break;
+ }
+ __pyx_t_3 = (__pyx_t_1 != 0);
+ if (__pyx_t_3) {
+
+ /* "fabio/ext/mar345_IO.pyx":171
+ * lenkey = len(key2)
+ * if cversion not in [1, 2]:
+ * raise RuntimeError("Cannot determine the compression scheme for PCK compression (either version 1 or 2)") # <<<<<<<<<<<<<<
+ * if (overflowPix is None) and (overflowPix is not False):
+ * end = raw.find("END OF HEADER")
+ */
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_Raise(__pyx_t_7, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":172
+ * if cversion not in [1, 2]:
+ * raise RuntimeError("Cannot determine the compression scheme for PCK compression (either version 1 or 2)")
+ * if (overflowPix is None) and (overflowPix is not False): # <<<<<<<<<<<<<<
+ * end = raw.find("END OF HEADER")
+ * start = raw[:end].find("HIGH")
+ */
+ __pyx_t_1 = (__pyx_v_overflowPix == Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L15_bool_binop_done;
+ }
+ __pyx_t_2 = (__pyx_v_overflowPix != Py_False);
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ __pyx_t_3 = __pyx_t_1;
+ __pyx_L15_bool_binop_done:;
+ if (__pyx_t_3) {
+
+ /* "fabio/ext/mar345_IO.pyx":173
+ * raise RuntimeError("Cannot determine the compression scheme for PCK compression (either version 1 or 2)")
+ * if (overflowPix is None) and (overflowPix is not False):
+ * end = raw.find("END OF HEADER") # <<<<<<<<<<<<<<
+ * start = raw[:end].find("HIGH")
+ * hiLine = raw[start:end]
+ */
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_raw, __pyx_n_s_find); 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_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__6, NULL); 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_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF_SET(__pyx_v_end, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":174
+ * if (overflowPix is None) and (overflowPix is not False):
+ * end = raw.find("END OF HEADER")
+ * start = raw[:end].find("HIGH") # <<<<<<<<<<<<<<
+ * hiLine = raw[start:end]
+ * hiLine = hiLine.split("\n")[0]
+ */
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_end); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_GetSlice(__pyx_v_raw, 0, __pyx_t_9); 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 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_find); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__7, 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_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":175
+ * end = raw.find("END OF HEADER")
+ * start = raw[:end].find("HIGH")
+ * hiLine = raw[start:end] # <<<<<<<<<<<<<<
+ * hiLine = hiLine.split("\n")[0]
+ * word = hiLine.split()
+ */
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_start); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_end); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_GetSlice(__pyx_v_raw, __pyx_t_9, __pyx_t_8); 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_v_hiLine = __pyx_t_5;
+ __pyx_t_5 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":176
+ * start = raw[:end].find("HIGH")
+ * hiLine = raw[start:end]
+ * hiLine = hiLine.split("\n")[0] # <<<<<<<<<<<<<<
+ * word = hiLine.split()
+ * if len(word) > 1:
+ */
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_hiLine, __pyx_n_s_split); 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_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__9, NULL); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF_SET(__pyx_v_hiLine, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":177
+ * hiLine = raw[start:end]
+ * hiLine = hiLine.split("\n")[0]
+ * word = hiLine.split() # <<<<<<<<<<<<<<
+ * if len(word) > 1:
+ * chigh = int(word[1])
+ */
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_hiLine, __pyx_n_s_split); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ }
+ }
+ if (__pyx_t_4) {
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else {
+ __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_v_word = __pyx_t_5;
+ __pyx_t_5 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":178
+ * hiLine = hiLine.split("\n")[0]
+ * word = hiLine.split()
+ * if len(word) > 1: # <<<<<<<<<<<<<<
+ * chigh = int(word[1])
+ * else:
+ */
+ __pyx_t_8 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((__pyx_t_8 > 1) != 0);
+ if (__pyx_t_3) {
+
+ /* "fabio/ext/mar345_IO.pyx":179
+ * word = hiLine.split()
+ * if len(word) > 1:
+ * chigh = int(word[1]) # <<<<<<<<<<<<<<
+ * else:
+ * logger.warning("Error while looking for overflowed pixels in line %s", hiLine.strip())
+ */
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_word, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_7 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_v_chigh = __pyx_t_10;
+ goto __pyx_L17;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":181
+ * chigh = int(word[1])
+ * else:
+ * logger.warning("Error while looking for overflowed pixels in line %s", hiLine.strip()) # <<<<<<<<<<<<<<
+ * chigh = 0
+ * else:
+ */
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_warning); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_hiLine, __pyx_n_s_strip); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_11 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_11)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_11);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ }
+ }
+ if (__pyx_t_11) {
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ } else {
+ __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = NULL;
+ __pyx_t_8 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ __pyx_t_8 = 1;
+ }
+ }
+ __pyx_t_11 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ if (__pyx_t_6) {
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+ }
+ __Pyx_INCREF(__pyx_kp_s_Error_while_looking_for_overflow);
+ PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, __pyx_kp_s_Error_while_looking_for_overflow);
+ __Pyx_GIVEREF(__pyx_kp_s_Error_while_looking_for_overflow);
+ PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":182
+ * else:
+ * logger.warning("Error while looking for overflowed pixels in line %s", hiLine.strip())
+ * chigh = 0 # <<<<<<<<<<<<<<
+ * else:
+ * chigh = < int > overflowPix
+ */
+ __pyx_v_chigh = 0;
+ }
+ __pyx_L17:;
+ goto __pyx_L14;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":184
+ * chigh = 0
+ * else:
+ * chigh = < int > overflowPix # <<<<<<<<<<<<<<
+ *
+ * instream = numpy.fromstring(raw[normal_offset:].lstrip(), dtype=numpy.uint8)
+ */
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_overflowPix); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_chigh = ((int)__pyx_t_10);
+ }
+ __pyx_L14:;
+
+ /* "fabio/ext/mar345_IO.pyx":186
+ * chigh = < int > overflowPix
+ *
+ * instream = numpy.fromstring(raw[normal_offset:].lstrip(), dtype=numpy.uint8) # <<<<<<<<<<<<<<
+ *
+ * if use_CCP4:
+ */
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_11 = PySequence_GetSlice(__pyx_v_raw, __pyx_v_normal_offset, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_lstrip); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_11)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_11);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ }
+ }
+ if (__pyx_t_11) {
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_11); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ } else {
+ __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
+ __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 = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(__pyx_t_6);
+ if (unlikely(!__pyx_t_12.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_v_instream = __pyx_t_12;
+ __pyx_t_12.memview = NULL;
+ __pyx_t_12.data = NULL;
+
+ /* "fabio/ext/mar345_IO.pyx":188
+ * instream = numpy.fromstring(raw[normal_offset:].lstrip(), dtype=numpy.uint8)
+ *
+ * if use_CCP4: # <<<<<<<<<<<<<<
+ * data = numpy.empty((cdimy, cdimx), dtype=numpy.uint32)
+ * with nogil:
+ */
+ __pyx_t_3 = (__pyx_v_use_CCP4 != 0);
+ if (__pyx_t_3) {
+
+ /* "fabio/ext/mar345_IO.pyx":189
+ *
+ * if use_CCP4:
+ * data = numpy.empty((cdimy, cdimx), dtype=numpy.uint32) # <<<<<<<<<<<<<<
+ * with nogil:
+ * ################################################################################
+ */
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __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_cdimy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_cdimx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __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 = 189; __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);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_6 = 0;
+ __pyx_t_5 = 0;
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 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 = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_uint32_t(__pyx_t_11);
+ if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_v_data = __pyx_t_13;
+ __pyx_t_13.memview = NULL;
+ __pyx_t_13.data = NULL;
+
+ /* "fabio/ext/mar345_IO.pyx":190
+ * if use_CCP4:
+ * data = numpy.empty((cdimy, cdimx), dtype=numpy.uint32)
+ * with nogil: # <<<<<<<<<<<<<<
+ * ################################################################################
+ * # rely to whichever version of ccp4_unpack is appropriate
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":194
+ * # rely to whichever version of ccp4_unpack is appropriate
+ * ################################################################################
+ * if cversion == 1: # <<<<<<<<<<<<<<
+ * ccp4_unpack_string(&data[0, 0], &instream[0], cdimx, cdimy, 0)
+ * else:
+ */
+ __pyx_t_3 = ((__pyx_v_cversion == 1) != 0);
+ if (__pyx_t_3) {
+
+ /* "fabio/ext/mar345_IO.pyx":195
+ * ################################################################################
+ * if cversion == 1:
+ * ccp4_unpack_string(&data[0, 0], &instream[0], cdimx, cdimy, 0) # <<<<<<<<<<<<<<
+ * else:
+ * # cversion == 2:
+ */
+ __pyx_t_8 = 0;
+ __pyx_t_9 = 0;
+ if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_data.shape[0];
+ if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_data.shape[1];
+ __pyx_t_14 = 0;
+ if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_instream.shape[0];
+ ccp4_unpack_string((&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_data.data + __pyx_t_8 * __pyx_v_data.strides[0]) )) + __pyx_t_9)) )))), (&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint8_t *) __pyx_v_instream.data) + __pyx_t_14)) )))), __pyx_v_cdimx, __pyx_v_cdimy, 0);
+ goto __pyx_L22;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":198
+ * else:
+ * # cversion == 2:
+ * ccp4_unpack_v2_string(&data[0, 0], &instream[0], cdimx, cdimy, 0) # <<<<<<<<<<<<<<
+ * else:
+ * # There is a bug in the mar345 implementation which performs arithmetics
+ */
+ __pyx_t_15 = 0;
+ __pyx_t_16 = 0;
+ if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_data.shape[0];
+ if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_data.shape[1];
+ __pyx_t_17 = 0;
+ if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_instream.shape[0];
+ ccp4_unpack_v2_string((&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_data.data + __pyx_t_15 * __pyx_v_data.strides[0]) )) + __pyx_t_16)) )))), (&(*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint8_t *) __pyx_v_instream.data) + __pyx_t_17)) )))), __pyx_v_cdimx, __pyx_v_cdimy, 0);
+ }
+ __pyx_L22:;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":190
+ * if use_CCP4:
+ * data = numpy.empty((cdimy, cdimx), dtype=numpy.uint32)
+ * with nogil: # <<<<<<<<<<<<<<
+ * ################################################################################
+ * # rely to whichever version of ccp4_unpack is appropriate
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L21;
+ }
+ __pyx_L21:;
+ }
+ }
+ goto __pyx_L18;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":202
+ * # There is a bug in the mar345 implementation which performs arithmetics
+ * # of post-decompression in 16bits integers and overflows with large values
+ * unpacked = unpack_pck(instream, cdimx, cdimy).get1d() # <<<<<<<<<<<<<<
+ * data = numpy.ascontiguousarray(postdec(unpacked, cdimx), numpy.uint32).reshape((cdimy, cdimx))
+ *
+ */
+ __pyx_t_11 = ((PyObject *)__pyx_f_5fabio_3ext_9mar345_IO_unpack_pck(__pyx_v_instream, __pyx_v_cdimx, __pyx_v_cdimy, 0)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_18 = ((struct __pyx_vtabstruct_5fabio_3ext_9mar345_IO_UnpackContainer *)((struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *)__pyx_t_11)->__pyx_vtab)->get1d(((struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *)__pyx_t_11), 0); if (unlikely(!__pyx_t_18.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_v_unpacked = __pyx_t_18;
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+
+ /* "fabio/ext/mar345_IO.pyx":203
+ * # of post-decompression in 16bits integers and overflows with large values
+ * unpacked = unpack_pck(instream, cdimx, cdimy).get1d()
+ * data = numpy.ascontiguousarray(postdec(unpacked, cdimx), numpy.uint32).reshape((cdimy, cdimx)) # <<<<<<<<<<<<<<
+ *
+ * if chigh > 0:
+ */
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_19 = __pyx_f_5fabio_3ext_9mar345_IO_postdec(__pyx_v_unpacked, __pyx_v_cdimx, 0); if (unlikely(!__pyx_t_19.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_t_19, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint32_t, 0);; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_20);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = NULL;
+ __pyx_t_21 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ __pyx_t_21 = 1;
+ }
+ }
+ __pyx_t_22 = PyTuple_New(2+__pyx_t_21); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_22);
+ if (__pyx_t_6) {
+ PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+ }
+ PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_21, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_21, __pyx_t_20);
+ __Pyx_GIVEREF(__pyx_t_20);
+ __pyx_t_5 = 0;
+ __pyx_t_20 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_22, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_reshape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_cdimy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_cdimx); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_22);
+ __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_20);
+ PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_22);
+ __Pyx_GIVEREF(__pyx_t_22);
+ __pyx_t_4 = 0;
+ __pyx_t_22 = 0;
+ __pyx_t_22 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_22)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_22);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ }
+ }
+ if (!__pyx_t_22) {
+ __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_20); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
+ __Pyx_GOTREF(__pyx_t_11);
+ } else {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_22); __Pyx_GIVEREF(__pyx_t_22); __pyx_t_22 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_20);
+ __Pyx_GIVEREF(__pyx_t_20);
+ __pyx_t_20 = 0;
+ __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_uint32_t(__pyx_t_11);
+ if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_v_data = __pyx_t_13;
+ __pyx_t_13.memview = NULL;
+ __pyx_t_13.data = NULL;
+ }
+ __pyx_L18:;
+
+ /* "fabio/ext/mar345_IO.pyx":205
+ * data = numpy.ascontiguousarray(postdec(unpacked, cdimx), numpy.uint32).reshape((cdimy, cdimx))
+ *
+ * if chigh > 0: # <<<<<<<<<<<<<<
+ * ################################################################################
+ * # handle overflows: Each record is 8 overflow of 2x32bits integers
+ */
+ __pyx_t_3 = ((__pyx_v_chigh > 0) != 0);
+ if (__pyx_t_3) {
+
+ /* "fabio/ext/mar345_IO.pyx":209
+ * # handle overflows: Each record is 8 overflow of 2x32bits integers
+ * ################################################################################
+ * records = (chigh + PACK_SIZE_HIGH - 1) // PACK_SIZE_HIGH # <<<<<<<<<<<<<<
+ * stop = normal_offset - lenkey - 14
+ * odata = numpy.fromstring(raw[stop - 64 * records: stop], dtype=numpy.int32)
+ */
+ __pyx_v_records = (((__pyx_v_chigh + __pyx_v_5fabio_3ext_9mar345_IO_PACK_SIZE_HIGH) - 1) / __pyx_v_5fabio_3ext_9mar345_IO_PACK_SIZE_HIGH);
+
+ /* "fabio/ext/mar345_IO.pyx":210
+ * ################################################################################
+ * records = (chigh + PACK_SIZE_HIGH - 1) // PACK_SIZE_HIGH
+ * stop = normal_offset - lenkey - 14 # <<<<<<<<<<<<<<
+ * odata = numpy.fromstring(raw[stop - 64 * records: stop], dtype=numpy.int32)
+ * if swap_needed:
+ */
+ __pyx_v_stop = ((__pyx_v_normal_offset - __pyx_v_lenkey) - 14);
+
+ /* "fabio/ext/mar345_IO.pyx":211
+ * records = (chigh + PACK_SIZE_HIGH - 1) // PACK_SIZE_HIGH
+ * stop = normal_offset - lenkey - 14
+ * odata = numpy.fromstring(raw[stop - 64 * records: stop], dtype=numpy.int32) # <<<<<<<<<<<<<<
+ * if swap_needed:
+ * odata.byteswap(True)
+ */
+ __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = PySequence_GetSlice(__pyx_v_raw, (__pyx_v_stop - (64 * __pyx_v_records)), __pyx_v_stop); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __pyx_t_11 = 0;
+ __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_20);
+ __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_int32); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_22);
+ __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
+ if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_t_22) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
+ __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_11); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_22);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_v_odata = __pyx_t_22;
+ __pyx_t_22 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":212
+ * stop = normal_offset - lenkey - 14
+ * odata = numpy.fromstring(raw[stop - 64 * records: stop], dtype=numpy.int32)
+ * if swap_needed: # <<<<<<<<<<<<<<
+ * odata.byteswap(True)
+ * overflow_data = odata.reshape((-1, 2))
+ */
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_swap_needed); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_3) {
+
+ /* "fabio/ext/mar345_IO.pyx":213
+ * odata = numpy.fromstring(raw[stop - 64 * records: stop], dtype=numpy.int32)
+ * if swap_needed:
+ * odata.byteswap(True) # <<<<<<<<<<<<<<
+ * overflow_data = odata.reshape((-1, 2))
+ * for i in range(overflow_data.shape[0]):
+ */
+ __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_v_odata, __pyx_n_s_byteswap); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_22);
+ __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ goto __pyx_L24;
+ }
+ __pyx_L24:;
+
+ /* "fabio/ext/mar345_IO.pyx":214
+ * if swap_needed:
+ * odata.byteswap(True)
+ * overflow_data = odata.reshape((-1, 2)) # <<<<<<<<<<<<<<
+ * for i in range(overflow_data.shape[0]):
+ * idx = overflow_data[i, 0] - 1 # indexes are even values (-1 because 1 based counting)
+ */
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_odata, __pyx_n_s_reshape); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_22);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int32_t(__pyx_t_22);
+ if (unlikely(!__pyx_t_23.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
+ __pyx_v_overflow_data = __pyx_t_23;
+ __pyx_t_23.memview = NULL;
+ __pyx_t_23.data = NULL;
+
+ /* "fabio/ext/mar345_IO.pyx":215
+ * odata.byteswap(True)
+ * overflow_data = odata.reshape((-1, 2))
+ * for i in range(overflow_data.shape[0]): # <<<<<<<<<<<<<<
+ * idx = overflow_data[i, 0] - 1 # indexes are even values (-1 because 1 based counting)
+ * value = overflow_data[i, 1] # values are odd values
+ */
+ __pyx_t_21 = (__pyx_v_overflow_data.shape[0]);
+ for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_21; __pyx_t_10+=1) {
+ __pyx_v_i = __pyx_t_10;
+
+ /* "fabio/ext/mar345_IO.pyx":216
+ * overflow_data = odata.reshape((-1, 2))
+ * for i in range(overflow_data.shape[0]):
+ * idx = overflow_data[i, 0] - 1 # indexes are even values (-1 because 1 based counting) # <<<<<<<<<<<<<<
+ * value = overflow_data[i, 1] # values are odd values
+ * if (idx >= 0) and (idx < cdimx * cdimy):
+ */
+ __pyx_t_24 = __pyx_v_i;
+ __pyx_t_25 = 0;
+ if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_overflow_data.shape[0];
+ if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_overflow_data.shape[1];
+ __pyx_v_idx = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_overflow_data.data + __pyx_t_24 * __pyx_v_overflow_data.strides[0]) )) + __pyx_t_25)) ))) - 1);
+
+ /* "fabio/ext/mar345_IO.pyx":217
+ * for i in range(overflow_data.shape[0]):
+ * idx = overflow_data[i, 0] - 1 # indexes are even values (-1 because 1 based counting)
+ * value = overflow_data[i, 1] # values are odd values # <<<<<<<<<<<<<<
+ * if (idx >= 0) and (idx < cdimx * cdimy):
+ * data[idx // cdimx, idx % cdimx] = <cnp.uint32_t> value
+ */
+ __pyx_t_26 = __pyx_v_i;
+ __pyx_t_27 = 1;
+ if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_overflow_data.shape[0];
+ if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_v_overflow_data.shape[1];
+ __pyx_v_value = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_overflow_data.data + __pyx_t_26 * __pyx_v_overflow_data.strides[0]) )) + __pyx_t_27)) )));
+
+ /* "fabio/ext/mar345_IO.pyx":218
+ * idx = overflow_data[i, 0] - 1 # indexes are even values (-1 because 1 based counting)
+ * value = overflow_data[i, 1] # values are odd values
+ * if (idx >= 0) and (idx < cdimx * cdimy): # <<<<<<<<<<<<<<
+ * data[idx // cdimx, idx % cdimx] = <cnp.uint32_t> value
+ * return numpy.asarray(data)
+ */
+ __pyx_t_1 = ((__pyx_v_idx >= 0) != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_3 = __pyx_t_1;
+ goto __pyx_L28_bool_binop_done;
+ }
+ __pyx_t_1 = ((__pyx_v_idx < (__pyx_v_cdimx * __pyx_v_cdimy)) != 0);
+ __pyx_t_3 = __pyx_t_1;
+ __pyx_L28_bool_binop_done:;
+ if (__pyx_t_3) {
+
+ /* "fabio/ext/mar345_IO.pyx":219
+ * value = overflow_data[i, 1] # values are odd values
+ * if (idx >= 0) and (idx < cdimx * cdimy):
+ * data[idx // cdimx, idx % cdimx] = <cnp.uint32_t> value # <<<<<<<<<<<<<<
+ * return numpy.asarray(data)
+ *
+ */
+ __pyx_t_28 = (__pyx_v_idx / __pyx_v_cdimx);
+ __pyx_t_29 = (__pyx_v_idx % __pyx_v_cdimx);
+ if (__pyx_t_28 < 0) __pyx_t_28 += __pyx_v_data.shape[0];
+ if (__pyx_t_29 < 0) __pyx_t_29 += __pyx_v_data.shape[1];
+ *((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_data.data + __pyx_t_28 * __pyx_v_data.strides[0]) )) + __pyx_t_29)) )) = ((__pyx_t_5numpy_uint32_t)__pyx_v_value);
+ goto __pyx_L27;
+ }
+ __pyx_L27:;
+ }
+ goto __pyx_L23;
+ }
+ __pyx_L23:;
+
+ /* "fabio/ext/mar345_IO.pyx":220
+ * if (idx >= 0) and (idx < cdimx * cdimy):
+ * data[idx // cdimx, idx % cdimx] = <cnp.uint32_t> value
+ * return numpy.asarray(data) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = __pyx_memoryview_fromslice(__pyx_v_data, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint32_t, 0);; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_7 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_7)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ if (!__pyx_t_7) {
+ __pyx_t_22 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_11); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_GOTREF(__pyx_t_22);
+ } else {
+ __pyx_t_20 = PyTuple_New(1+1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_20);
+ PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_20, 0+1, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __pyx_t_11 = 0;
+ __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_20, NULL); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_22);
+ __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_22;
+ __pyx_t_22 = 0;
+ goto __pyx_L0;
+
+ /* "fabio/ext/mar345_IO.pyx":121
+ * @cython.boundscheck(False)
+ * @cython.cdivision(True)
+ * def uncompress_pck(bytes raw not None, dim1=None, dim2=None, overflowPix=None, version=None, normal_start=None, swap_needed=None, bint use_CCP4=False): # <<<<<<<<<<<<<<
+ * """
+ * Unpack a mar345 compressed image
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_11);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __Pyx_XDECREF(__pyx_t_20);
+ __Pyx_XDECREF(__pyx_t_22);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.uncompress_pck", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_instream, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_unpacked, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_overflow_data, 1);
+ __Pyx_XDECREF(__pyx_v_end);
+ __Pyx_XDECREF(__pyx_v_key1);
+ __Pyx_XDECREF(__pyx_v_key2);
+ __Pyx_XDECREF(__pyx_v_start);
+ __Pyx_XDECREF(__pyx_v_key);
+ __Pyx_XDECREF(__pyx_v_sizes);
+ __Pyx_XDECREF(__pyx_v_hiLine);
+ __Pyx_XDECREF(__pyx_v_word);
+ __Pyx_XDECREF(__pyx_v_odata);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":231
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef inline cnp.int32_t[::1] precomp(cnp.int16_t[::1] img, cnp.uint32_t width): # <<<<<<<<<<<<<<
+ * """Pre-compression by subtracting the average value of the four neighbours
+ *
+ */
+
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_5precomp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static CYTHON_INLINE __Pyx_memviewslice __pyx_f_5fabio_3ext_9mar345_IO_precomp(__Pyx_memviewslice __pyx_v_img, __pyx_t_5numpy_uint32_t __pyx_v_width, CYTHON_UNUSED int __pyx_skip_dispatch) {
+ __pyx_t_5numpy_uint32_t __pyx_v_size;
+ __pyx_t_5numpy_uint32_t __pyx_v_i;
+ __Pyx_memviewslice __pyx_v_comp = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __pyx_t_5numpy_int16_t __pyx_v_last;
+ __pyx_t_5numpy_int16_t __pyx_v_cur;
+ __pyx_t_5numpy_int16_t __pyx_v_im0;
+ __pyx_t_5numpy_int16_t __pyx_v_im1;
+ __pyx_t_5numpy_int16_t __pyx_v_im2;
+ __Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ __pyx_t_5numpy_uint32_t __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ Py_ssize_t __pyx_t_8;
+ __pyx_t_5numpy_int16_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
+ long __pyx_t_13;
+ __pyx_t_5numpy_uint32_t __pyx_t_14;
+ __pyx_t_5numpy_uint32_t __pyx_t_15;
+ __pyx_t_5numpy_uint32_t __pyx_t_16;
+ __pyx_t_5numpy_uint32_t __pyx_t_17;
+ __pyx_t_5numpy_uint32_t __pyx_t_18;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("precomp", 0);
+
+ /* "fabio/ext/mar345_IO.pyx":254
+ * cnp.int32_t[::1] comp
+ * cnp.int16_t last, cur, im0, im1, im2
+ * size = img.size # <<<<<<<<<<<<<<
+ * comp = numpy.zeros(size, dtype=numpy.int32)
+ *
+ */
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_img, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = __Pyx_PyInt_As_npy_uint32(__pyx_t_2); if (unlikely((__pyx_t_3 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_size = __pyx_t_3;
+
+ /* "fabio/ext/mar345_IO.pyx":255
+ * cnp.int16_t last, cur, im0, im1, im2
+ * size = img.size
+ * comp = numpy.zeros(size, dtype=numpy.int32) # <<<<<<<<<<<<<<
+ *
+ * with nogil:
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_npy_uint32(__pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __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 = 255; __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_t_2 = 0;
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(__pyx_t_6);
+ if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_v_comp = __pyx_t_7;
+ __pyx_t_7.memview = NULL;
+ __pyx_t_7.data = NULL;
+
+ /* "fabio/ext/mar345_IO.pyx":257
+ * comp = numpy.zeros(size, dtype=numpy.int32)
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * # First pixel
+ * comp[0] = last = im0 = img[0]
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":259
+ * with nogil:
+ * # First pixel
+ * comp[0] = last = im0 = img[0] # <<<<<<<<<<<<<<
+ * im1 = img[1]
+ * im2 = img[2]
+ */
+ __pyx_t_8 = 0;
+ __pyx_t_9 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int16_t *) __pyx_v_img.data) + __pyx_t_8)) )));
+ __pyx_t_10 = 0;
+ *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_comp.data) + __pyx_t_10)) )) = __pyx_t_9;
+ __pyx_v_last = __pyx_t_9;
+ __pyx_v_im0 = __pyx_t_9;
+
+ /* "fabio/ext/mar345_IO.pyx":260
+ * # First pixel
+ * comp[0] = last = im0 = img[0]
+ * im1 = img[1] # <<<<<<<<<<<<<<
+ * im2 = img[2]
+ *
+ */
+ __pyx_t_11 = 1;
+ __pyx_v_im1 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int16_t *) __pyx_v_img.data) + __pyx_t_11)) )));
+
+ /* "fabio/ext/mar345_IO.pyx":261
+ * comp[0] = last = im0 = img[0]
+ * im1 = img[1]
+ * im2 = img[2] # <<<<<<<<<<<<<<
+ *
+ * # First line (+ 1 pixel)
+ */
+ __pyx_t_12 = 2;
+ __pyx_v_im2 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int16_t *) __pyx_v_img.data) + __pyx_t_12)) )));
+
+ /* "fabio/ext/mar345_IO.pyx":264
+ *
+ * # First line (+ 1 pixel)
+ * for i in range(1, width + 1): # <<<<<<<<<<<<<<
+ * cur = img[i]
+ * comp[i] = cur - last
+ */
+ __pyx_t_13 = (__pyx_v_width + 1);
+ for (__pyx_t_3 = 1; __pyx_t_3 < __pyx_t_13; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "fabio/ext/mar345_IO.pyx":265
+ * # First line (+ 1 pixel)
+ * for i in range(1, width + 1):
+ * cur = img[i] # <<<<<<<<<<<<<<
+ * comp[i] = cur - last
+ * last = cur
+ */
+ __pyx_t_14 = __pyx_v_i;
+ __pyx_v_cur = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int16_t *) __pyx_v_img.data) + __pyx_t_14)) )));
+
+ /* "fabio/ext/mar345_IO.pyx":266
+ * for i in range(1, width + 1):
+ * cur = img[i]
+ * comp[i] = cur - last # <<<<<<<<<<<<<<
+ * last = cur
+ *
+ */
+ __pyx_t_15 = __pyx_v_i;
+ *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_comp.data) + __pyx_t_15)) )) = (__pyx_v_cur - __pyx_v_last);
+
+ /* "fabio/ext/mar345_IO.pyx":267
+ * cur = img[i]
+ * comp[i] = cur - last
+ * last = cur # <<<<<<<<<<<<<<
+ *
+ * # Rest of the image
+ */
+ __pyx_v_last = __pyx_v_cur;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":270
+ *
+ * # Rest of the image
+ * for i in range(width + 1, size): # <<<<<<<<<<<<<<
+ * cur = img[i]
+ * comp[i] = <cnp.int16_t> (cur - (last + im0 + im1 + im2 + 2) // 4)
+ */
+ __pyx_t_3 = __pyx_v_size;
+ for (__pyx_t_16 = (__pyx_v_width + 1); __pyx_t_16 < __pyx_t_3; __pyx_t_16+=1) {
+ __pyx_v_i = __pyx_t_16;
+
+ /* "fabio/ext/mar345_IO.pyx":271
+ * # Rest of the image
+ * for i in range(width + 1, size):
+ * cur = img[i] # <<<<<<<<<<<<<<
+ * comp[i] = <cnp.int16_t> (cur - (last + im0 + im1 + im2 + 2) // 4)
+ * last = cur
+ */
+ __pyx_t_17 = __pyx_v_i;
+ __pyx_v_cur = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int16_t *) __pyx_v_img.data) + __pyx_t_17)) )));
+
+ /* "fabio/ext/mar345_IO.pyx":272
+ * for i in range(width + 1, size):
+ * cur = img[i]
+ * comp[i] = <cnp.int16_t> (cur - (last + im0 + im1 + im2 + 2) // 4) # <<<<<<<<<<<<<<
+ * last = cur
+ * im0 = im1
+ */
+ __pyx_t_18 = __pyx_v_i;
+ *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_comp.data) + __pyx_t_18)) )) = ((__pyx_t_5numpy_int16_t)(__pyx_v_cur - (((((__pyx_v_last + __pyx_v_im0) + __pyx_v_im1) + __pyx_v_im2) + 2) / 4)));
+
+ /* "fabio/ext/mar345_IO.pyx":273
+ * cur = img[i]
+ * comp[i] = <cnp.int16_t> (cur - (last + im0 + im1 + im2 + 2) // 4)
+ * last = cur # <<<<<<<<<<<<<<
+ * im0 = im1
+ * im1 = im2
+ */
+ __pyx_v_last = __pyx_v_cur;
+
+ /* "fabio/ext/mar345_IO.pyx":274
+ * comp[i] = <cnp.int16_t> (cur - (last + im0 + im1 + im2 + 2) // 4)
+ * last = cur
+ * im0 = im1 # <<<<<<<<<<<<<<
+ * im1 = im2
+ * im2 = img[i - width + 2]
+ */
+ __pyx_v_im0 = __pyx_v_im1;
+
+ /* "fabio/ext/mar345_IO.pyx":275
+ * last = cur
+ * im0 = im1
+ * im1 = im2 # <<<<<<<<<<<<<<
+ * im2 = img[i - width + 2]
+ *
+ */
+ __pyx_v_im1 = __pyx_v_im2;
+
+ /* "fabio/ext/mar345_IO.pyx":276
+ * im0 = im1
+ * im1 = im2
+ * im2 = img[i - width + 2] # <<<<<<<<<<<<<<
+ *
+ * return comp
+ */
+ __pyx_t_13 = ((__pyx_v_i - __pyx_v_width) + 2);
+ __pyx_v_im2 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int16_t *) __pyx_v_img.data) + __pyx_t_13)) )));
+ }
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":257
+ * comp = numpy.zeros(size, dtype=numpy.int32)
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * # First pixel
+ * comp[0] = last = im0 = img[0]
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":278
+ * im2 = img[i - width + 2]
+ *
+ * return comp # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __PYX_INC_MEMVIEW(&__pyx_v_comp, 0);
+ __pyx_r = __pyx_v_comp;
+ goto __pyx_L0;
+
+ /* "fabio/ext/mar345_IO.pyx":231
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef inline cnp.int32_t[::1] precomp(cnp.int16_t[::1] img, cnp.uint32_t width): # <<<<<<<<<<<<<<
+ * """Pre-compression by subtracting the average value of the four neighbours
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
+ __pyx_r.data = NULL;
+ __pyx_r.memview = NULL;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.precomp", __pyx_clineno, __pyx_lineno, __pyx_filename);
+
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (unlikely(!__pyx_r.memview)) {
+ PyErr_SetString(PyExc_TypeError,"Memoryview return value is not initialized");
+ }
+ __pyx_L2:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_comp, 1);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_5precomp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_5fabio_3ext_9mar345_IO_4precomp[] = "Pre-compression by subtracting the average value of the four neighbours\n\n Actually it looks a bit more complicated:\n\n * there comes the +2 from ?\n * the first element remains untouched\n * elements of the first line (+ first of second) use only former element\n\n\n JPA, the original author wrote:\n Compression is achieved by first calculating the differences between every\n pixel and the truncated value of four of its neighbours. For example:\n the difference for a pixel at img[x, y] is:\n\n comp[y, x] = img[y, x] - (img[y-1, x-1] + img[y-1, x] + img[y-1, x+1] + img[y, x-1]) / 4\n\n This part implements overlows of int16 as the reference implementation is buggy\n ";
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_5precomp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ __Pyx_memviewslice __pyx_v_img = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __pyx_t_5numpy_uint32_t __pyx_v_width;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("precomp (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_img,&__pyx_n_s_width,0};
+ PyObject* values[2] = {0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_img)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("precomp", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "precomp") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ }
+ __pyx_v_img = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_img.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_width = __Pyx_PyInt_As_npy_uint32(values[1]); if (unlikely((__pyx_v_width == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("precomp", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.precomp", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_4precomp(__pyx_self, __pyx_v_img, __pyx_v_width);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_4precomp(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_img, __pyx_t_5numpy_uint32_t __pyx_v_width) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("precomp", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_5fabio_3ext_9mar345_IO_precomp(__pyx_v_img, __pyx_v_width, 0); if (unlikely(!__pyx_t_1.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_t_1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.precomp", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_img, 1);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":285
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef inline cnp.uint32_t[::1] postdec(cnp.int32_t[::1] comp, int width): # <<<<<<<<<<<<<<
+ * """Post decompression by adding the average value of the four neighbours
+ *
+ */
+
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_7postdec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static CYTHON_INLINE __Pyx_memviewslice __pyx_f_5fabio_3ext_9mar345_IO_postdec(__Pyx_memviewslice __pyx_v_comp, int __pyx_v_width, CYTHON_UNUSED int __pyx_skip_dispatch) {
+ __pyx_t_5numpy_uint32_t __pyx_v_size;
+ __pyx_t_5numpy_uint32_t __pyx_v_i;
+ __Pyx_memviewslice __pyx_v_img = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __pyx_t_5numpy_int16_t __pyx_v_last;
+ __pyx_t_5numpy_int16_t __pyx_v_cur;
+ __pyx_t_5numpy_int16_t __pyx_v_fl0;
+ __pyx_t_5numpy_int16_t __pyx_v_fl1;
+ __pyx_t_5numpy_int16_t __pyx_v_fl2;
+ __Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ __pyx_t_5numpy_uint32_t __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ long __pyx_t_10;
+ __pyx_t_5numpy_uint32_t __pyx_t_11;
+ int __pyx_t_12;
+ __pyx_t_5numpy_uint32_t __pyx_t_13;
+ Py_ssize_t __pyx_t_14;
+ Py_ssize_t __pyx_t_15;
+ Py_ssize_t __pyx_t_16;
+ __pyx_t_5numpy_uint32_t __pyx_t_17;
+ __pyx_t_5numpy_uint32_t __pyx_t_18;
+ __pyx_t_5numpy_uint32_t __pyx_t_19;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("postdec", 0);
+
+ /* "fabio/ext/mar345_IO.pyx":307
+ * cnp.uint32_t[::1] img
+ * cnp.int16_t last, cur, fl0, fl1, fl2
+ * size = comp.size # <<<<<<<<<<<<<<
+ *
+ * img = numpy.zeros(size, dtype=numpy.uint32)
+ */
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_comp, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = __Pyx_PyInt_As_npy_uint32(__pyx_t_2); if (unlikely((__pyx_t_3 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_size = __pyx_t_3;
+
+ /* "fabio/ext/mar345_IO.pyx":309
+ * size = comp.size
+ *
+ * img = numpy.zeros(size, dtype=numpy.uint32) # <<<<<<<<<<<<<<
+ *
+ * with nogil:
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_npy_uint32(__pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __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 = 309; __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_t_2 = 0;
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __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, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint32_t(__pyx_t_6);
+ if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_v_img = __pyx_t_7;
+ __pyx_t_7.memview = NULL;
+ __pyx_t_7.data = NULL;
+
+ /* "fabio/ext/mar345_IO.pyx":311
+ * img = numpy.zeros(size, dtype=numpy.uint32)
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ *
+ * # First pixel
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":314
+ *
+ * # First pixel
+ * last = comp[0] # <<<<<<<<<<<<<<
+ * img[0] = last
+ *
+ */
+ __pyx_t_8 = 0;
+ __pyx_v_last = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_comp.data) + __pyx_t_8)) )));
+
+ /* "fabio/ext/mar345_IO.pyx":315
+ * # First pixel
+ * last = comp[0]
+ * img[0] = last # <<<<<<<<<<<<<<
+ *
+ * # First line (+ 1 pixel)
+ */
+ __pyx_t_9 = 0;
+ *((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint32_t *) __pyx_v_img.data) + __pyx_t_9)) )) = __pyx_v_last;
+
+ /* "fabio/ext/mar345_IO.pyx":318
+ *
+ * # First line (+ 1 pixel)
+ * for i in range(1, width + 1): # <<<<<<<<<<<<<<
+ * img[i] = cur = comp[i] + last
+ * last = cur
+ */
+ __pyx_t_10 = (__pyx_v_width + 1);
+ for (__pyx_t_3 = 1; __pyx_t_3 < __pyx_t_10; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "fabio/ext/mar345_IO.pyx":319
+ * # First line (+ 1 pixel)
+ * for i in range(1, width + 1):
+ * img[i] = cur = comp[i] + last # <<<<<<<<<<<<<<
+ * last = cur
+ *
+ */
+ __pyx_t_11 = __pyx_v_i;
+ __pyx_t_12 = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_comp.data) + __pyx_t_11)) ))) + __pyx_v_last);
+ __pyx_t_13 = __pyx_v_i;
+ *((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint32_t *) __pyx_v_img.data) + __pyx_t_13)) )) = __pyx_t_12;
+ __pyx_v_cur = __pyx_t_12;
+
+ /* "fabio/ext/mar345_IO.pyx":320
+ * for i in range(1, width + 1):
+ * img[i] = cur = comp[i] + last
+ * last = cur # <<<<<<<<<<<<<<
+ *
+ * # Rest of the image: not parallel in this case
+ */
+ __pyx_v_last = __pyx_v_cur;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":323
+ *
+ * # Rest of the image: not parallel in this case
+ * fl0 = img[0] # <<<<<<<<<<<<<<
+ * fl1 = img[1]
+ * fl2 = img[2]
+ */
+ __pyx_t_14 = 0;
+ __pyx_v_fl0 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint32_t *) __pyx_v_img.data) + __pyx_t_14)) )));
+
+ /* "fabio/ext/mar345_IO.pyx":324
+ * # Rest of the image: not parallel in this case
+ * fl0 = img[0]
+ * fl1 = img[1] # <<<<<<<<<<<<<<
+ * fl2 = img[2]
+ * for i in range(width + 1, size):
+ */
+ __pyx_t_15 = 1;
+ __pyx_v_fl1 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint32_t *) __pyx_v_img.data) + __pyx_t_15)) )));
+
+ /* "fabio/ext/mar345_IO.pyx":325
+ * fl0 = img[0]
+ * fl1 = img[1]
+ * fl2 = img[2] # <<<<<<<<<<<<<<
+ * for i in range(width + 1, size):
+ * # overflow expected here.
+ */
+ __pyx_t_16 = 2;
+ __pyx_v_fl2 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint32_t *) __pyx_v_img.data) + __pyx_t_16)) )));
+
+ /* "fabio/ext/mar345_IO.pyx":326
+ * fl1 = img[1]
+ * fl2 = img[2]
+ * for i in range(width + 1, size): # <<<<<<<<<<<<<<
+ * # overflow expected here.
+ * cur = comp[i] + (last + fl0 + fl1 + fl2 + 2) // 4
+ */
+ __pyx_t_3 = __pyx_v_size;
+ for (__pyx_t_17 = (__pyx_v_width + 1); __pyx_t_17 < __pyx_t_3; __pyx_t_17+=1) {
+ __pyx_v_i = __pyx_t_17;
+
+ /* "fabio/ext/mar345_IO.pyx":328
+ * for i in range(width + 1, size):
+ * # overflow expected here.
+ * cur = comp[i] + (last + fl0 + fl1 + fl2 + 2) // 4 # <<<<<<<<<<<<<<
+ * # ensures the data is cropped at 16 bits!
+ * img[i] = <cnp.uint16_t> cur
+ */
+ __pyx_t_18 = __pyx_v_i;
+ __pyx_v_cur = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_comp.data) + __pyx_t_18)) ))) + (((((__pyx_v_last + __pyx_v_fl0) + __pyx_v_fl1) + __pyx_v_fl2) + 2) / 4));
+
+ /* "fabio/ext/mar345_IO.pyx":330
+ * cur = comp[i] + (last + fl0 + fl1 + fl2 + 2) // 4
+ * # ensures the data is cropped at 16 bits!
+ * img[i] = <cnp.uint16_t> cur # <<<<<<<<<<<<<<
+ * last = cur
+ * fl0 = fl1
+ */
+ __pyx_t_19 = __pyx_v_i;
+ *((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint32_t *) __pyx_v_img.data) + __pyx_t_19)) )) = ((__pyx_t_5numpy_uint16_t)__pyx_v_cur);
+
+ /* "fabio/ext/mar345_IO.pyx":331
+ * # ensures the data is cropped at 16 bits!
+ * img[i] = <cnp.uint16_t> cur
+ * last = cur # <<<<<<<<<<<<<<
+ * fl0 = fl1
+ * fl1 = fl2
+ */
+ __pyx_v_last = __pyx_v_cur;
+
+ /* "fabio/ext/mar345_IO.pyx":332
+ * img[i] = <cnp.uint16_t> cur
+ * last = cur
+ * fl0 = fl1 # <<<<<<<<<<<<<<
+ * fl1 = fl2
+ * fl2 = img[i - width + 2]
+ */
+ __pyx_v_fl0 = __pyx_v_fl1;
+
+ /* "fabio/ext/mar345_IO.pyx":333
+ * last = cur
+ * fl0 = fl1
+ * fl1 = fl2 # <<<<<<<<<<<<<<
+ * fl2 = img[i - width + 2]
+ *
+ */
+ __pyx_v_fl1 = __pyx_v_fl2;
+
+ /* "fabio/ext/mar345_IO.pyx":334
+ * fl0 = fl1
+ * fl1 = fl2
+ * fl2 = img[i - width + 2] # <<<<<<<<<<<<<<
+ *
+ * return img
+ */
+ __pyx_t_10 = ((__pyx_v_i - __pyx_v_width) + 2);
+ __pyx_v_fl2 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint32_t *) __pyx_v_img.data) + __pyx_t_10)) )));
+ }
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":311
+ * img = numpy.zeros(size, dtype=numpy.uint32)
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ *
+ * # First pixel
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":336
+ * fl2 = img[i - width + 2]
+ *
+ * return img # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __PYX_INC_MEMVIEW(&__pyx_v_img, 0);
+ __pyx_r = __pyx_v_img;
+ goto __pyx_L0;
+
+ /* "fabio/ext/mar345_IO.pyx":285
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef inline cnp.uint32_t[::1] postdec(cnp.int32_t[::1] comp, int width): # <<<<<<<<<<<<<<
+ * """Post decompression by adding the average value of the four neighbours
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
+ __pyx_r.data = NULL;
+ __pyx_r.memview = NULL;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.postdec", __pyx_clineno, __pyx_lineno, __pyx_filename);
+
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (unlikely(!__pyx_r.memview)) {
+ PyErr_SetString(PyExc_TypeError,"Memoryview return value is not initialized");
+ }
+ __pyx_L2:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_img, 1);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_7postdec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_5fabio_3ext_9mar345_IO_6postdec[] = "Post decompression by adding the average value of the four neighbours\n\n Actually it looks a bit more complicated:\n\n * there comes the +2 from ?\n * the first element remains untouched\n * elements of the first line (+ fist of second) use only former element\n\n JPA, the original author wrote:\n Compression is achieved by first calculating the differences between every\n pixel and the truncated value of four of its neighbours. For example:\n the difference for a pixel at img[x, y] is:\n\n comp[y, x] = img[y, x] - (img[y-1, x-1] + img[y-1, x] + img[y-1, x+1] + img[y, x-1]) / 4\n\n This part implementes overlows of int16 as the reference implementation is bugged\n ";
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_7postdec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ __Pyx_memviewslice __pyx_v_comp = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_width;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("postdec (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comp,&__pyx_n_s_width,0};
+ PyObject* values[2] = {0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_comp)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("postdec", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "postdec") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ }
+ __pyx_v_comp = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_comp.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_width = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_width == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("postdec", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.postdec", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_6postdec(__pyx_self, __pyx_v_comp, __pyx_v_width);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_6postdec(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_comp, int __pyx_v_width) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("postdec", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_5fabio_3ext_9mar345_IO_postdec(__pyx_v_comp, __pyx_v_width, 0); if (unlikely(!__pyx_t_1.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_t_1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint32_t, 0);; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.postdec", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_comp, 1);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":348
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef inline int calc_nb_bits(any_int_t[::1] data, cnp.uint32_t start, cnp.uint32_t stop) nogil: # <<<<<<<<<<<<<<
+ * """Calculate the number of bits needed to encode the data
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_9calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_5fabio_3ext_9mar345_IO_8calc_nb_bits[] = "Calculate the number of bits needed to encode the data\n\n :param data: input data, probably slices of a larger array\n :param start: start position\n :param stop: stop position\n :return: the needed number of bits to store the values\n\n Comment from JPA:\n .................\n\n Returns the number of bits necessary to encode the longword-array 'chunk'\n of size 'n' The size in bits of one encoded element can be 0, 4, 5, 6, 7,\n 8, 16 or 32.\n ";
+static PyMethodDef __pyx_mdef_5fabio_3ext_9mar345_IO_9calc_nb_bits = {"calc_nb_bits", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_9calc_nb_bits, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_9mar345_IO_8calc_nb_bits};
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_9calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_signatures = 0;
+ PyObject *__pyx_v_args = 0;
+ PyObject *__pyx_v_kwargs = 0;
+ CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
+ PyObject* values[4] = {0,0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 3:
+ if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ }
+ __pyx_v_signatures = values[0];
+ __pyx_v_args = values[1];
+ __pyx_v_kwargs = values[2];
+ __pyx_v_defaults = values[3];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_8calc_nb_bits(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_8calc_nb_bits(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
+ PyObject *__pyx_v_dest_sig = NULL;
+ PyObject *__pyx_v_ndarray = 0;
+ PyObject *__pyx_v_numpy = NULL;
+ __Pyx_memviewslice __pyx_v_memslice;
+ Py_ssize_t __pyx_v_itemsize;
+ int __pyx_v_dtype_signed;
+ char __pyx_v_kind;
+ int __pyx_v____pyx_int64_t_is_signed;
+ int __pyx_v____pyx_int8_t_is_signed;
+ int __pyx_v____pyx_int16_t_is_signed;
+ int __pyx_v____pyx_int32_t_is_signed;
+ PyObject *__pyx_v_arg = NULL;
+ PyObject *__pyx_v_dtype = NULL;
+ PyObject *__pyx_v_arg_base = NULL;
+ PyObject *__pyx_v_candidates = NULL;
+ PyObject *__pyx_v_sig = NULL;
+ int __pyx_v_match_found;
+ PyObject *__pyx_v_src_type = NULL;
+ PyObject *__pyx_v_dst_type = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_t_7;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ Py_ssize_t __pyx_t_10;
+ char __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
+ int __pyx_t_13;
+ Py_ssize_t __pyx_t_14;
+ PyObject *(*__pyx_t_15)(PyObject *);
+ PyObject *__pyx_t_16 = NULL;
+ PyObject *__pyx_t_17 = NULL;
+ PyObject *__pyx_t_18 = NULL;
+ PyObject *(*__pyx_t_19)(PyObject *);
+ int __pyx_t_20;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("calc_nb_bits", 0);
+ __Pyx_INCREF(__pyx_v_kwargs);
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(Py_None);
+ PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = (__pyx_v_kwargs == Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
+ __pyx_t_1 = 0;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+ {
+ __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
+ __Pyx_XGOTREF(__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_5);
+ __Pyx_XGOTREF(__pyx_t_6);
+ /*try:*/ {
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_numpy = __pyx_t_1;
+ __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_v_ndarray = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+ }
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ goto __pyx_L11_try_end;
+ __pyx_L4_error:;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_ImportError) || PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ if (__pyx_t_7) {
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_INCREF(Py_None);
+ __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyObject*)Py_None));
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L5_exception_handled;
+ }
+ goto __pyx_L6_except_error;
+ __pyx_L6_except_error:;
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_XGIVEREF(__pyx_t_6);
+ __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+ goto __pyx_L1_error;
+ __pyx_L5_exception_handled:;
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_XGIVEREF(__pyx_t_6);
+ __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+ __pyx_L11_try_end:;
+ }
+ __pyx_v_itemsize = -1;
+ __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1) < 0);
+ __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1) < 0);
+ __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1) < 0);
+ __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1) < 0);
+ if (unlikely(__pyx_v_args == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((0 < __pyx_t_10) != 0);
+ if (__pyx_t_3) {
+ if (unlikely(__pyx_v_args == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
+ __Pyx_INCREF(__pyx_t_9);
+ __pyx_v_arg = __pyx_t_9;
+ __pyx_t_9 = 0;
+ goto __pyx_L14;
+ }
+ if (unlikely(__pyx_v_kwargs == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_n_s_data, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
+ if (unlikely(__pyx_v_kwargs == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_data); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_v_arg = __pyx_t_9;
+ __pyx_t_9 = 0;
+ goto __pyx_L14;
+ }
+ /*else*/ {
+ if (unlikely(__pyx_v_args == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_8);
+ __pyx_t_8 = 0;
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L14:;
+ if (0) {
+ goto __pyx_L15;
+ }
+ /*else*/ {
+ while (1) {
+ if (!1) break;
+ __pyx_t_2 = (__pyx_v_ndarray != ((PyObject*)Py_None));
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_v_dtype = __pyx_t_8;
+ __pyx_t_8 = 0;
+ goto __pyx_L19;
+ }
+ __pyx_t_2 = (__pyx_memoryview_check(__pyx_v_arg) != 0);
+ if (__pyx_t_2) {
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_v_arg_base = __pyx_t_8;
+ __pyx_t_8 = 0;
+ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_v_dtype = __pyx_t_8;
+ __pyx_t_8 = 0;
+ goto __pyx_L20;
+ }
+ /*else*/ {
+ __Pyx_INCREF(Py_None);
+ __pyx_v_dtype = Py_None;
+ }
+ __pyx_L20:;
+ goto __pyx_L19;
+ }
+ /*else*/ {
+ __Pyx_INCREF(Py_None);
+ __pyx_v_dtype = Py_None;
+ }
+ __pyx_L19:;
+ __pyx_v_itemsize = -1;
+ __pyx_t_3 = (__pyx_v_dtype != Py_None);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_v_itemsize = __pyx_t_10;
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_8);
+ __pyx_t_8 = 0;
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_11 = __Pyx_PyInt_As_char(__pyx_t_8); if (unlikely((__pyx_t_11 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_v_kind = __pyx_t_11;
+ __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
+ switch (__pyx_v_kind) {
+ case 'i':
+ case 'u':
+ __pyx_t_3 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_3) {
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L23_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_3) {
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L23_bool_binop_done;
+ }
+ __pyx_t_3 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_2 = __pyx_t_3;
+ __pyx_L23_bool_binop_done:;
+ if (__pyx_t_2) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L17_break;
+ }
+ __pyx_t_3 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_3) {
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L27_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_3) {
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L27_bool_binop_done;
+ }
+ __pyx_t_3 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_2 = __pyx_t_3;
+ __pyx_L27_bool_binop_done:;
+ if (__pyx_t_2) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L17_break;
+ }
+ __pyx_t_3 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_3) {
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L31_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_3) {
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L31_bool_binop_done;
+ }
+ __pyx_t_3 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_2 = __pyx_t_3;
+ __pyx_L31_bool_binop_done:;
+ if (__pyx_t_2) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L17_break;
+ }
+ __pyx_t_3 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_3) {
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L35_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_3 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_3) {
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L35_bool_binop_done;
+ }
+ __pyx_t_3 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_2 = __pyx_t_3;
+ __pyx_L35_bool_binop_done:;
+ if (__pyx_t_2) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L17_break;
+ }
+ break;
+ case 'f':
+ break;
+ case 'c':
+ break;
+ case 'O':
+ break;
+ default: break;
+ }
+ goto __pyx_L21;
+ }
+ __pyx_L21:;
+ goto __pyx_L18;
+ }
+ __pyx_L18:;
+ __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
+ if (!__pyx_t_3) {
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L39_bool_binop_done;
+ }
+ __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
+ __pyx_t_2 = __pyx_t_3;
+ __pyx_L39_bool_binop_done:;
+ if (__pyx_t_2) {
+ __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int8_t(__pyx_v_arg);
+ __pyx_t_2 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_2) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L17_break;
+ }
+ /*else*/ {
+ PyErr_Clear();
+ }
+ goto __pyx_L38;
+ }
+ __pyx_L38:;
+ __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
+ if (!__pyx_t_3) {
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L43_bool_binop_done;
+ }
+ __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
+ __pyx_t_2 = __pyx_t_3;
+ __pyx_L43_bool_binop_done:;
+ if (__pyx_t_2) {
+ __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
+ __pyx_t_2 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_2) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L17_break;
+ }
+ /*else*/ {
+ PyErr_Clear();
+ }
+ goto __pyx_L42;
+ }
+ __pyx_L42:;
+ __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
+ if (!__pyx_t_3) {
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L47_bool_binop_done;
+ }
+ __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
+ __pyx_t_2 = __pyx_t_3;
+ __pyx_L47_bool_binop_done:;
+ if (__pyx_t_2) {
+ __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
+ __pyx_t_2 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_2) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L17_break;
+ }
+ /*else*/ {
+ PyErr_Clear();
+ }
+ goto __pyx_L46;
+ }
+ __pyx_L46:;
+ __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
+ if (!__pyx_t_3) {
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L51_bool_binop_done;
+ }
+ __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
+ __pyx_t_2 = __pyx_t_3;
+ __pyx_L51_bool_binop_done:;
+ if (__pyx_t_2) {
+ __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
+ __pyx_t_2 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_2) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L17_break;
+ }
+ /*else*/ {
+ PyErr_Clear();
+ }
+ goto __pyx_L50;
+ }
+ __pyx_L50:;
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L17_break;
+ }
+ __pyx_L17_break:;
+ }
+ __pyx_L15:;
+ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_v_candidates = ((PyObject*)__pyx_t_8);
+ __pyx_t_8 = 0;
+ __pyx_t_10 = 0;
+ if (unlikely(__pyx_v_signatures == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_12), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_8);
+ __pyx_t_8 = __pyx_t_9;
+ __pyx_t_9 = 0;
+ while (1) {
+ __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_12, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
+ if (unlikely(__pyx_t_13 == 0)) break;
+ if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_v_match_found = 0;
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_dest_sig);
+ PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig);
+ __Pyx_GIVEREF(__pyx_v_dest_sig);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
+ __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_14 = 0;
+ __pyx_t_15 = NULL;
+ } else {
+ __pyx_t_14 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_15 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ for (;;) {
+ if (likely(!__pyx_t_15)) {
+ if (likely(PyList_CheckExact(__pyx_t_9))) {
+ if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_9)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else {
+ if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ }
+ } else {
+ __pyx_t_1 = __pyx_t_15(__pyx_t_9);
+ if (unlikely(!__pyx_t_1)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_1);
+ }
+ if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+ PyObject* sequence = __pyx_t_1;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ Py_ssize_t size = Py_SIZE(sequence);
+ #else
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ if (likely(PyTuple_CheckExact(sequence))) {
+ __pyx_t_16 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_17 = PyTuple_GET_ITEM(sequence, 1);
+ } else {
+ __pyx_t_16 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_17 = PyList_GET_ITEM(sequence, 1);
+ }
+ __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_17);
+ #else
+ __pyx_t_16 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_16);
+ __pyx_t_17 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ #endif
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else {
+ Py_ssize_t index = -1;
+ __pyx_t_18 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_18);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_19 = Py_TYPE(__pyx_t_18)->tp_iternext;
+ index = 0; __pyx_t_16 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_16)) goto __pyx_L58_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_16);
+ index = 1; __pyx_t_17 = __pyx_t_19(__pyx_t_18); if (unlikely(!__pyx_t_17)) goto __pyx_L58_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_17);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_18), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = NULL;
+ __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+ goto __pyx_L59_unpacking_done;
+ __pyx_L58_unpacking_failed:;
+ __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __pyx_t_19 = NULL;
+ if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_L59_unpacking_done:;
+ }
+ __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_16);
+ __pyx_t_16 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_17);
+ __pyx_t_17 = 0;
+ __pyx_t_2 = (__pyx_v_dst_type != Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__pyx_t_3) {
+ __pyx_v_match_found = 1;
+ goto __pyx_L61;
+ }
+ /*else*/ {
+ __pyx_v_match_found = 0;
+ goto __pyx_L57_break;
+ }
+ __pyx_L61:;
+ goto __pyx_L60;
+ }
+ __pyx_L60:;
+ }
+ __pyx_L57_break:;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_3 = (__pyx_v_match_found != 0);
+ if (__pyx_t_3) {
+ __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_20 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L62;
+ }
+ __pyx_L62:;
+ }
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_3 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
+ __pyx_t_2 = ((!__pyx_t_3) != 0);
+ if (__pyx_t_2) {
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_12 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((__pyx_t_12 > 1) != 0);
+ if (__pyx_t_2) {
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ if (unlikely(__pyx_v_signatures == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_r = __pyx_t_8;
+ __pyx_t_8 = 0;
+ goto __pyx_L0;
+ }
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_16);
+ __Pyx_XDECREF(__pyx_t_17);
+ __Pyx_XDECREF(__pyx_t_18);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_dest_sig);
+ __Pyx_XDECREF(__pyx_v_ndarray);
+ __Pyx_XDECREF(__pyx_v_numpy);
+ __Pyx_XDECREF(__pyx_v_arg);
+ __Pyx_XDECREF(__pyx_v_dtype);
+ __Pyx_XDECREF(__pyx_v_arg_base);
+ __Pyx_XDECREF(__pyx_v_candidates);
+ __Pyx_XDECREF(__pyx_v_sig);
+ __Pyx_XDECREF(__pyx_v_src_type);
+ __Pyx_XDECREF(__pyx_v_dst_type);
+ __Pyx_XDECREF(__pyx_v_kwargs);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_17__pyx_fuse_0calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_9calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static CYTHON_INLINE int __pyx_fuse_0__pyx_f_5fabio_3ext_9mar345_IO_calc_nb_bits(__Pyx_memviewslice __pyx_v_data, unsigned int __pyx_v_start, unsigned int __pyx_v_stop, CYTHON_UNUSED int __pyx_skip_dispatch) {
+ __pyx_t_5numpy_uint32_t __pyx_v_size;
+ __pyx_t_5numpy_uint32_t __pyx_v_maxsize;
+ __pyx_t_5numpy_uint32_t __pyx_v_i;
+ __pyx_t_5numpy_uint32_t __pyx_v_abs_data;
+ __pyx_t_5numpy_int8_t __pyx_v_read_data;
+ int __pyx_r;
+ unsigned int __pyx_t_1;
+ __pyx_t_5numpy_uint32_t __pyx_t_2;
+ __pyx_t_5numpy_uint32_t __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+
+ /* "fabio/ext/mar345_IO.pyx":367
+ * any_int_t read_data
+ *
+ * size = stop - start # <<<<<<<<<<<<<<
+ * maxsize = 0
+ * for i in range(start, stop):
+ */
+ __pyx_v_size = (__pyx_v_stop - __pyx_v_start);
+
+ /* "fabio/ext/mar345_IO.pyx":368
+ *
+ * size = stop - start
+ * maxsize = 0 # <<<<<<<<<<<<<<
+ * for i in range(start, stop):
+ * read_data = data[i]
+ */
+ __pyx_v_maxsize = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":369
+ * size = stop - start
+ * maxsize = 0
+ * for i in range(start, stop): # <<<<<<<<<<<<<<
+ * read_data = data[i]
+ * abs_data = - read_data if read_data < 0 else read_data
+ */
+ __pyx_t_1 = __pyx_v_stop;
+ for (__pyx_t_2 = __pyx_v_start; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "fabio/ext/mar345_IO.pyx":370
+ * maxsize = 0
+ * for i in range(start, stop):
+ * read_data = data[i] # <<<<<<<<<<<<<<
+ * abs_data = - read_data if read_data < 0 else read_data
+ * if abs_data > maxsize:
+ */
+ __pyx_t_3 = __pyx_v_i;
+ __pyx_v_read_data = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int8_t *) __pyx_v_data.data) + __pyx_t_3)) )));
+
+ /* "fabio/ext/mar345_IO.pyx":371
+ * for i in range(start, stop):
+ * read_data = data[i]
+ * abs_data = - read_data if read_data < 0 else read_data # <<<<<<<<<<<<<<
+ * if abs_data > maxsize:
+ * maxsize = abs_data
+ */
+ if (((__pyx_v_read_data < 0) != 0)) {
+ __pyx_t_4 = (-__pyx_v_read_data);
+ } else {
+ __pyx_t_4 = __pyx_v_read_data;
+ }
+ __pyx_v_abs_data = __pyx_t_4;
+
+ /* "fabio/ext/mar345_IO.pyx":372
+ * read_data = data[i]
+ * abs_data = - read_data if read_data < 0 else read_data
+ * if abs_data > maxsize: # <<<<<<<<<<<<<<
+ * maxsize = abs_data
+ * if maxsize == 0:
+ */
+ __pyx_t_5 = ((__pyx_v_abs_data > __pyx_v_maxsize) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":373
+ * abs_data = - read_data if read_data < 0 else read_data
+ * if abs_data > maxsize:
+ * maxsize = abs_data # <<<<<<<<<<<<<<
+ * if maxsize == 0:
+ * return 0
+ */
+ __pyx_v_maxsize = __pyx_v_abs_data;
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":374
+ * if abs_data > maxsize:
+ * maxsize = abs_data
+ * if maxsize == 0: # <<<<<<<<<<<<<<
+ * return 0
+ * elif maxsize < 8:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize == 0) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":375
+ * maxsize = abs_data
+ * if maxsize == 0:
+ * return 0 # <<<<<<<<<<<<<<
+ * elif maxsize < 8:
+ * return size * 4
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":376
+ * if maxsize == 0:
+ * return 0
+ * elif maxsize < 8: # <<<<<<<<<<<<<<
+ * return size * 4
+ * elif maxsize < 16:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 8) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":377
+ * return 0
+ * elif maxsize < 8:
+ * return size * 4 # <<<<<<<<<<<<<<
+ * elif maxsize < 16:
+ * return size * 5
+ */
+ __pyx_r = (__pyx_v_size * 4);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":378
+ * elif maxsize < 8:
+ * return size * 4
+ * elif maxsize < 16: # <<<<<<<<<<<<<<
+ * return size * 5
+ * elif maxsize < 32:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 16) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":379
+ * return size * 4
+ * elif maxsize < 16:
+ * return size * 5 # <<<<<<<<<<<<<<
+ * elif maxsize < 32:
+ * return size * 6
+ */
+ __pyx_r = (__pyx_v_size * 5);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":380
+ * elif maxsize < 16:
+ * return size * 5
+ * elif maxsize < 32: # <<<<<<<<<<<<<<
+ * return size * 6
+ * elif maxsize < 64:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 32) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":381
+ * return size * 5
+ * elif maxsize < 32:
+ * return size * 6 # <<<<<<<<<<<<<<
+ * elif maxsize < 64:
+ * return size * 7
+ */
+ __pyx_r = (__pyx_v_size * 6);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":382
+ * elif maxsize < 32:
+ * return size * 6
+ * elif maxsize < 64: # <<<<<<<<<<<<<<
+ * return size * 7
+ * elif maxsize < 128:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 64) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":383
+ * return size * 6
+ * elif maxsize < 64:
+ * return size * 7 # <<<<<<<<<<<<<<
+ * elif maxsize < 128:
+ * return size * 8
+ */
+ __pyx_r = (__pyx_v_size * 7);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":384
+ * elif maxsize < 64:
+ * return size * 7
+ * elif maxsize < 128: # <<<<<<<<<<<<<<
+ * return size * 8
+ * elif maxsize < 32768:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 128) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":385
+ * return size * 7
+ * elif maxsize < 128:
+ * return size * 8 # <<<<<<<<<<<<<<
+ * elif maxsize < 32768:
+ * return size * 16
+ */
+ __pyx_r = (__pyx_v_size * 8);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":386
+ * elif maxsize < 128:
+ * return size * 8
+ * elif maxsize < 32768: # <<<<<<<<<<<<<<
+ * return size * 16
+ * else:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 32768) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":387
+ * return size * 8
+ * elif maxsize < 32768:
+ * return size * 16 # <<<<<<<<<<<<<<
+ * else:
+ * return size * 32
+ */
+ __pyx_r = (__pyx_v_size * 16);
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":389
+ * return size * 16
+ * else:
+ * return size * 32 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = (__pyx_v_size * 32);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":348
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef inline int calc_nb_bits(any_int_t[::1] data, cnp.uint32_t start, cnp.uint32_t stop) nogil: # <<<<<<<<<<<<<<
+ * """Calculate the number of bits needed to encode the data
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_17__pyx_fuse_0calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0__pyx_mdef_5fabio_3ext_9mar345_IO_17__pyx_fuse_0calc_nb_bits = {"__pyx_fuse_0calc_nb_bits", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_17__pyx_fuse_0calc_nb_bits, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_9mar345_IO_8calc_nb_bits};
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_17__pyx_fuse_0calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __pyx_t_5numpy_uint32_t __pyx_v_start;
+ __pyx_t_5numpy_uint32_t __pyx_v_stop;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__pyx_fuse_0calc_nb_bits (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_start,&__pyx_n_s_stop,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0calc_nb_bits", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0calc_nb_bits", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_0calc_nb_bits") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ }
+ __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_data.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_start = __Pyx_PyInt_As_npy_uint32(values[1]); if (unlikely((__pyx_v_start == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_stop = __Pyx_PyInt_As_npy_uint32(values[2]); if (unlikely((__pyx_v_stop == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0calc_nb_bits", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.__pyx_fuse_0calc_nb_bits", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_16__pyx_fuse_0calc_nb_bits(__pyx_self, __pyx_v_data, __pyx_v_start, __pyx_v_stop);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_16__pyx_fuse_0calc_nb_bits(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, __pyx_t_5numpy_uint32_t __pyx_v_start, __pyx_t_5numpy_uint32_t __pyx_v_stop) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__pyx_fuse_0calc_nb_bits", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_fuse_0__pyx_f_5fabio_3ext_9mar345_IO_calc_nb_bits(__pyx_v_data, __pyx_v_start, __pyx_v_stop, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.__pyx_fuse_0calc_nb_bits", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_19__pyx_fuse_1calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_9calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static CYTHON_INLINE int __pyx_fuse_1__pyx_f_5fabio_3ext_9mar345_IO_calc_nb_bits(__Pyx_memviewslice __pyx_v_data, unsigned int __pyx_v_start, unsigned int __pyx_v_stop, CYTHON_UNUSED int __pyx_skip_dispatch) {
+ __pyx_t_5numpy_uint32_t __pyx_v_size;
+ __pyx_t_5numpy_uint32_t __pyx_v_maxsize;
+ __pyx_t_5numpy_uint32_t __pyx_v_i;
+ __pyx_t_5numpy_uint32_t __pyx_v_abs_data;
+ __pyx_t_5numpy_int16_t __pyx_v_read_data;
+ int __pyx_r;
+ unsigned int __pyx_t_1;
+ __pyx_t_5numpy_uint32_t __pyx_t_2;
+ __pyx_t_5numpy_uint32_t __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+
+ /* "fabio/ext/mar345_IO.pyx":367
+ * any_int_t read_data
+ *
+ * size = stop - start # <<<<<<<<<<<<<<
+ * maxsize = 0
+ * for i in range(start, stop):
+ */
+ __pyx_v_size = (__pyx_v_stop - __pyx_v_start);
+
+ /* "fabio/ext/mar345_IO.pyx":368
+ *
+ * size = stop - start
+ * maxsize = 0 # <<<<<<<<<<<<<<
+ * for i in range(start, stop):
+ * read_data = data[i]
+ */
+ __pyx_v_maxsize = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":369
+ * size = stop - start
+ * maxsize = 0
+ * for i in range(start, stop): # <<<<<<<<<<<<<<
+ * read_data = data[i]
+ * abs_data = - read_data if read_data < 0 else read_data
+ */
+ __pyx_t_1 = __pyx_v_stop;
+ for (__pyx_t_2 = __pyx_v_start; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "fabio/ext/mar345_IO.pyx":370
+ * maxsize = 0
+ * for i in range(start, stop):
+ * read_data = data[i] # <<<<<<<<<<<<<<
+ * abs_data = - read_data if read_data < 0 else read_data
+ * if abs_data > maxsize:
+ */
+ __pyx_t_3 = __pyx_v_i;
+ __pyx_v_read_data = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int16_t *) __pyx_v_data.data) + __pyx_t_3)) )));
+
+ /* "fabio/ext/mar345_IO.pyx":371
+ * for i in range(start, stop):
+ * read_data = data[i]
+ * abs_data = - read_data if read_data < 0 else read_data # <<<<<<<<<<<<<<
+ * if abs_data > maxsize:
+ * maxsize = abs_data
+ */
+ if (((__pyx_v_read_data < 0) != 0)) {
+ __pyx_t_4 = (-__pyx_v_read_data);
+ } else {
+ __pyx_t_4 = __pyx_v_read_data;
+ }
+ __pyx_v_abs_data = __pyx_t_4;
+
+ /* "fabio/ext/mar345_IO.pyx":372
+ * read_data = data[i]
+ * abs_data = - read_data if read_data < 0 else read_data
+ * if abs_data > maxsize: # <<<<<<<<<<<<<<
+ * maxsize = abs_data
+ * if maxsize == 0:
+ */
+ __pyx_t_5 = ((__pyx_v_abs_data > __pyx_v_maxsize) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":373
+ * abs_data = - read_data if read_data < 0 else read_data
+ * if abs_data > maxsize:
+ * maxsize = abs_data # <<<<<<<<<<<<<<
+ * if maxsize == 0:
+ * return 0
+ */
+ __pyx_v_maxsize = __pyx_v_abs_data;
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":374
+ * if abs_data > maxsize:
+ * maxsize = abs_data
+ * if maxsize == 0: # <<<<<<<<<<<<<<
+ * return 0
+ * elif maxsize < 8:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize == 0) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":375
+ * maxsize = abs_data
+ * if maxsize == 0:
+ * return 0 # <<<<<<<<<<<<<<
+ * elif maxsize < 8:
+ * return size * 4
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":376
+ * if maxsize == 0:
+ * return 0
+ * elif maxsize < 8: # <<<<<<<<<<<<<<
+ * return size * 4
+ * elif maxsize < 16:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 8) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":377
+ * return 0
+ * elif maxsize < 8:
+ * return size * 4 # <<<<<<<<<<<<<<
+ * elif maxsize < 16:
+ * return size * 5
+ */
+ __pyx_r = (__pyx_v_size * 4);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":378
+ * elif maxsize < 8:
+ * return size * 4
+ * elif maxsize < 16: # <<<<<<<<<<<<<<
+ * return size * 5
+ * elif maxsize < 32:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 16) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":379
+ * return size * 4
+ * elif maxsize < 16:
+ * return size * 5 # <<<<<<<<<<<<<<
+ * elif maxsize < 32:
+ * return size * 6
+ */
+ __pyx_r = (__pyx_v_size * 5);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":380
+ * elif maxsize < 16:
+ * return size * 5
+ * elif maxsize < 32: # <<<<<<<<<<<<<<
+ * return size * 6
+ * elif maxsize < 64:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 32) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":381
+ * return size * 5
+ * elif maxsize < 32:
+ * return size * 6 # <<<<<<<<<<<<<<
+ * elif maxsize < 64:
+ * return size * 7
+ */
+ __pyx_r = (__pyx_v_size * 6);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":382
+ * elif maxsize < 32:
+ * return size * 6
+ * elif maxsize < 64: # <<<<<<<<<<<<<<
+ * return size * 7
+ * elif maxsize < 128:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 64) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":383
+ * return size * 6
+ * elif maxsize < 64:
+ * return size * 7 # <<<<<<<<<<<<<<
+ * elif maxsize < 128:
+ * return size * 8
+ */
+ __pyx_r = (__pyx_v_size * 7);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":384
+ * elif maxsize < 64:
+ * return size * 7
+ * elif maxsize < 128: # <<<<<<<<<<<<<<
+ * return size * 8
+ * elif maxsize < 32768:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 128) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":385
+ * return size * 7
+ * elif maxsize < 128:
+ * return size * 8 # <<<<<<<<<<<<<<
+ * elif maxsize < 32768:
+ * return size * 16
+ */
+ __pyx_r = (__pyx_v_size * 8);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":386
+ * elif maxsize < 128:
+ * return size * 8
+ * elif maxsize < 32768: # <<<<<<<<<<<<<<
+ * return size * 16
+ * else:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 32768) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":387
+ * return size * 8
+ * elif maxsize < 32768:
+ * return size * 16 # <<<<<<<<<<<<<<
+ * else:
+ * return size * 32
+ */
+ __pyx_r = (__pyx_v_size * 16);
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":389
+ * return size * 16
+ * else:
+ * return size * 32 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = (__pyx_v_size * 32);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":348
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef inline int calc_nb_bits(any_int_t[::1] data, cnp.uint32_t start, cnp.uint32_t stop) nogil: # <<<<<<<<<<<<<<
+ * """Calculate the number of bits needed to encode the data
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_19__pyx_fuse_1calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1__pyx_mdef_5fabio_3ext_9mar345_IO_19__pyx_fuse_1calc_nb_bits = {"__pyx_fuse_1calc_nb_bits", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_19__pyx_fuse_1calc_nb_bits, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_9mar345_IO_8calc_nb_bits};
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_19__pyx_fuse_1calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __pyx_t_5numpy_uint32_t __pyx_v_start;
+ __pyx_t_5numpy_uint32_t __pyx_v_stop;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__pyx_fuse_1calc_nb_bits (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_start,&__pyx_n_s_stop,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1calc_nb_bits", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1calc_nb_bits", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_1calc_nb_bits") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ }
+ __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_data.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_start = __Pyx_PyInt_As_npy_uint32(values[1]); if (unlikely((__pyx_v_start == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_stop = __Pyx_PyInt_As_npy_uint32(values[2]); if (unlikely((__pyx_v_stop == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1calc_nb_bits", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.__pyx_fuse_1calc_nb_bits", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_18__pyx_fuse_1calc_nb_bits(__pyx_self, __pyx_v_data, __pyx_v_start, __pyx_v_stop);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_18__pyx_fuse_1calc_nb_bits(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, __pyx_t_5numpy_uint32_t __pyx_v_start, __pyx_t_5numpy_uint32_t __pyx_v_stop) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__pyx_fuse_1calc_nb_bits", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_fuse_1__pyx_f_5fabio_3ext_9mar345_IO_calc_nb_bits(__pyx_v_data, __pyx_v_start, __pyx_v_stop, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.__pyx_fuse_1calc_nb_bits", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_21__pyx_fuse_2calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_9calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static CYTHON_INLINE int __pyx_fuse_2__pyx_f_5fabio_3ext_9mar345_IO_calc_nb_bits(__Pyx_memviewslice __pyx_v_data, unsigned int __pyx_v_start, unsigned int __pyx_v_stop, CYTHON_UNUSED int __pyx_skip_dispatch) {
+ __pyx_t_5numpy_uint32_t __pyx_v_size;
+ __pyx_t_5numpy_uint32_t __pyx_v_maxsize;
+ __pyx_t_5numpy_uint32_t __pyx_v_i;
+ __pyx_t_5numpy_uint32_t __pyx_v_abs_data;
+ __pyx_t_5numpy_int32_t __pyx_v_read_data;
+ int __pyx_r;
+ unsigned int __pyx_t_1;
+ __pyx_t_5numpy_uint32_t __pyx_t_2;
+ __pyx_t_5numpy_uint32_t __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+
+ /* "fabio/ext/mar345_IO.pyx":367
+ * any_int_t read_data
+ *
+ * size = stop - start # <<<<<<<<<<<<<<
+ * maxsize = 0
+ * for i in range(start, stop):
+ */
+ __pyx_v_size = (__pyx_v_stop - __pyx_v_start);
+
+ /* "fabio/ext/mar345_IO.pyx":368
+ *
+ * size = stop - start
+ * maxsize = 0 # <<<<<<<<<<<<<<
+ * for i in range(start, stop):
+ * read_data = data[i]
+ */
+ __pyx_v_maxsize = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":369
+ * size = stop - start
+ * maxsize = 0
+ * for i in range(start, stop): # <<<<<<<<<<<<<<
+ * read_data = data[i]
+ * abs_data = - read_data if read_data < 0 else read_data
+ */
+ __pyx_t_1 = __pyx_v_stop;
+ for (__pyx_t_2 = __pyx_v_start; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "fabio/ext/mar345_IO.pyx":370
+ * maxsize = 0
+ * for i in range(start, stop):
+ * read_data = data[i] # <<<<<<<<<<<<<<
+ * abs_data = - read_data if read_data < 0 else read_data
+ * if abs_data > maxsize:
+ */
+ __pyx_t_3 = __pyx_v_i;
+ __pyx_v_read_data = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_data.data) + __pyx_t_3)) )));
+
+ /* "fabio/ext/mar345_IO.pyx":371
+ * for i in range(start, stop):
+ * read_data = data[i]
+ * abs_data = - read_data if read_data < 0 else read_data # <<<<<<<<<<<<<<
+ * if abs_data > maxsize:
+ * maxsize = abs_data
+ */
+ if (((__pyx_v_read_data < 0) != 0)) {
+ __pyx_t_4 = (-__pyx_v_read_data);
+ } else {
+ __pyx_t_4 = __pyx_v_read_data;
+ }
+ __pyx_v_abs_data = __pyx_t_4;
+
+ /* "fabio/ext/mar345_IO.pyx":372
+ * read_data = data[i]
+ * abs_data = - read_data if read_data < 0 else read_data
+ * if abs_data > maxsize: # <<<<<<<<<<<<<<
+ * maxsize = abs_data
+ * if maxsize == 0:
+ */
+ __pyx_t_5 = ((__pyx_v_abs_data > __pyx_v_maxsize) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":373
+ * abs_data = - read_data if read_data < 0 else read_data
+ * if abs_data > maxsize:
+ * maxsize = abs_data # <<<<<<<<<<<<<<
+ * if maxsize == 0:
+ * return 0
+ */
+ __pyx_v_maxsize = __pyx_v_abs_data;
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":374
+ * if abs_data > maxsize:
+ * maxsize = abs_data
+ * if maxsize == 0: # <<<<<<<<<<<<<<
+ * return 0
+ * elif maxsize < 8:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize == 0) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":375
+ * maxsize = abs_data
+ * if maxsize == 0:
+ * return 0 # <<<<<<<<<<<<<<
+ * elif maxsize < 8:
+ * return size * 4
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":376
+ * if maxsize == 0:
+ * return 0
+ * elif maxsize < 8: # <<<<<<<<<<<<<<
+ * return size * 4
+ * elif maxsize < 16:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 8) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":377
+ * return 0
+ * elif maxsize < 8:
+ * return size * 4 # <<<<<<<<<<<<<<
+ * elif maxsize < 16:
+ * return size * 5
+ */
+ __pyx_r = (__pyx_v_size * 4);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":378
+ * elif maxsize < 8:
+ * return size * 4
+ * elif maxsize < 16: # <<<<<<<<<<<<<<
+ * return size * 5
+ * elif maxsize < 32:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 16) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":379
+ * return size * 4
+ * elif maxsize < 16:
+ * return size * 5 # <<<<<<<<<<<<<<
+ * elif maxsize < 32:
+ * return size * 6
+ */
+ __pyx_r = (__pyx_v_size * 5);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":380
+ * elif maxsize < 16:
+ * return size * 5
+ * elif maxsize < 32: # <<<<<<<<<<<<<<
+ * return size * 6
+ * elif maxsize < 64:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 32) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":381
+ * return size * 5
+ * elif maxsize < 32:
+ * return size * 6 # <<<<<<<<<<<<<<
+ * elif maxsize < 64:
+ * return size * 7
+ */
+ __pyx_r = (__pyx_v_size * 6);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":382
+ * elif maxsize < 32:
+ * return size * 6
+ * elif maxsize < 64: # <<<<<<<<<<<<<<
+ * return size * 7
+ * elif maxsize < 128:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 64) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":383
+ * return size * 6
+ * elif maxsize < 64:
+ * return size * 7 # <<<<<<<<<<<<<<
+ * elif maxsize < 128:
+ * return size * 8
+ */
+ __pyx_r = (__pyx_v_size * 7);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":384
+ * elif maxsize < 64:
+ * return size * 7
+ * elif maxsize < 128: # <<<<<<<<<<<<<<
+ * return size * 8
+ * elif maxsize < 32768:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 128) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":385
+ * return size * 7
+ * elif maxsize < 128:
+ * return size * 8 # <<<<<<<<<<<<<<
+ * elif maxsize < 32768:
+ * return size * 16
+ */
+ __pyx_r = (__pyx_v_size * 8);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":386
+ * elif maxsize < 128:
+ * return size * 8
+ * elif maxsize < 32768: # <<<<<<<<<<<<<<
+ * return size * 16
+ * else:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 32768) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":387
+ * return size * 8
+ * elif maxsize < 32768:
+ * return size * 16 # <<<<<<<<<<<<<<
+ * else:
+ * return size * 32
+ */
+ __pyx_r = (__pyx_v_size * 16);
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":389
+ * return size * 16
+ * else:
+ * return size * 32 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = (__pyx_v_size * 32);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":348
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef inline int calc_nb_bits(any_int_t[::1] data, cnp.uint32_t start, cnp.uint32_t stop) nogil: # <<<<<<<<<<<<<<
+ * """Calculate the number of bits needed to encode the data
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_21__pyx_fuse_2calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_2__pyx_mdef_5fabio_3ext_9mar345_IO_21__pyx_fuse_2calc_nb_bits = {"__pyx_fuse_2calc_nb_bits", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_21__pyx_fuse_2calc_nb_bits, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_9mar345_IO_8calc_nb_bits};
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_21__pyx_fuse_2calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __pyx_t_5numpy_uint32_t __pyx_v_start;
+ __pyx_t_5numpy_uint32_t __pyx_v_stop;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__pyx_fuse_2calc_nb_bits (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_start,&__pyx_n_s_stop,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2calc_nb_bits", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2calc_nb_bits", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_2calc_nb_bits") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ }
+ __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_data.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_start = __Pyx_PyInt_As_npy_uint32(values[1]); if (unlikely((__pyx_v_start == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_stop = __Pyx_PyInt_As_npy_uint32(values[2]); if (unlikely((__pyx_v_stop == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2calc_nb_bits", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.__pyx_fuse_2calc_nb_bits", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_20__pyx_fuse_2calc_nb_bits(__pyx_self, __pyx_v_data, __pyx_v_start, __pyx_v_stop);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_20__pyx_fuse_2calc_nb_bits(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, __pyx_t_5numpy_uint32_t __pyx_v_start, __pyx_t_5numpy_uint32_t __pyx_v_stop) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__pyx_fuse_2calc_nb_bits", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_fuse_2__pyx_f_5fabio_3ext_9mar345_IO_calc_nb_bits(__pyx_v_data, __pyx_v_start, __pyx_v_stop, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.__pyx_fuse_2calc_nb_bits", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_23__pyx_fuse_3calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_9calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static CYTHON_INLINE int __pyx_fuse_3__pyx_f_5fabio_3ext_9mar345_IO_calc_nb_bits(__Pyx_memviewslice __pyx_v_data, unsigned int __pyx_v_start, unsigned int __pyx_v_stop, CYTHON_UNUSED int __pyx_skip_dispatch) {
+ __pyx_t_5numpy_uint32_t __pyx_v_size;
+ __pyx_t_5numpy_uint32_t __pyx_v_maxsize;
+ __pyx_t_5numpy_uint32_t __pyx_v_i;
+ __pyx_t_5numpy_uint32_t __pyx_v_abs_data;
+ __pyx_t_5numpy_int64_t __pyx_v_read_data;
+ int __pyx_r;
+ unsigned int __pyx_t_1;
+ __pyx_t_5numpy_uint32_t __pyx_t_2;
+ __pyx_t_5numpy_uint32_t __pyx_t_3;
+ __pyx_t_5numpy_int64_t __pyx_t_4;
+ int __pyx_t_5;
+
+ /* "fabio/ext/mar345_IO.pyx":367
+ * any_int_t read_data
+ *
+ * size = stop - start # <<<<<<<<<<<<<<
+ * maxsize = 0
+ * for i in range(start, stop):
+ */
+ __pyx_v_size = (__pyx_v_stop - __pyx_v_start);
+
+ /* "fabio/ext/mar345_IO.pyx":368
+ *
+ * size = stop - start
+ * maxsize = 0 # <<<<<<<<<<<<<<
+ * for i in range(start, stop):
+ * read_data = data[i]
+ */
+ __pyx_v_maxsize = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":369
+ * size = stop - start
+ * maxsize = 0
+ * for i in range(start, stop): # <<<<<<<<<<<<<<
+ * read_data = data[i]
+ * abs_data = - read_data if read_data < 0 else read_data
+ */
+ __pyx_t_1 = __pyx_v_stop;
+ for (__pyx_t_2 = __pyx_v_start; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "fabio/ext/mar345_IO.pyx":370
+ * maxsize = 0
+ * for i in range(start, stop):
+ * read_data = data[i] # <<<<<<<<<<<<<<
+ * abs_data = - read_data if read_data < 0 else read_data
+ * if abs_data > maxsize:
+ */
+ __pyx_t_3 = __pyx_v_i;
+ __pyx_v_read_data = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int64_t *) __pyx_v_data.data) + __pyx_t_3)) )));
+
+ /* "fabio/ext/mar345_IO.pyx":371
+ * for i in range(start, stop):
+ * read_data = data[i]
+ * abs_data = - read_data if read_data < 0 else read_data # <<<<<<<<<<<<<<
+ * if abs_data > maxsize:
+ * maxsize = abs_data
+ */
+ if (((__pyx_v_read_data < 0) != 0)) {
+ __pyx_t_4 = (-__pyx_v_read_data);
+ } else {
+ __pyx_t_4 = __pyx_v_read_data;
+ }
+ __pyx_v_abs_data = __pyx_t_4;
+
+ /* "fabio/ext/mar345_IO.pyx":372
+ * read_data = data[i]
+ * abs_data = - read_data if read_data < 0 else read_data
+ * if abs_data > maxsize: # <<<<<<<<<<<<<<
+ * maxsize = abs_data
+ * if maxsize == 0:
+ */
+ __pyx_t_5 = ((__pyx_v_abs_data > __pyx_v_maxsize) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":373
+ * abs_data = - read_data if read_data < 0 else read_data
+ * if abs_data > maxsize:
+ * maxsize = abs_data # <<<<<<<<<<<<<<
+ * if maxsize == 0:
+ * return 0
+ */
+ __pyx_v_maxsize = __pyx_v_abs_data;
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":374
+ * if abs_data > maxsize:
+ * maxsize = abs_data
+ * if maxsize == 0: # <<<<<<<<<<<<<<
+ * return 0
+ * elif maxsize < 8:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize == 0) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":375
+ * maxsize = abs_data
+ * if maxsize == 0:
+ * return 0 # <<<<<<<<<<<<<<
+ * elif maxsize < 8:
+ * return size * 4
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":376
+ * if maxsize == 0:
+ * return 0
+ * elif maxsize < 8: # <<<<<<<<<<<<<<
+ * return size * 4
+ * elif maxsize < 16:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 8) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":377
+ * return 0
+ * elif maxsize < 8:
+ * return size * 4 # <<<<<<<<<<<<<<
+ * elif maxsize < 16:
+ * return size * 5
+ */
+ __pyx_r = (__pyx_v_size * 4);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":378
+ * elif maxsize < 8:
+ * return size * 4
+ * elif maxsize < 16: # <<<<<<<<<<<<<<
+ * return size * 5
+ * elif maxsize < 32:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 16) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":379
+ * return size * 4
+ * elif maxsize < 16:
+ * return size * 5 # <<<<<<<<<<<<<<
+ * elif maxsize < 32:
+ * return size * 6
+ */
+ __pyx_r = (__pyx_v_size * 5);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":380
+ * elif maxsize < 16:
+ * return size * 5
+ * elif maxsize < 32: # <<<<<<<<<<<<<<
+ * return size * 6
+ * elif maxsize < 64:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 32) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":381
+ * return size * 5
+ * elif maxsize < 32:
+ * return size * 6 # <<<<<<<<<<<<<<
+ * elif maxsize < 64:
+ * return size * 7
+ */
+ __pyx_r = (__pyx_v_size * 6);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":382
+ * elif maxsize < 32:
+ * return size * 6
+ * elif maxsize < 64: # <<<<<<<<<<<<<<
+ * return size * 7
+ * elif maxsize < 128:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 64) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":383
+ * return size * 6
+ * elif maxsize < 64:
+ * return size * 7 # <<<<<<<<<<<<<<
+ * elif maxsize < 128:
+ * return size * 8
+ */
+ __pyx_r = (__pyx_v_size * 7);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":384
+ * elif maxsize < 64:
+ * return size * 7
+ * elif maxsize < 128: # <<<<<<<<<<<<<<
+ * return size * 8
+ * elif maxsize < 32768:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 128) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":385
+ * return size * 7
+ * elif maxsize < 128:
+ * return size * 8 # <<<<<<<<<<<<<<
+ * elif maxsize < 32768:
+ * return size * 16
+ */
+ __pyx_r = (__pyx_v_size * 8);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":386
+ * elif maxsize < 128:
+ * return size * 8
+ * elif maxsize < 32768: # <<<<<<<<<<<<<<
+ * return size * 16
+ * else:
+ */
+ __pyx_t_5 = ((__pyx_v_maxsize < 32768) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":387
+ * return size * 8
+ * elif maxsize < 32768:
+ * return size * 16 # <<<<<<<<<<<<<<
+ * else:
+ * return size * 32
+ */
+ __pyx_r = (__pyx_v_size * 16);
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":389
+ * return size * 16
+ * else:
+ * return size * 32 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = (__pyx_v_size * 32);
+ goto __pyx_L0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":348
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef inline int calc_nb_bits(any_int_t[::1] data, cnp.uint32_t start, cnp.uint32_t stop) nogil: # <<<<<<<<<<<<<<
+ * """Calculate the number of bits needed to encode the data
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_23__pyx_fuse_3calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_3__pyx_mdef_5fabio_3ext_9mar345_IO_23__pyx_fuse_3calc_nb_bits = {"__pyx_fuse_3calc_nb_bits", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_23__pyx_fuse_3calc_nb_bits, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_9mar345_IO_8calc_nb_bits};
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_23__pyx_fuse_3calc_nb_bits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __pyx_t_5numpy_uint32_t __pyx_v_start;
+ __pyx_t_5numpy_uint32_t __pyx_v_stop;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__pyx_fuse_3calc_nb_bits (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_start,&__pyx_n_s_stop,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3calc_nb_bits", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3calc_nb_bits", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_3calc_nb_bits") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ }
+ __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_data.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_start = __Pyx_PyInt_As_npy_uint32(values[1]); if (unlikely((__pyx_v_start == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_stop = __Pyx_PyInt_As_npy_uint32(values[2]); if (unlikely((__pyx_v_stop == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3calc_nb_bits", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.__pyx_fuse_3calc_nb_bits", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_22__pyx_fuse_3calc_nb_bits(__pyx_self, __pyx_v_data, __pyx_v_start, __pyx_v_stop);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_22__pyx_fuse_3calc_nb_bits(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, __pyx_t_5numpy_uint32_t __pyx_v_start, __pyx_t_5numpy_uint32_t __pyx_v_stop) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__pyx_fuse_3calc_nb_bits", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_fuse_3__pyx_f_5fabio_3ext_9mar345_IO_calc_nb_bits(__pyx_v_data, __pyx_v_start, __pyx_v_stop, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.__pyx_fuse_3calc_nb_bits", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":396
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * def pack_image(img, bint do_precomp=True): # <<<<<<<<<<<<<<
+ * """Pack an image into a binary compressed block
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_11pack_image(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_5fabio_3ext_9mar345_IO_10pack_image[] = "Pack an image into a binary compressed block\n\n :param img: input image as numpy.int16\n :param do_precomp: perform the subtraction to the 4 neighbours's average. False is for testing the packing only\n :return: 1D array of numpy.int8\n\n JPA wrote:\n ..........\n Pack image 'img', containing 'x * y' WORD-sized pixels into byte-stream\n ";
+static PyMethodDef __pyx_mdef_5fabio_3ext_9mar345_IO_11pack_image = {"pack_image", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_11pack_image, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_9mar345_IO_10pack_image};
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_11pack_image(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_img = 0;
+ int __pyx_v_do_precomp;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("pack_image (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_img,&__pyx_n_s_do_precomp,0};
+ PyObject* values[2] = {0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_img)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_do_precomp);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pack_image") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_img = values[0];
+ if (values[1]) {
+ __pyx_v_do_precomp = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_do_precomp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+ __pyx_v_do_precomp = ((int)1);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("pack_image", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.pack_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_10pack_image(__pyx_self, __pyx_v_img, __pyx_v_do_precomp);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_10pack_image(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_img, int __pyx_v_do_precomp) {
+ __pyx_t_5numpy_uint32_t __pyx_v_nrow;
+ __pyx_t_5numpy_uint32_t __pyx_v_ncol;
+ __pyx_t_5numpy_uint32_t __pyx_v_size;
+ __Pyx_memviewslice __pyx_v_input_image = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_v_raw = { 0, 0, { 0 }, { 0 }, { 0 } };
+ struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *__pyx_v_container = 0;
+ __pyx_t_5numpy_uint32_t __pyx_v_position;
+ __pyx_t_5numpy_uint32_t __pyx_v_nb_val_packed;
+ __pyx_t_5numpy_uint32_t __pyx_v_current_block_size;
+ __pyx_t_5numpy_uint32_t __pyx_v_next_bock_size;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ Py_ssize_t __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ __pyx_t_5numpy_uint32_t __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_t_13;
+ __pyx_t_5numpy_uint32_t __pyx_t_14;
+ __pyx_t_5numpy_uint32_t __pyx_t_15;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("pack_image", 0);
+
+ /* "fabio/ext/mar345_IO.pyx":416
+ * cnp.uint32_t current_block_size, next_bock_size
+ *
+ * if do_precomp: # <<<<<<<<<<<<<<
+ * assert len(img.shape) == 2
+ * nrow = img.shape[0]
+ */
+ __pyx_t_1 = (__pyx_v_do_precomp != 0);
+ if (__pyx_t_1) {
+
+ /* "fabio/ext/mar345_IO.pyx":417
+ *
+ * if do_precomp:
+ * assert len(img.shape) == 2 # <<<<<<<<<<<<<<
+ * nrow = img.shape[0]
+ * ncol = img.shape[1]
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_img, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (unlikely(!((__pyx_t_3 == 2) != 0))) {
+ PyErr_SetNone(PyExc_AssertionError);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+
+ /* "fabio/ext/mar345_IO.pyx":418
+ * if do_precomp:
+ * assert len(img.shape) == 2
+ * nrow = img.shape[0] # <<<<<<<<<<<<<<
+ * ncol = img.shape[1]
+ * input_image = numpy.ascontiguousarray(img, dtype=numpy.int16).ravel()
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_img, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_5 = __Pyx_PyInt_As_npy_uint32(__pyx_t_4); if (unlikely((__pyx_t_5 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_nrow = __pyx_t_5;
+
+ /* "fabio/ext/mar345_IO.pyx":419
+ * assert len(img.shape) == 2
+ * nrow = img.shape[0]
+ * ncol = img.shape[1] # <<<<<<<<<<<<<<
+ * input_image = numpy.ascontiguousarray(img, dtype=numpy.int16).ravel()
+ * # pre compression: subtract the average of the 4 neighbours
+ */
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_img, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_5 = __Pyx_PyInt_As_npy_uint32(__pyx_t_2); if (unlikely((__pyx_t_5 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_ncol = __pyx_t_5;
+
+ /* "fabio/ext/mar345_IO.pyx":420
+ * nrow = img.shape[0]
+ * ncol = img.shape[1]
+ * input_image = numpy.ascontiguousarray(img, dtype=numpy.int16).ravel() # <<<<<<<<<<<<<<
+ * # pre compression: subtract the average of the 4 neighbours
+ * raw = precomp(input_image, ncol)
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_img);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_img);
+ __Pyx_GIVEREF(__pyx_v_img);
+ __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int16); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ravel); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_9 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_9)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_9);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ }
+ }
+ if (__pyx_t_9) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else {
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int16_t(__pyx_t_2);
+ if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_input_image = __pyx_t_10;
+ __pyx_t_10.memview = NULL;
+ __pyx_t_10.data = NULL;
+
+ /* "fabio/ext/mar345_IO.pyx":422
+ * input_image = numpy.ascontiguousarray(img, dtype=numpy.int16).ravel()
+ * # pre compression: subtract the average of the 4 neighbours
+ * raw = precomp(input_image, ncol) # <<<<<<<<<<<<<<
+ * size = nrow * ncol
+ * else:
+ */
+ __pyx_t_11 = __pyx_f_5fabio_3ext_9mar345_IO_precomp(__pyx_v_input_image, __pyx_v_ncol, 0); if (unlikely(!__pyx_t_11.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_raw = __pyx_t_11;
+ __pyx_t_11.memview = NULL;
+ __pyx_t_11.data = NULL;
+
+ /* "fabio/ext/mar345_IO.pyx":423
+ * # pre compression: subtract the average of the 4 neighbours
+ * raw = precomp(input_image, ncol)
+ * size = nrow * ncol # <<<<<<<<<<<<<<
+ * else:
+ * raw = numpy.ascontiguousarray(img, dtype=numpy.int32).ravel()
+ */
+ __pyx_v_size = (__pyx_v_nrow * __pyx_v_ncol);
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":425
+ * size = nrow * ncol
+ * else:
+ * raw = numpy.ascontiguousarray(img, dtype=numpy.int32).ravel() # <<<<<<<<<<<<<<
+ * size = raw.size
+ *
+ */
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__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 = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_INCREF(__pyx_v_img);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_img);
+ __Pyx_GIVEREF(__pyx_v_img);
+ __pyx_t_4 = PyDict_New(); 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_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __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_4, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_ravel); 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_8); __pyx_t_8 = 0;
+ __pyx_t_8 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_8)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_8);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ if (__pyx_t_8) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ } else {
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
+ if (unlikely(!__pyx_t_12.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_raw = __pyx_t_12;
+ __pyx_t_12.memview = NULL;
+ __pyx_t_12.data = NULL;
+
+ /* "fabio/ext/mar345_IO.pyx":426
+ * else:
+ * raw = numpy.ascontiguousarray(img, dtype=numpy.int32).ravel()
+ * size = raw.size # <<<<<<<<<<<<<<
+ *
+ * # allocation of the output buffer
+ */
+ __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_raw, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_5 = __Pyx_PyInt_As_npy_uint32(__pyx_t_4); if (unlikely((__pyx_t_5 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_size = __pyx_t_5;
+ }
+ __pyx_L3:;
+
+ /* "fabio/ext/mar345_IO.pyx":429
+ *
+ * # allocation of the output buffer
+ * container = PackContainer(size) # <<<<<<<<<<<<<<
+ *
+ * position = 0
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_npy_uint32(__pyx_v_size); 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_2 = PyTuple_New(1); 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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5fabio_3ext_9mar345_IO_PackContainer)), __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_v_container = ((struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *)__pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":431
+ * container = PackContainer(size)
+ *
+ * position = 0 # <<<<<<<<<<<<<<
+ * while position < size:
+ * nb_val_packed = 1
+ */
+ __pyx_v_position = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":432
+ *
+ * position = 0
+ * while position < size: # <<<<<<<<<<<<<<
+ * nb_val_packed = 1
+ * current_block_size = calc_nb_bits(raw, position, position + nb_val_packed)
+ */
+ while (1) {
+ __pyx_t_1 = ((__pyx_v_position < __pyx_v_size) != 0);
+ if (!__pyx_t_1) break;
+
+ /* "fabio/ext/mar345_IO.pyx":433
+ * position = 0
+ * while position < size:
+ * nb_val_packed = 1 # <<<<<<<<<<<<<<
+ * current_block_size = calc_nb_bits(raw, position, position + nb_val_packed)
+ * while ((position + nb_val_packed) < size) and (nb_val_packed < 128):
+ */
+ __pyx_v_nb_val_packed = 1;
+
+ /* "fabio/ext/mar345_IO.pyx":434
+ * while position < size:
+ * nb_val_packed = 1
+ * current_block_size = calc_nb_bits(raw, position, position + nb_val_packed) # <<<<<<<<<<<<<<
+ * while ((position + nb_val_packed) < size) and (nb_val_packed < 128):
+ * if (position + 2 * nb_val_packed) < size:
+ */
+ __pyx_v_current_block_size = __pyx_fuse_2__pyx_f_5fabio_3ext_9mar345_IO_calc_nb_bits(__pyx_v_raw, __pyx_v_position, (__pyx_v_position + __pyx_v_nb_val_packed), 0);
+
+ /* "fabio/ext/mar345_IO.pyx":435
+ * nb_val_packed = 1
+ * current_block_size = calc_nb_bits(raw, position, position + nb_val_packed)
+ * while ((position + nb_val_packed) < size) and (nb_val_packed < 128): # <<<<<<<<<<<<<<
+ * if (position + 2 * nb_val_packed) < size:
+ * next_bock_size = calc_nb_bits(raw, position + nb_val_packed, position + 2 * nb_val_packed)
+ */
+ while (1) {
+ __pyx_t_13 = (((__pyx_v_position + __pyx_v_nb_val_packed) < __pyx_v_size) != 0);
+ if (__pyx_t_13) {
+ } else {
+ __pyx_t_1 = __pyx_t_13;
+ goto __pyx_L8_bool_binop_done;
+ }
+ __pyx_t_13 = ((__pyx_v_nb_val_packed < 128) != 0);
+ __pyx_t_1 = __pyx_t_13;
+ __pyx_L8_bool_binop_done:;
+ if (!__pyx_t_1) break;
+
+ /* "fabio/ext/mar345_IO.pyx":436
+ * current_block_size = calc_nb_bits(raw, position, position + nb_val_packed)
+ * while ((position + nb_val_packed) < size) and (nb_val_packed < 128):
+ * if (position + 2 * nb_val_packed) < size: # <<<<<<<<<<<<<<
+ * next_bock_size = calc_nb_bits(raw, position + nb_val_packed, position + 2 * nb_val_packed)
+ * else:
+ */
+ __pyx_t_1 = (((__pyx_v_position + (2 * __pyx_v_nb_val_packed)) < __pyx_v_size) != 0);
+ if (__pyx_t_1) {
+
+ /* "fabio/ext/mar345_IO.pyx":437
+ * while ((position + nb_val_packed) < size) and (nb_val_packed < 128):
+ * if (position + 2 * nb_val_packed) < size:
+ * next_bock_size = calc_nb_bits(raw, position + nb_val_packed, position + 2 * nb_val_packed) # <<<<<<<<<<<<<<
+ * else:
+ * break
+ */
+ __pyx_v_next_bock_size = __pyx_fuse_2__pyx_f_5fabio_3ext_9mar345_IO_calc_nb_bits(__pyx_v_raw, (__pyx_v_position + __pyx_v_nb_val_packed), (__pyx_v_position + (2 * __pyx_v_nb_val_packed)), 0);
+ goto __pyx_L10;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":439
+ * next_bock_size = calc_nb_bits(raw, position + nb_val_packed, position + 2 * nb_val_packed)
+ * else:
+ * break # <<<<<<<<<<<<<<
+ * if 2 * max(current_block_size, next_bock_size) < (current_block_size + next_bock_size + CCP4_PCK_BLOCK_HEADER_LENGTH):
+ * nb_val_packed *= 2
+ */
+ goto __pyx_L7_break;
+ }
+ __pyx_L10:;
+
+ /* "fabio/ext/mar345_IO.pyx":440
+ * else:
+ * break
+ * if 2 * max(current_block_size, next_bock_size) < (current_block_size + next_bock_size + CCP4_PCK_BLOCK_HEADER_LENGTH): # <<<<<<<<<<<<<<
+ * nb_val_packed *= 2
+ * current_block_size = 2 * max(current_block_size, next_bock_size)
+ */
+ __pyx_t_5 = __pyx_v_next_bock_size;
+ __pyx_t_14 = __pyx_v_current_block_size;
+ if (((__pyx_t_5 > __pyx_t_14) != 0)) {
+ __pyx_t_15 = __pyx_t_5;
+ } else {
+ __pyx_t_15 = __pyx_t_14;
+ }
+ __pyx_t_1 = (((2 * __pyx_t_15) < ((__pyx_v_current_block_size + __pyx_v_next_bock_size) + __pyx_v_5fabio_3ext_9mar345_IO_CCP4_PCK_BLOCK_HEADER_LENGTH)) != 0);
+ if (__pyx_t_1) {
+
+ /* "fabio/ext/mar345_IO.pyx":441
+ * break
+ * if 2 * max(current_block_size, next_bock_size) < (current_block_size + next_bock_size + CCP4_PCK_BLOCK_HEADER_LENGTH):
+ * nb_val_packed *= 2 # <<<<<<<<<<<<<<
+ * current_block_size = 2 * max(current_block_size, next_bock_size)
+ * else:
+ */
+ __pyx_v_nb_val_packed = (__pyx_v_nb_val_packed * 2);
+
+ /* "fabio/ext/mar345_IO.pyx":442
+ * if 2 * max(current_block_size, next_bock_size) < (current_block_size + next_bock_size + CCP4_PCK_BLOCK_HEADER_LENGTH):
+ * nb_val_packed *= 2
+ * current_block_size = 2 * max(current_block_size, next_bock_size) # <<<<<<<<<<<<<<
+ * else:
+ * break
+ */
+ __pyx_t_15 = __pyx_v_next_bock_size;
+ __pyx_t_5 = __pyx_v_current_block_size;
+ if (((__pyx_t_15 > __pyx_t_5) != 0)) {
+ __pyx_t_14 = __pyx_t_15;
+ } else {
+ __pyx_t_14 = __pyx_t_5;
+ }
+ __pyx_v_current_block_size = (2 * __pyx_t_14);
+ goto __pyx_L11;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":444
+ * current_block_size = 2 * max(current_block_size, next_bock_size)
+ * else:
+ * break # <<<<<<<<<<<<<<
+ * container.append(raw, position, nb_val_packed, current_block_size)
+ * position += nb_val_packed
+ */
+ goto __pyx_L7_break;
+ }
+ __pyx_L11:;
+ }
+ __pyx_L7_break:;
+
+ /* "fabio/ext/mar345_IO.pyx":445
+ * else:
+ * break
+ * container.append(raw, position, nb_val_packed, current_block_size) # <<<<<<<<<<<<<<
+ * position += nb_val_packed
+ *
+ */
+ __pyx_t_4 = ((struct __pyx_vtabstruct_5fabio_3ext_9mar345_IO_PackContainer *)__pyx_v_container->__pyx_vtab)->append(__pyx_v_container, __pyx_v_raw, __pyx_v_position, __pyx_v_nb_val_packed, __pyx_v_current_block_size, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":446
+ * break
+ * container.append(raw, position, nb_val_packed, current_block_size)
+ * position += nb_val_packed # <<<<<<<<<<<<<<
+ *
+ * return container
+ */
+ __pyx_v_position = (__pyx_v_position + __pyx_v_nb_val_packed);
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":448
+ * position += nb_val_packed
+ *
+ * return container # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_container));
+ __pyx_r = ((PyObject *)__pyx_v_container);
+ goto __pyx_L0;
+
+ /* "fabio/ext/mar345_IO.pyx":396
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * def pack_image(img, bint do_precomp=True): # <<<<<<<<<<<<<<
+ * """Pack an image into a binary compressed block
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.pack_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_input_image, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_raw, 1);
+ __Pyx_XDECREF((PyObject *)__pyx_v_container);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":456
+ * cnp.uint8_t[::1] data
+ *
+ * def __cinit__(self, cnp.uint32_t size=4096): # <<<<<<<<<<<<<<
+ * """Constructor of the class
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ __pyx_t_5numpy_uint32_t __pyx_v_size;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,0};
+ PyObject* values[1] = {0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size);
+ if (value) { values[0] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ if (values[0]) {
+ __pyx_v_size = __Pyx_PyInt_As_npy_uint32(values[0]); if (unlikely((__pyx_v_size == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+ __pyx_v_size = ((__pyx_t_5numpy_uint32_t)4096);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.PackContainer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer___cinit__(((struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *)__pyx_v_self), __pyx_v_size);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer___cinit__(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *__pyx_v_self, __pyx_t_5numpy_uint32_t __pyx_v_size) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__cinit__", 0);
+
+ /* "fabio/ext/mar345_IO.pyx":461
+ * :param size: start size of the array
+ * """
+ * self.position = 0 # <<<<<<<<<<<<<<
+ * self.offset = 0
+ * self.allocated = size
+ */
+ __pyx_v_self->position = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":462
+ * """
+ * self.position = 0
+ * self.offset = 0 # <<<<<<<<<<<<<<
+ * self.allocated = size
+ * self.data = numpy.zeros(self.allocated, dtype=numpy.uint8)
+ */
+ __pyx_v_self->offset = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":463
+ * self.position = 0
+ * self.offset = 0
+ * self.allocated = size # <<<<<<<<<<<<<<
+ * self.data = numpy.zeros(self.allocated, dtype=numpy.uint8)
+ *
+ */
+ __pyx_v_self->allocated = __pyx_v_size;
+
+ /* "fabio/ext/mar345_IO.pyx":464
+ * self.offset = 0
+ * self.allocated = size
+ * self.data = numpy.zeros(self.allocated, dtype=numpy.uint8) # <<<<<<<<<<<<<<
+ *
+ * def __dealloc__(self):
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_v_self->allocated); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __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 = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 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 = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __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 = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(__pyx_t_5);
+ if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_self->data, 0);
+ __pyx_v_self->data = __pyx_t_6;
+ __pyx_t_6.memview = NULL;
+ __pyx_t_6.data = NULL;
+
+ /* "fabio/ext/mar345_IO.pyx":456
+ * cnp.uint8_t[::1] data
+ *
+ * def __cinit__(self, cnp.uint32_t size=4096): # <<<<<<<<<<<<<<
+ * """Constructor of the class
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.PackContainer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":466
+ * self.data = numpy.zeros(self.allocated, dtype=numpy.uint8)
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * self.data = None
+ *
+ */
+
+/* Python wrapper */
+static void __pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_3__dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_2__dealloc__(((struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_2__dealloc__(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "fabio/ext/mar345_IO.pyx":467
+ *
+ * def __dealloc__(self):
+ * self.data = None # <<<<<<<<<<<<<<
+ *
+ * def get(self):
+ */
+ __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(Py_None);
+ if (unlikely(!__pyx_t_1.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_XDEC_MEMVIEW(&__pyx_v_self->data, 0);
+ __pyx_v_self->data = __pyx_t_1;
+ __pyx_t_1.memview = NULL;
+ __pyx_t_1.data = NULL;
+
+ /* "fabio/ext/mar345_IO.pyx":466
+ * self.data = numpy.zeros(self.allocated, dtype=numpy.uint8)
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * self.data = None
+ *
+ */
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
+ __Pyx_WriteUnraisable("fabio.ext.mar345_IO.PackContainer.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "fabio/ext/mar345_IO.pyx":469
+ * self.data = None
+ *
+ * def get(self): # <<<<<<<<<<<<<<
+ * """retrieve the populated array"""
+ * if self.offset:
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_5fabio_3ext_9mar345_IO_13PackContainer_4get[] = "retrieve the populated array";
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("get (wrapper)", 0);
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_4get(((struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_4get(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *__pyx_v_self) {
+ long __pyx_v_end;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __pyx_t_5numpy_uint32_t __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_t_8;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("get", 0);
+
+ /* "fabio/ext/mar345_IO.pyx":471
+ * def get(self):
+ * """retrieve the populated array"""
+ * if self.offset: # <<<<<<<<<<<<<<
+ * end = self.position + 1
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_self->offset != 0);
+ if (__pyx_t_1) {
+
+ /* "fabio/ext/mar345_IO.pyx":472
+ * """retrieve the populated array"""
+ * if self.offset:
+ * end = self.position + 1 # <<<<<<<<<<<<<<
+ * else:
+ * end = self.position
+ */
+ __pyx_v_end = (__pyx_v_self->position + 1);
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":474
+ * end = self.position + 1
+ * else:
+ * end = self.position # <<<<<<<<<<<<<<
+ * return numpy.asarray(self.data[:end])
+ *
+ */
+ __pyx_t_2 = __pyx_v_self->position;
+ __pyx_v_end = __pyx_t_2;
+ }
+ __pyx_L3:;
+
+ /* "fabio/ext/mar345_IO.pyx":475
+ * else:
+ * end = self.position
+ * return numpy.asarray(self.data[:end]) # <<<<<<<<<<<<<<
+ *
+ * @cython.boundscheck(False)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ __pyx_t_6 = __pyx_v_self->data;
+ __PYX_INC_MEMVIEW(&__pyx_t_6, 1);
+ __pyx_t_8 = -1;
+ __pyx_t_7.data = __pyx_t_6.data;
+ __pyx_t_7.memview = __pyx_t_6.memview;
+ __PYX_INC_MEMVIEW(&__pyx_t_7, 0);
+ if (unlikely(__pyx_memoryview_slice_memviewslice(
+ &__pyx_t_7,
+ __pyx_t_6.shape[0], __pyx_t_6.strides[0], __pyx_t_6.suboffsets[0],
+ 0,
+ 0,
+ &__pyx_t_8,
+ 0,
+ __pyx_v_end,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1) < 0))
+{
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+}
+
+__PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
+ __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_t_7, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
+ __pyx_t_9 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_9)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_9);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ }
+ }
+ if (!__pyx_t_9) {
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else {
+ __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __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_t_9 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "fabio/ext/mar345_IO.pyx":469
+ * self.data = None
+ *
+ * def get(self): # <<<<<<<<<<<<<<
+ * """retrieve the populated array"""
+ * if self.offset:
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.PackContainer.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":481
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef append(self, cnp.int32_t[::1] data, cnp.uint32_t position, cnp.uint32_t nb_val, cnp.uint32_t block_size): # <<<<<<<<<<<<<<
+ * """Append a block of data[position: position+nb_val] to the compressed
+ * stream. Only the most significant bits are takes.
+ */
+
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_7append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_5fabio_3ext_9mar345_IO_13PackContainer_append(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *__pyx_v_self, __Pyx_memviewslice __pyx_v_data, __pyx_t_5numpy_uint32_t __pyx_v_position, __pyx_t_5numpy_uint32_t __pyx_v_nb_val, __pyx_t_5numpy_uint32_t __pyx_v_block_size, int __pyx_skip_dispatch) {
+ __pyx_t_5numpy_uint32_t __pyx_v_i;
+ __pyx_t_5numpy_uint32_t __pyx_v_bit_per_val;
+ __pyx_t_5numpy_uint32_t __pyx_v_nb_bytes;
+ __pyx_t_5numpy_uint64_t __pyx_v_tmp;
+ __pyx_t_5numpy_uint64_t __pyx_v_tostore;
+ __pyx_t_5numpy_uint64_t __pyx_v_mask;
+ __pyx_t_5numpy_int64_t __pyx_v_topack;
+ PyObject *__pyx_v_new_stream = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ Py_ssize_t __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
+ int __pyx_t_11;
+ __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_t_14;
+ __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __pyx_t_5numpy_uint32_t __pyx_t_16;
+ __pyx_t_5numpy_uint32_t __pyx_t_17;
+ __pyx_t_5numpy_uint32_t __pyx_t_18;
+ __pyx_t_5numpy_uint32_t __pyx_t_19;
+ __pyx_t_5numpy_uint32_t __pyx_t_20;
+ __pyx_t_5numpy_uint32_t __pyx_t_21;
+ __pyx_t_5numpy_uint32_t __pyx_t_22;
+ __pyx_t_5numpy_uint32_t __pyx_t_23;
+ __pyx_t_5numpy_uint32_t __pyx_t_24;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("append", 0);
+ /* Check if called by wrapper */
+ if (unlikely(__pyx_skip_dispatch)) ;
+ /* Check if overridden in Python */
+ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_append); 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);
+ if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_7append)) {
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; 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);
+ __pyx_t_4 = __Pyx_PyInt_From_npy_uint32(__pyx_v_position); 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_t_5 = __Pyx_PyInt_From_npy_uint32(__pyx_v_nb_val); 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_6 = __Pyx_PyInt_From_npy_uint32(__pyx_v_block_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_7 = __pyx_t_1; __pyx_t_8 = NULL;
+ __pyx_t_9 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_8)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_8);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ __pyx_t_9 = 1;
+ }
+ }
+ __pyx_t_10 = PyTuple_New(4+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __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_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_9, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ __pyx_t_3 = 0;
+ __pyx_t_4 = 0;
+ __pyx_t_5 = 0;
+ __pyx_t_6 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); 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_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ goto __pyx_L0;
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":497
+ * cnp.int64_t topack
+ *
+ * bit_per_val = block_size // nb_val # <<<<<<<<<<<<<<
+ *
+ * # realloc memory if needed
+ */
+ __pyx_v_bit_per_val = (__pyx_v_block_size / __pyx_v_nb_val);
+
+ /* "fabio/ext/mar345_IO.pyx":500
+ *
+ * # realloc memory if needed
+ * nb_bytes = (CCP4_PCK_BLOCK_HEADER_LENGTH + block_size + 7) // 8 # <<<<<<<<<<<<<<
+ * if self.position + nb_bytes >= self.allocated:
+ * self.allocated *= 2
+ */
+ __pyx_v_nb_bytes = (((__pyx_v_5fabio_3ext_9mar345_IO_CCP4_PCK_BLOCK_HEADER_LENGTH + __pyx_v_block_size) + 7) / 8);
+
+ /* "fabio/ext/mar345_IO.pyx":501
+ * # realloc memory if needed
+ * nb_bytes = (CCP4_PCK_BLOCK_HEADER_LENGTH + block_size + 7) // 8
+ * if self.position + nb_bytes >= self.allocated: # <<<<<<<<<<<<<<
+ * self.allocated *= 2
+ * new_stream = numpy.zeros(self.allocated, dtype=numpy.uint8)
+ */
+ __pyx_t_11 = (((__pyx_v_self->position + __pyx_v_nb_bytes) >= __pyx_v_self->allocated) != 0);
+ if (__pyx_t_11) {
+
+ /* "fabio/ext/mar345_IO.pyx":502
+ * nb_bytes = (CCP4_PCK_BLOCK_HEADER_LENGTH + block_size + 7) // 8
+ * if self.position + nb_bytes >= self.allocated:
+ * self.allocated *= 2 # <<<<<<<<<<<<<<
+ * new_stream = numpy.zeros(self.allocated, dtype=numpy.uint8)
+ * if self.offset:
+ */
+ __pyx_v_self->allocated = (__pyx_v_self->allocated * 2);
+
+ /* "fabio/ext/mar345_IO.pyx":503
+ * if self.position + nb_bytes >= self.allocated:
+ * self.allocated *= 2
+ * new_stream = numpy.zeros(self.allocated, dtype=numpy.uint8) # <<<<<<<<<<<<<<
+ * if self.offset:
+ * new_stream[:self.position + 1] = self.data[:self.position + 1]
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_v_self->allocated); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __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_t_1 = 0;
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_new_stream = __pyx_t_6;
+ __pyx_t_6 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":504
+ * self.allocated *= 2
+ * new_stream = numpy.zeros(self.allocated, dtype=numpy.uint8)
+ * if self.offset: # <<<<<<<<<<<<<<
+ * new_stream[:self.position + 1] = self.data[:self.position + 1]
+ * else:
+ */
+ __pyx_t_11 = (__pyx_v_self->offset != 0);
+ if (__pyx_t_11) {
+
+ /* "fabio/ext/mar345_IO.pyx":505
+ * new_stream = numpy.zeros(self.allocated, dtype=numpy.uint8)
+ * if self.offset:
+ * new_stream[:self.position + 1] = self.data[:self.position + 1] # <<<<<<<<<<<<<<
+ * else:
+ * new_stream[:self.position] = self.data[:self.position]
+ */
+ __pyx_t_12 = __pyx_v_self->data;
+ __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
+ __pyx_t_14 = -1;
+ __pyx_t_13.data = __pyx_t_12.data;
+ __pyx_t_13.memview = __pyx_t_12.memview;
+ __PYX_INC_MEMVIEW(&__pyx_t_13, 0);
+ if (unlikely(__pyx_memoryview_slice_memviewslice(
+ &__pyx_t_13,
+ __pyx_t_12.shape[0], __pyx_t_12.strides[0], __pyx_t_12.suboffsets[0],
+ 0,
+ 0,
+ &__pyx_t_14,
+ 0,
+ (__pyx_v_self->position + 1),
+ 0,
+ 0,
+ 1,
+ 0,
+ 1) < 0))
+{
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+}
+
+__PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
+ __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_13, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
+ if (__Pyx_PyObject_SetSlice(__pyx_v_new_stream, __pyx_t_6, 0, (__pyx_v_self->position + 1), NULL, NULL, NULL, 0, 1, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":507
+ * new_stream[:self.position + 1] = self.data[:self.position + 1]
+ * else:
+ * new_stream[:self.position] = self.data[:self.position] # <<<<<<<<<<<<<<
+ * self.data = new_stream
+ *
+ */
+ __pyx_t_12 = __pyx_v_self->data;
+ __PYX_INC_MEMVIEW(&__pyx_t_12, 1);
+ __pyx_t_14 = -1;
+ __pyx_t_15.data = __pyx_t_12.data;
+ __pyx_t_15.memview = __pyx_t_12.memview;
+ __PYX_INC_MEMVIEW(&__pyx_t_15, 0);
+ if (unlikely(__pyx_memoryview_slice_memviewslice(
+ &__pyx_t_15,
+ __pyx_t_12.shape[0], __pyx_t_12.strides[0], __pyx_t_12.suboffsets[0],
+ 0,
+ 0,
+ &__pyx_t_14,
+ 0,
+ __pyx_v_self->position,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1) < 0))
+{
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+}
+
+__PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
+ __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_15, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1);
+ if (__Pyx_PyObject_SetSlice(__pyx_v_new_stream, __pyx_t_6, 0, __pyx_v_self->position, NULL, NULL, NULL, 0, 1, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __pyx_L4:;
+
+ /* "fabio/ext/mar345_IO.pyx":508
+ * else:
+ * new_stream[:self.position] = self.data[:self.position]
+ * self.data = new_stream # <<<<<<<<<<<<<<
+ *
+ * with nogil:
+ */
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(__pyx_v_new_stream);
+ if (unlikely(!__pyx_t_12.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_XDEC_MEMVIEW(&__pyx_v_self->data, 0);
+ __pyx_v_self->data = __pyx_t_12;
+ __pyx_t_12.memview = NULL;
+ __pyx_t_12.data = NULL;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "fabio/ext/mar345_IO.pyx":510
+ * self.data = new_stream
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * if self.offset == 0:
+ * tmp = 0
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":511
+ *
+ * with nogil:
+ * if self.offset == 0: # <<<<<<<<<<<<<<
+ * tmp = 0
+ * else:
+ */
+ __pyx_t_11 = ((__pyx_v_self->offset == 0) != 0);
+ if (__pyx_t_11) {
+
+ /* "fabio/ext/mar345_IO.pyx":512
+ * with nogil:
+ * if self.offset == 0:
+ * tmp = 0 # <<<<<<<<<<<<<<
+ * else:
+ * tmp = self.data[self.position]
+ */
+ __pyx_v_tmp = 0;
+ goto __pyx_L8;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":514
+ * tmp = 0
+ * else:
+ * tmp = self.data[self.position] # <<<<<<<<<<<<<<
+ *
+ * # append 6 bits of header
+ */
+ __pyx_t_16 = __pyx_v_self->position;
+ __pyx_v_tmp = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint8_t *) __pyx_v_self->data.data) + __pyx_t_16)) )));
+ }
+ __pyx_L8:;
+
+ /* "fabio/ext/mar345_IO.pyx":517
+ *
+ * # append 6 bits of header
+ * tmp |= pack_nb_val(nb_val, bit_per_val) << self.offset # <<<<<<<<<<<<<<
+ * self.offset += CCP4_PCK_BLOCK_HEADER_LENGTH
+ * self.data[self.position] = tmp & (255)
+ */
+ __pyx_v_tmp = (__pyx_v_tmp | (__pyx_f_5fabio_3ext_9mar345_IO_pack_nb_val(__pyx_v_nb_val, __pyx_v_bit_per_val, 0) << __pyx_v_self->offset));
+
+ /* "fabio/ext/mar345_IO.pyx":518
+ * # append 6 bits of header
+ * tmp |= pack_nb_val(nb_val, bit_per_val) << self.offset
+ * self.offset += CCP4_PCK_BLOCK_HEADER_LENGTH # <<<<<<<<<<<<<<
+ * self.data[self.position] = tmp & (255)
+ * if self.offset >= 8:
+ */
+ __pyx_v_self->offset = (__pyx_v_self->offset + __pyx_v_5fabio_3ext_9mar345_IO_CCP4_PCK_BLOCK_HEADER_LENGTH);
+
+ /* "fabio/ext/mar345_IO.pyx":519
+ * tmp |= pack_nb_val(nb_val, bit_per_val) << self.offset
+ * self.offset += CCP4_PCK_BLOCK_HEADER_LENGTH
+ * self.data[self.position] = tmp & (255) # <<<<<<<<<<<<<<
+ * if self.offset >= 8:
+ * self.position += 1
+ */
+ __pyx_t_17 = __pyx_v_self->position;
+ *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint8_t *) __pyx_v_self->data.data) + __pyx_t_17)) )) = (__pyx_v_tmp & 255);
+
+ /* "fabio/ext/mar345_IO.pyx":520
+ * self.offset += CCP4_PCK_BLOCK_HEADER_LENGTH
+ * self.data[self.position] = tmp & (255)
+ * if self.offset >= 8: # <<<<<<<<<<<<<<
+ * self.position += 1
+ * self.offset -= 8
+ */
+ __pyx_t_11 = ((__pyx_v_self->offset >= 8) != 0);
+ if (__pyx_t_11) {
+
+ /* "fabio/ext/mar345_IO.pyx":521
+ * self.data[self.position] = tmp & (255)
+ * if self.offset >= 8:
+ * self.position += 1 # <<<<<<<<<<<<<<
+ * self.offset -= 8
+ * self.data[self.position] = (tmp >> 8) & (255)
+ */
+ __pyx_v_self->position = (__pyx_v_self->position + 1);
+
+ /* "fabio/ext/mar345_IO.pyx":522
+ * if self.offset >= 8:
+ * self.position += 1
+ * self.offset -= 8 # <<<<<<<<<<<<<<
+ * self.data[self.position] = (tmp >> 8) & (255)
+ *
+ */
+ __pyx_v_self->offset = (__pyx_v_self->offset - 8);
+
+ /* "fabio/ext/mar345_IO.pyx":523
+ * self.position += 1
+ * self.offset -= 8
+ * self.data[self.position] = (tmp >> 8) & (255) # <<<<<<<<<<<<<<
+ *
+ * # now pack every value in input stream"
+ */
+ __pyx_t_18 = __pyx_v_self->position;
+ *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint8_t *) __pyx_v_self->data.data) + __pyx_t_18)) )) = ((__pyx_v_tmp >> 8) & 255);
+ goto __pyx_L9;
+ }
+ __pyx_L9:;
+
+ /* "fabio/ext/mar345_IO.pyx":526
+ *
+ * # now pack every value in input stream"
+ * for i in range(nb_val): # <<<<<<<<<<<<<<
+ * topack = data[position + i]
+ *
+ */
+ __pyx_t_19 = __pyx_v_nb_val;
+ for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
+ __pyx_v_i = __pyx_t_20;
+
+ /* "fabio/ext/mar345_IO.pyx":527
+ * # now pack every value in input stream"
+ * for i in range(nb_val):
+ * topack = data[position + i] # <<<<<<<<<<<<<<
+ *
+ * mask = ((1 << (bit_per_val - 1)) - 1)
+ */
+ __pyx_t_21 = (__pyx_v_position + __pyx_v_i);
+ __pyx_v_topack = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_data.data) + __pyx_t_21)) )));
+
+ /* "fabio/ext/mar345_IO.pyx":529
+ * topack = data[position + i]
+ *
+ * mask = ((1 << (bit_per_val - 1)) - 1) # <<<<<<<<<<<<<<
+ * tmp = (topack & mask)
+ * if topack < 0:
+ */
+ __pyx_v_mask = ((1 << (__pyx_v_bit_per_val - 1)) - 1);
+
+ /* "fabio/ext/mar345_IO.pyx":530
+ *
+ * mask = ((1 << (bit_per_val - 1)) - 1)
+ * tmp = (topack & mask) # <<<<<<<<<<<<<<
+ * if topack < 0:
+ * # handle the sign
+ */
+ __pyx_v_tmp = (__pyx_v_topack & __pyx_v_mask);
+
+ /* "fabio/ext/mar345_IO.pyx":531
+ * mask = ((1 << (bit_per_val - 1)) - 1)
+ * tmp = (topack & mask)
+ * if topack < 0: # <<<<<<<<<<<<<<
+ * # handle the sign
+ * tmp |= 1 << (bit_per_val - 1)
+ */
+ __pyx_t_11 = ((__pyx_v_topack < 0) != 0);
+ if (__pyx_t_11) {
+
+ /* "fabio/ext/mar345_IO.pyx":533
+ * if topack < 0:
+ * # handle the sign
+ * tmp |= 1 << (bit_per_val - 1) # <<<<<<<<<<<<<<
+ *
+ * # read last position
+ */
+ __pyx_v_tmp = (__pyx_v_tmp | (1 << (__pyx_v_bit_per_val - 1)));
+ goto __pyx_L12;
+ }
+ __pyx_L12:;
+
+ /* "fabio/ext/mar345_IO.pyx":536
+ *
+ * # read last position
+ * if self.offset == 0: # <<<<<<<<<<<<<<
+ * tostore = 0
+ * else:
+ */
+ __pyx_t_11 = ((__pyx_v_self->offset == 0) != 0);
+ if (__pyx_t_11) {
+
+ /* "fabio/ext/mar345_IO.pyx":537
+ * # read last position
+ * if self.offset == 0:
+ * tostore = 0 # <<<<<<<<<<<<<<
+ * else:
+ * tostore = self.data[self.position]
+ */
+ __pyx_v_tostore = 0;
+ goto __pyx_L13;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":539
+ * tostore = 0
+ * else:
+ * tostore = self.data[self.position] # <<<<<<<<<<<<<<
+ *
+ * tostore |= tmp << self.offset
+ */
+ __pyx_t_22 = __pyx_v_self->position;
+ __pyx_v_tostore = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint8_t *) __pyx_v_self->data.data) + __pyx_t_22)) )));
+ }
+ __pyx_L13:;
+
+ /* "fabio/ext/mar345_IO.pyx":541
+ * tostore = self.data[self.position]
+ *
+ * tostore |= tmp << self.offset # <<<<<<<<<<<<<<
+ * self.offset += bit_per_val
+ *
+ */
+ __pyx_v_tostore = (__pyx_v_tostore | (__pyx_v_tmp << __pyx_v_self->offset));
+
+ /* "fabio/ext/mar345_IO.pyx":542
+ *
+ * tostore |= tmp << self.offset
+ * self.offset += bit_per_val # <<<<<<<<<<<<<<
+ *
+ * # Update the array
+ */
+ __pyx_v_self->offset = (__pyx_v_self->offset + __pyx_v_bit_per_val);
+
+ /* "fabio/ext/mar345_IO.pyx":545
+ *
+ * # Update the array
+ * self.data[self.position] = tostore & (255) # <<<<<<<<<<<<<<
+ * while self.offset >= 8:
+ * tostore = tostore >> 8
+ */
+ __pyx_t_23 = __pyx_v_self->position;
+ *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint8_t *) __pyx_v_self->data.data) + __pyx_t_23)) )) = (__pyx_v_tostore & 255);
+
+ /* "fabio/ext/mar345_IO.pyx":546
+ * # Update the array
+ * self.data[self.position] = tostore & (255)
+ * while self.offset >= 8: # <<<<<<<<<<<<<<
+ * tostore = tostore >> 8
+ * self.offset -= 8
+ */
+ while (1) {
+ __pyx_t_11 = ((__pyx_v_self->offset >= 8) != 0);
+ if (!__pyx_t_11) break;
+
+ /* "fabio/ext/mar345_IO.pyx":547
+ * self.data[self.position] = tostore & (255)
+ * while self.offset >= 8:
+ * tostore = tostore >> 8 # <<<<<<<<<<<<<<
+ * self.offset -= 8
+ * self.position += 1
+ */
+ __pyx_v_tostore = (__pyx_v_tostore >> 8);
+
+ /* "fabio/ext/mar345_IO.pyx":548
+ * while self.offset >= 8:
+ * tostore = tostore >> 8
+ * self.offset -= 8 # <<<<<<<<<<<<<<
+ * self.position += 1
+ * self.data[self.position] = tostore & (255)
+ */
+ __pyx_v_self->offset = (__pyx_v_self->offset - 8);
+
+ /* "fabio/ext/mar345_IO.pyx":549
+ * tostore = tostore >> 8
+ * self.offset -= 8
+ * self.position += 1 # <<<<<<<<<<<<<<
+ * self.data[self.position] = tostore & (255)
+ *
+ */
+ __pyx_v_self->position = (__pyx_v_self->position + 1);
+
+ /* "fabio/ext/mar345_IO.pyx":550
+ * self.offset -= 8
+ * self.position += 1
+ * self.data[self.position] = tostore & (255) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_24 = __pyx_v_self->position;
+ *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint8_t *) __pyx_v_self->data.data) + __pyx_t_24)) )) = (__pyx_v_tostore & 255);
+ }
+ }
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":510
+ * self.data = new_stream
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * if self.offset == 0:
+ * tmp = 0
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
+ }
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":481
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef append(self, cnp.int32_t[::1] data, cnp.uint32_t position, cnp.uint32_t nb_val, cnp.uint32_t block_size): # <<<<<<<<<<<<<<
+ * """Append a block of data[position: position+nb_val] to the compressed
+ * stream. Only the most significant bits are takes.
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_10);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.PackContainer.append", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_new_stream);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_7append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_5fabio_3ext_9mar345_IO_13PackContainer_6append[] = "Append a block of data[position: position+nb_val] to the compressed\n stream. Only the most significant bits are takes.\n\n :param data: input uncompressed image as 1D array\n :param position: start position of reading of the image\n :param nb_val: number of value from data to pack in the block\n :param block_size: number of bits for the whole block\n\n The 6 bits header is managed here as well as the stream resizing.\n ";
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_7append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __pyx_t_5numpy_uint32_t __pyx_v_position;
+ __pyx_t_5numpy_uint32_t __pyx_v_nb_val;
+ __pyx_t_5numpy_uint32_t __pyx_v_block_size;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("append (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_position,&__pyx_n_s_nb_val,&__pyx_n_s_block_size,0};
+ PyObject* values[4] = {0,0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_position)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("append", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nb_val)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("append", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 3:
+ if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_block_size)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("append", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "append") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ }
+ __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_data.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_position = __Pyx_PyInt_As_npy_uint32(values[1]); if (unlikely((__pyx_v_position == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_nb_val = __Pyx_PyInt_As_npy_uint32(values[2]); if (unlikely((__pyx_v_nb_val == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_block_size = __Pyx_PyInt_As_npy_uint32(values[3]); if (unlikely((__pyx_v_block_size == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("append", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.PackContainer.append", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_6append(((struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *)__pyx_v_self), __pyx_v_data, __pyx_v_position, __pyx_v_nb_val, __pyx_v_block_size);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_6append(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *__pyx_v_self, __Pyx_memviewslice __pyx_v_data, __pyx_t_5numpy_uint32_t __pyx_v_position, __pyx_t_5numpy_uint32_t __pyx_v_nb_val, __pyx_t_5numpy_uint32_t __pyx_v_block_size) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("append", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_5fabio_3ext_9mar345_IO_13PackContainer_append(__pyx_v_self, __pyx_v_data, __pyx_v_position, __pyx_v_nb_val, __pyx_v_block_size, 1); 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_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.PackContainer.append", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_data, 1);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":453
+ * cdef class PackContainer:
+ * cdef:
+ * readonly cnp.uint32_t position, offset, allocated # <<<<<<<<<<<<<<
+ * cnp.uint8_t[::1] data
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_8position_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_8position_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_8position___get__(((struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_8position___get__(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_v_self->position); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.PackContainer.position.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_6offset_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_6offset_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_6offset___get__(((struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_6offset___get__(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_v_self->offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.PackContainer.offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_9allocated_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_9allocated_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_9allocated___get__(((struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_13PackContainer_9allocated___get__(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_v_self->allocated); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.PackContainer.allocated.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":553
+ *
+ *
+ * cpdef inline cnp.uint8_t pack_nb_val(cnp.uint8_t nb_val, cnp.uint8_t value_size) nogil: # <<<<<<<<<<<<<<
+ * """Calculate the header to be stored in 6 bits
+ *
+ */
+
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_13pack_nb_val(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_5fabio_3ext_9mar345_IO_pack_nb_val(__pyx_t_5numpy_uint8_t __pyx_v_nb_val, __pyx_t_5numpy_uint8_t __pyx_v_value_size, CYTHON_UNUSED int __pyx_skip_dispatch) {
+ __pyx_t_5numpy_uint32_t __pyx_v_value;
+ __pyx_t_5numpy_uint32_t __pyx_v_i;
+ __pyx_t_5numpy_uint8_t __pyx_r;
+ __pyx_t_5numpy_uint32_t __pyx_t_1;
+ int __pyx_t_2;
+
+ /* "fabio/ext/mar345_IO.pyx":563
+ * cnp.uint32_t value, i
+ *
+ * value = 0 # <<<<<<<<<<<<<<
+ * for i in range(8):
+ * if (nb_val >> i) == 1:
+ */
+ __pyx_v_value = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":564
+ *
+ * value = 0
+ * for i in range(8): # <<<<<<<<<<<<<<
+ * if (nb_val >> i) == 1:
+ * value |= i
+ */
+ for (__pyx_t_1 = 0; __pyx_t_1 < 8; __pyx_t_1+=1) {
+ __pyx_v_i = __pyx_t_1;
+
+ /* "fabio/ext/mar345_IO.pyx":565
+ * value = 0
+ * for i in range(8):
+ * if (nb_val >> i) == 1: # <<<<<<<<<<<<<<
+ * value |= i
+ * break
+ */
+ __pyx_t_2 = (((__pyx_v_nb_val >> __pyx_v_i) == 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "fabio/ext/mar345_IO.pyx":566
+ * for i in range(8):
+ * if (nb_val >> i) == 1:
+ * value |= i # <<<<<<<<<<<<<<
+ * break
+ * value |= (CCP4_BITSIZE[value_size]) << (CCP4_PCK_BLOCK_HEADER_LENGTH >> 1)
+ */
+ __pyx_v_value = (__pyx_v_value | __pyx_v_i);
+
+ /* "fabio/ext/mar345_IO.pyx":567
+ * if (nb_val >> i) == 1:
+ * value |= i
+ * break # <<<<<<<<<<<<<<
+ * value |= (CCP4_BITSIZE[value_size]) << (CCP4_PCK_BLOCK_HEADER_LENGTH >> 1)
+ * # should be 6/2 = 3
+ */
+ goto __pyx_L4_break;
+ }
+ }
+ __pyx_L4_break:;
+
+ /* "fabio/ext/mar345_IO.pyx":568
+ * value |= i
+ * break
+ * value |= (CCP4_BITSIZE[value_size]) << (CCP4_PCK_BLOCK_HEADER_LENGTH >> 1) # <<<<<<<<<<<<<<
+ * # should be 6/2 = 3
+ * return value
+ */
+ __pyx_v_value = (__pyx_v_value | ((__pyx_v_5fabio_3ext_9mar345_IO_CCP4_BITSIZE[__pyx_v_value_size]) << (__pyx_v_5fabio_3ext_9mar345_IO_CCP4_PCK_BLOCK_HEADER_LENGTH >> 1)));
+
+ /* "fabio/ext/mar345_IO.pyx":570
+ * value |= (CCP4_BITSIZE[value_size]) << (CCP4_PCK_BLOCK_HEADER_LENGTH >> 1)
+ * # should be 6/2 = 3
+ * return value # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_value;
+ goto __pyx_L0;
+
+ /* "fabio/ext/mar345_IO.pyx":553
+ *
+ *
+ * cpdef inline cnp.uint8_t pack_nb_val(cnp.uint8_t nb_val, cnp.uint8_t value_size) nogil: # <<<<<<<<<<<<<<
+ * """Calculate the header to be stored in 6 bits
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_13pack_nb_val(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_5fabio_3ext_9mar345_IO_12pack_nb_val[] = "Calculate the header to be stored in 6 bits\n\n :param nb_val: number of values to be stored: must be a power of 2 <=128\n :param value_size: can be 0, 4, 5, 6, 7, 8, 16 or 32, the number of bits per value\n :return: the header as an unsigned char\n ";
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_13pack_nb_val(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ __pyx_t_5numpy_uint8_t __pyx_v_nb_val;
+ __pyx_t_5numpy_uint8_t __pyx_v_value_size;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("pack_nb_val (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nb_val,&__pyx_n_s_value_size,0};
+ PyObject* values[2] = {0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nb_val)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value_size)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("pack_nb_val", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pack_nb_val") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ }
+ __pyx_v_nb_val = __Pyx_PyInt_As_npy_uint8(values[0]); if (unlikely((__pyx_v_nb_val == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_value_size = __Pyx_PyInt_As_npy_uint8(values[1]); if (unlikely((__pyx_v_value_size == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("pack_nb_val", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.pack_nb_val", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_12pack_nb_val(__pyx_self, __pyx_v_nb_val, __pyx_v_value_size);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_12pack_nb_val(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_uint8_t __pyx_v_nb_val, __pyx_t_5numpy_uint8_t __pyx_v_value_size) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("pack_nb_val", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_npy_uint8(__pyx_f_5fabio_3ext_9mar345_IO_pack_nb_val(__pyx_v_nb_val, __pyx_v_value_size, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.pack_nb_val", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":580
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef UnpackContainer unpack_pck(cnp.uint8_t[::1] stream, int ncol, int nrow): # <<<<<<<<<<<<<<
+ * """Unpack the raw stream and return the image
+ * V1 only for now, V2 may be added later
+ */
+
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15unpack_pck(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_f_5fabio_3ext_9mar345_IO_unpack_pck(__Pyx_memviewslice __pyx_v_stream, int __pyx_v_ncol, int __pyx_v_nrow, CYTHON_UNUSED int __pyx_skip_dispatch) {
+ __pyx_t_5numpy_uint32_t __pyx_v_offset;
+ __pyx_t_5numpy_uint32_t __pyx_v_pos;
+ __pyx_t_5numpy_uint32_t __pyx_v_size;
+ __pyx_t_5numpy_int32_t __pyx_v_value;
+ __pyx_t_5numpy_int32_t __pyx_v_next;
+ __pyx_t_5numpy_uint32_t __pyx_v_nb_val_packed;
+ __pyx_t_5numpy_uint32_t __pyx_v_nb_bit_per_val;
+ __pyx_t_5numpy_uint32_t __pyx_v_nb_bit_in_block;
+ struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_cont = 0;
+ struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ __pyx_t_5numpy_uint32_t __pyx_t_4;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ __pyx_t_5numpy_uint32_t __pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("unpack_pck", 0);
+
+ /* "fabio/ext/mar345_IO.pyx":597
+ * UnpackContainer cont # Container with unpacked data
+ *
+ * cont = UnpackContainer(ncol, nrow) # <<<<<<<<<<<<<<
+ * size = stream.size
+ *
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ncol); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nrow); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __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 = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5fabio_3ext_9mar345_IO_UnpackContainer)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_cont = ((struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":598
+ *
+ * cont = UnpackContainer(ncol, nrow)
+ * size = stream.size # <<<<<<<<<<<<<<
+ *
+ * # Luckily we start at byte boundary
+ */
+ __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_stream, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __Pyx_PyInt_As_npy_uint32(__pyx_t_3); if (unlikely((__pyx_t_4 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_size = __pyx_t_4;
+
+ /* "fabio/ext/mar345_IO.pyx":601
+ *
+ * # Luckily we start at byte boundary
+ * offset = 0 # <<<<<<<<<<<<<<
+ * pos = 0
+ *
+ */
+ __pyx_v_offset = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":602
+ * # Luckily we start at byte boundary
+ * offset = 0
+ * pos = 0 # <<<<<<<<<<<<<<
+ *
+ * while pos < (size) and cont.position < (cont.size):
+ */
+ __pyx_v_pos = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":604
+ * pos = 0
+ *
+ * while pos < (size) and cont.position < (cont.size): # <<<<<<<<<<<<<<
+ * value = stream[pos]
+ * if offset > (8 - CCP4_PCK_BLOCK_HEADER_LENGTH):
+ */
+ while (1) {
+ __pyx_t_6 = ((__pyx_v_pos < __pyx_v_size) != 0);
+ if (__pyx_t_6) {
+ } else {
+ __pyx_t_5 = __pyx_t_6;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_6 = ((__pyx_v_cont->position < __pyx_v_cont->size) != 0);
+ __pyx_t_5 = __pyx_t_6;
+ __pyx_L5_bool_binop_done:;
+ if (!__pyx_t_5) break;
+
+ /* "fabio/ext/mar345_IO.pyx":605
+ *
+ * while pos < (size) and cont.position < (cont.size):
+ * value = stream[pos] # <<<<<<<<<<<<<<
+ * if offset > (8 - CCP4_PCK_BLOCK_HEADER_LENGTH):
+ * # wrap around
+ */
+ __pyx_t_4 = __pyx_v_pos;
+ __pyx_v_value = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint8_t *) __pyx_v_stream.data) + __pyx_t_4)) )));
+
+ /* "fabio/ext/mar345_IO.pyx":606
+ * while pos < (size) and cont.position < (cont.size):
+ * value = stream[pos]
+ * if offset > (8 - CCP4_PCK_BLOCK_HEADER_LENGTH): # <<<<<<<<<<<<<<
+ * # wrap around
+ * pos += 1
+ */
+ __pyx_t_5 = ((__pyx_v_offset > (8 - __pyx_v_5fabio_3ext_9mar345_IO_CCP4_PCK_BLOCK_HEADER_LENGTH)) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":608
+ * if offset > (8 - CCP4_PCK_BLOCK_HEADER_LENGTH):
+ * # wrap around
+ * pos += 1 # <<<<<<<<<<<<<<
+ * next = stream[pos]
+ * value |= next << 8
+ */
+ __pyx_v_pos = (__pyx_v_pos + 1);
+
+ /* "fabio/ext/mar345_IO.pyx":609
+ * # wrap around
+ * pos += 1
+ * next = stream[pos] # <<<<<<<<<<<<<<
+ * value |= next << 8
+ * value = value >> offset
+ */
+ __pyx_t_7 = __pyx_v_pos;
+ __pyx_v_next = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint8_t *) __pyx_v_stream.data) + __pyx_t_7)) )));
+
+ /* "fabio/ext/mar345_IO.pyx":610
+ * pos += 1
+ * next = stream[pos]
+ * value |= next << 8 # <<<<<<<<<<<<<<
+ * value = value >> offset
+ * offset += CCP4_PCK_BLOCK_HEADER_LENGTH - 8
+ */
+ __pyx_v_value = (__pyx_v_value | (__pyx_v_next << 8));
+
+ /* "fabio/ext/mar345_IO.pyx":611
+ * next = stream[pos]
+ * value |= next << 8
+ * value = value >> offset # <<<<<<<<<<<<<<
+ * offset += CCP4_PCK_BLOCK_HEADER_LENGTH - 8
+ * elif offset == (8 - CCP4_PCK_BLOCK_HEADER_LENGTH):
+ */
+ __pyx_v_value = (__pyx_v_value >> __pyx_v_offset);
+
+ /* "fabio/ext/mar345_IO.pyx":612
+ * value |= next << 8
+ * value = value >> offset
+ * offset += CCP4_PCK_BLOCK_HEADER_LENGTH - 8 # <<<<<<<<<<<<<<
+ * elif offset == (8 - CCP4_PCK_BLOCK_HEADER_LENGTH):
+ * # Exactly on the boundary
+ */
+ __pyx_v_offset = (__pyx_v_offset + (__pyx_v_5fabio_3ext_9mar345_IO_CCP4_PCK_BLOCK_HEADER_LENGTH - 8));
+ goto __pyx_L7;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":613
+ * value = value >> offset
+ * offset += CCP4_PCK_BLOCK_HEADER_LENGTH - 8
+ * elif offset == (8 - CCP4_PCK_BLOCK_HEADER_LENGTH): # <<<<<<<<<<<<<<
+ * # Exactly on the boundary
+ * value = value >> offset
+ */
+ __pyx_t_5 = ((__pyx_v_offset == (8 - __pyx_v_5fabio_3ext_9mar345_IO_CCP4_PCK_BLOCK_HEADER_LENGTH)) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":615
+ * elif offset == (8 - CCP4_PCK_BLOCK_HEADER_LENGTH):
+ * # Exactly on the boundary
+ * value = value >> offset # <<<<<<<<<<<<<<
+ * pos += 1
+ * offset = 0
+ */
+ __pyx_v_value = (__pyx_v_value >> __pyx_v_offset);
+
+ /* "fabio/ext/mar345_IO.pyx":616
+ * # Exactly on the boundary
+ * value = value >> offset
+ * pos += 1 # <<<<<<<<<<<<<<
+ * offset = 0
+ * else:
+ */
+ __pyx_v_pos = (__pyx_v_pos + 1);
+
+ /* "fabio/ext/mar345_IO.pyx":617
+ * value = value >> offset
+ * pos += 1
+ * offset = 0 # <<<<<<<<<<<<<<
+ * else:
+ * # stay in same byte
+ */
+ __pyx_v_offset = 0;
+ goto __pyx_L7;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":620
+ * else:
+ * # stay in same byte
+ * value = value >> offset # <<<<<<<<<<<<<<
+ * offset += CCP4_PCK_BLOCK_HEADER_LENGTH
+ *
+ */
+ __pyx_v_value = (__pyx_v_value >> __pyx_v_offset);
+
+ /* "fabio/ext/mar345_IO.pyx":621
+ * # stay in same byte
+ * value = value >> offset
+ * offset += CCP4_PCK_BLOCK_HEADER_LENGTH # <<<<<<<<<<<<<<
+ *
+ * # we use 7 as mask: decimal value of 111
+ */
+ __pyx_v_offset = (__pyx_v_offset + __pyx_v_5fabio_3ext_9mar345_IO_CCP4_PCK_BLOCK_HEADER_LENGTH);
+ }
+ __pyx_L7:;
+
+ /* "fabio/ext/mar345_IO.pyx":626
+ *
+ * # move from offset, read 3 lsb, take the power of 2
+ * nb_val_packed = 1 << (value & 7) # <<<<<<<<<<<<<<
+ * # read 3 next bits, search in LUT for the size of each element in block
+ * nb_bit_per_val = CCP4_PCK_BIT_COUNT[(value >> 3) & 7]
+ */
+ __pyx_v_nb_val_packed = (1 << (__pyx_v_value & 7));
+
+ /* "fabio/ext/mar345_IO.pyx":628
+ * nb_val_packed = 1 << (value & 7)
+ * # read 3 next bits, search in LUT for the size of each element in block
+ * nb_bit_per_val = CCP4_PCK_BIT_COUNT[(value >> 3) & 7] # <<<<<<<<<<<<<<
+ *
+ * if nb_bit_per_val == 0:
+ */
+ __pyx_v_nb_bit_per_val = (__pyx_v_5fabio_3ext_9mar345_IO_CCP4_PCK_BIT_COUNT[((__pyx_v_value >> 3) & 7)]);
+
+ /* "fabio/ext/mar345_IO.pyx":630
+ * nb_bit_per_val = CCP4_PCK_BIT_COUNT[(value >> 3) & 7]
+ *
+ * if nb_bit_per_val == 0: # <<<<<<<<<<<<<<
+ * cont.set_zero(nb_val_packed)
+ * else:
+ */
+ __pyx_t_5 = ((__pyx_v_nb_bit_per_val == 0) != 0);
+ if (__pyx_t_5) {
+
+ /* "fabio/ext/mar345_IO.pyx":631
+ *
+ * if nb_bit_per_val == 0:
+ * cont.set_zero(nb_val_packed) # <<<<<<<<<<<<<<
+ * else:
+ * nb_bit_in_block = nb_bit_per_val * nb_val_packed
+ */
+ __pyx_t_3 = ((struct __pyx_vtabstruct_5fabio_3ext_9mar345_IO_UnpackContainer *)__pyx_v_cont->__pyx_vtab)->set_zero(__pyx_v_cont, __pyx_v_nb_val_packed, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L8;
+ }
+ /*else*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":633
+ * cont.set_zero(nb_val_packed)
+ * else:
+ * nb_bit_in_block = nb_bit_per_val * nb_val_packed # <<<<<<<<<<<<<<
+ * cont.unpack(stream, pos, offset, nb_val_packed, nb_bit_per_val)
+ * offset += nb_bit_in_block
+ */
+ __pyx_v_nb_bit_in_block = (__pyx_v_nb_bit_per_val * __pyx_v_nb_val_packed);
+
+ /* "fabio/ext/mar345_IO.pyx":634
+ * else:
+ * nb_bit_in_block = nb_bit_per_val * nb_val_packed
+ * cont.unpack(stream, pos, offset, nb_val_packed, nb_bit_per_val) # <<<<<<<<<<<<<<
+ * offset += nb_bit_in_block
+ * pos += offset // 8
+ */
+ __pyx_t_3 = ((struct __pyx_vtabstruct_5fabio_3ext_9mar345_IO_UnpackContainer *)__pyx_v_cont->__pyx_vtab)->unpack(__pyx_v_cont, __pyx_v_stream, __pyx_v_pos, __pyx_v_offset, __pyx_v_nb_val_packed, __pyx_v_nb_bit_per_val, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":635
+ * nb_bit_in_block = nb_bit_per_val * nb_val_packed
+ * cont.unpack(stream, pos, offset, nb_val_packed, nb_bit_per_val)
+ * offset += nb_bit_in_block # <<<<<<<<<<<<<<
+ * pos += offset // 8
+ * offset %= 8
+ */
+ __pyx_v_offset = (__pyx_v_offset + __pyx_v_nb_bit_in_block);
+
+ /* "fabio/ext/mar345_IO.pyx":636
+ * cont.unpack(stream, pos, offset, nb_val_packed, nb_bit_per_val)
+ * offset += nb_bit_in_block
+ * pos += offset // 8 # <<<<<<<<<<<<<<
+ * offset %= 8
+ * return cont
+ */
+ __pyx_v_pos = (__pyx_v_pos + (__pyx_v_offset / 8));
+
+ /* "fabio/ext/mar345_IO.pyx":637
+ * offset += nb_bit_in_block
+ * pos += offset // 8
+ * offset %= 8 # <<<<<<<<<<<<<<
+ * return cont
+ *
+ */
+ __pyx_v_offset = (__pyx_v_offset % 8);
+ }
+ __pyx_L8:;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":638
+ * pos += offset // 8
+ * offset %= 8
+ * return cont # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+ __Pyx_INCREF(((PyObject *)__pyx_v_cont));
+ __pyx_r = __pyx_v_cont;
+ goto __pyx_L0;
+
+ /* "fabio/ext/mar345_IO.pyx":580
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef UnpackContainer unpack_pck(cnp.uint8_t[::1] stream, int ncol, int nrow): # <<<<<<<<<<<<<<
+ * """Unpack the raw stream and return the image
+ * V1 only for now, V2 may be added later
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.unpack_pck", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_cont);
+ __Pyx_XGIVEREF((PyObject *)__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15unpack_pck(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_5fabio_3ext_9mar345_IO_14unpack_pck[] = "Unpack the raw stream and return the image\n V1 only for now, V2 may be added later\n\n :param stream: raw input stream\n :param ncol: number of columns in the image (i.e width)\n :param nrow: number if rows in the image (i.e. height)\n :return: Container with decompressed image\n ";
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15unpack_pck(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ __Pyx_memviewslice __pyx_v_stream = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_ncol;
+ int __pyx_v_nrow;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("unpack_pck (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_ncol,&__pyx_n_s_nrow,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ncol)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("unpack_pck", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nrow)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("unpack_pck", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack_pck") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ }
+ __pyx_v_stream = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_stream.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_ncol = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_ncol == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_nrow = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nrow == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("unpack_pck", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.unpack_pck", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_14unpack_pck(__pyx_self, __pyx_v_stream, __pyx_v_ncol, __pyx_v_nrow);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_14unpack_pck(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_stream, int __pyx_v_ncol, int __pyx_v_nrow) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("unpack_pck", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = ((PyObject *)__pyx_f_5fabio_3ext_9mar345_IO_unpack_pck(__pyx_v_stream, __pyx_v_ncol, __pyx_v_nrow, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.unpack_pck", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_stream, 1);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":647
+ * # readonly list debug
+ *
+ * def __cinit__(self, int ncol, int nrow): # <<<<<<<<<<<<<<
+ * self.nrow = nrow
+ * self.ncol = ncol
+ */
+
+/* Python wrapper */
+static int __pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ int __pyx_v_ncol;
+ int __pyx_v_nrow;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ncol,&__pyx_n_s_nrow,0};
+ PyObject* values[2] = {0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ncol)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nrow)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ }
+ __pyx_v_ncol = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_ncol == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_nrow = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nrow == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.UnpackContainer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer___cinit__(((struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *)__pyx_v_self), __pyx_v_ncol, __pyx_v_nrow);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer___cinit__(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self, int __pyx_v_ncol, int __pyx_v_nrow) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__cinit__", 0);
+
+ /* "fabio/ext/mar345_IO.pyx":648
+ *
+ * def __cinit__(self, int ncol, int nrow):
+ * self.nrow = nrow # <<<<<<<<<<<<<<
+ * self.ncol = ncol
+ * self.size = nrow * ncol
+ */
+ __pyx_v_self->nrow = __pyx_v_nrow;
+
+ /* "fabio/ext/mar345_IO.pyx":649
+ * def __cinit__(self, int ncol, int nrow):
+ * self.nrow = nrow
+ * self.ncol = ncol # <<<<<<<<<<<<<<
+ * self.size = nrow * ncol
+ * self.data = numpy.zeros(self.size, dtype=numpy.int32)
+ */
+ __pyx_v_self->ncol = __pyx_v_ncol;
+
+ /* "fabio/ext/mar345_IO.pyx":650
+ * self.nrow = nrow
+ * self.ncol = ncol
+ * self.size = nrow * ncol # <<<<<<<<<<<<<<
+ * self.data = numpy.zeros(self.size, dtype=numpy.int32)
+ * self.position = 0
+ */
+ __pyx_v_self->size = (__pyx_v_nrow * __pyx_v_ncol);
+
+ /* "fabio/ext/mar345_IO.pyx":651
+ * self.ncol = ncol
+ * self.size = nrow * ncol
+ * self.data = numpy.zeros(self.size, dtype=numpy.int32) # <<<<<<<<<<<<<<
+ * self.position = 0
+ *
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __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 = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 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 = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __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, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __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 = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(__pyx_t_5);
+ if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_self->data, 0);
+ __pyx_v_self->data = __pyx_t_6;
+ __pyx_t_6.memview = NULL;
+ __pyx_t_6.data = NULL;
+
+ /* "fabio/ext/mar345_IO.pyx":652
+ * self.size = nrow * ncol
+ * self.data = numpy.zeros(self.size, dtype=numpy.int32)
+ * self.position = 0 # <<<<<<<<<<<<<<
+ *
+ * def __dealloc__(self):
+ */
+ __pyx_v_self->position = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":647
+ * # readonly list debug
+ *
+ * def __cinit__(self, int ncol, int nrow): # <<<<<<<<<<<<<<
+ * self.nrow = nrow
+ * self.ncol = ncol
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.UnpackContainer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":654
+ * self.position = 0
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * self.data = None
+ *
+ */
+
+/* Python wrapper */
+static void __pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_3__dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_2__dealloc__(((struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_2__dealloc__(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "fabio/ext/mar345_IO.pyx":655
+ *
+ * def __dealloc__(self):
+ * self.data = None # <<<<<<<<<<<<<<
+ *
+ * def get(self):
+ */
+ __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(Py_None);
+ if (unlikely(!__pyx_t_1.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_XDEC_MEMVIEW(&__pyx_v_self->data, 0);
+ __pyx_v_self->data = __pyx_t_1;
+ __pyx_t_1.memview = NULL;
+ __pyx_t_1.data = NULL;
+
+ /* "fabio/ext/mar345_IO.pyx":654
+ * self.position = 0
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * self.data = None
+ *
+ */
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
+ __Pyx_WriteUnraisable("fabio.ext.mar345_IO.UnpackContainer.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "fabio/ext/mar345_IO.pyx":657
+ * self.data = None
+ *
+ * def get(self): # <<<<<<<<<<<<<<
+ * """retrieve the populated array"""
+ * return numpy.asarray(self.data).reshape((self.nrow, self.ncol))
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_5fabio_3ext_9mar345_IO_15UnpackContainer_4get[] = "retrieve the populated array";
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("get (wrapper)", 0);
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_4get(((struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_4get(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("get", 0);
+
+ /* "fabio/ext/mar345_IO.pyx":659
+ * def get(self):
+ * """retrieve the populated array"""
+ * return numpy.asarray(self.data).reshape((self.nrow, self.ncol)) # <<<<<<<<<<<<<<
+ *
+ * cpdef cnp.int32_t[::1] get1d(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_self->data, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ if (!__pyx_t_5) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ } else {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_npy_uint32(__pyx_v_self->nrow); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_6 = __Pyx_PyInt_From_npy_uint32(__pyx_v_self->ncol); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ __pyx_t_2 = 0;
+ __pyx_t_6 = 0;
+ __pyx_t_6 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ if (!__pyx_t_6) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "fabio/ext/mar345_IO.pyx":657
+ * self.data = None
+ *
+ * def get(self): # <<<<<<<<<<<<<<
+ * """retrieve the populated array"""
+ * return numpy.asarray(self.data).reshape((self.nrow, self.ncol))
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.UnpackContainer.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":661
+ * return numpy.asarray(self.data).reshape((self.nrow, self.ncol))
+ *
+ * cpdef cnp.int32_t[::1] get1d(self): # <<<<<<<<<<<<<<
+ * """retrieve the populated array"""
+ * return self.data
+ */
+
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_7get1d(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static __Pyx_memviewslice __pyx_f_5fabio_3ext_9mar345_IO_15UnpackContainer_get1d(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self, int __pyx_skip_dispatch) {
+ __Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("get1d", 0);
+ /* Check if called by wrapper */
+ if (unlikely(__pyx_skip_dispatch)) ;
+ /* Check if overridden in Python */
+ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get1d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_7get1d)) {
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (__pyx_t_4) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else {
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
+ if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5.memview = NULL;
+ __pyx_t_5.data = NULL;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ goto __pyx_L0;
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":663
+ * cpdef cnp.int32_t[::1] get1d(self):
+ * """retrieve the populated array"""
+ * return self.data # <<<<<<<<<<<<<<
+ *
+ * cpdef set_zero(self, int number):
+ */
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ __PYX_INC_MEMVIEW(&__pyx_v_self->data, 0);
+ __pyx_r = __pyx_v_self->data;
+ goto __pyx_L0;
+
+ /* "fabio/ext/mar345_IO.pyx":661
+ * return numpy.asarray(self.data).reshape((self.nrow, self.ncol))
+ *
+ * cpdef cnp.int32_t[::1] get1d(self): # <<<<<<<<<<<<<<
+ * """retrieve the populated array"""
+ * return self.data
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
+ __pyx_r.data = NULL;
+ __pyx_r.memview = NULL;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.UnpackContainer.get1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
+
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (unlikely(!__pyx_r.memview)) {
+ PyErr_SetString(PyExc_TypeError,"Memoryview return value is not initialized");
+ }
+ __pyx_L2:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_7get1d(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_5fabio_3ext_9mar345_IO_15UnpackContainer_6get1d[] = "retrieve the populated array";
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_7get1d(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("get1d (wrapper)", 0);
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_6get1d(((struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_6get1d(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("get1d", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_5fabio_3ext_9mar345_IO_15UnpackContainer_get1d(__pyx_v_self, 1); if (unlikely(!__pyx_t_1.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_t_1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.UnpackContainer.get1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":665
+ * return self.data
+ *
+ * cpdef set_zero(self, int number): # <<<<<<<<<<<<<<
+ * "set so many zeros"
+ * self.position += number
+ */
+
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_9set_zero(PyObject *__pyx_v_self, PyObject *__pyx_arg_number); /*proto*/
+static PyObject *__pyx_f_5fabio_3ext_9mar345_IO_15UnpackContainer_set_zero(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self, int __pyx_v_number, int __pyx_skip_dispatch) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("set_zero", 0);
+ /* Check if called by wrapper */
+ if (unlikely(__pyx_skip_dispatch)) ;
+ /* Check if overridden in Python */
+ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_zero); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_9set_zero)) {
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_number); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ if (!__pyx_t_5) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ } else {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ goto __pyx_L0;
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":667
+ * cpdef set_zero(self, int number):
+ * "set so many zeros"
+ * self.position += number # <<<<<<<<<<<<<<
+ *
+ * @cython.boundscheck(False)
+ */
+ __pyx_v_self->position = (__pyx_v_self->position + __pyx_v_number);
+
+ /* "fabio/ext/mar345_IO.pyx":665
+ * return self.data
+ *
+ * cpdef set_zero(self, int number): # <<<<<<<<<<<<<<
+ * "set so many zeros"
+ * self.position += number
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.UnpackContainer.set_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_9set_zero(PyObject *__pyx_v_self, PyObject *__pyx_arg_number); /*proto*/
+static char __pyx_doc_5fabio_3ext_9mar345_IO_15UnpackContainer_8set_zero[] = "set so many zeros";
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_9set_zero(PyObject *__pyx_v_self, PyObject *__pyx_arg_number) {
+ int __pyx_v_number;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("set_zero (wrapper)", 0);
+ assert(__pyx_arg_number); {
+ __pyx_v_number = __Pyx_PyInt_As_int(__pyx_arg_number); if (unlikely((__pyx_v_number == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.UnpackContainer.set_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_8set_zero(((struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *)__pyx_v_self), ((int)__pyx_v_number));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_8set_zero(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self, int __pyx_v_number) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("set_zero", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_5fabio_3ext_9mar345_IO_15UnpackContainer_set_zero(__pyx_v_self, __pyx_v_number, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.UnpackContainer.set_zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":673
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef unpack(self, cnp.uint8_t[::1] stream, cnp.uint32_t pos, cnp.uint32_t offset, cnp.uint32_t nb_value, cnp.uint32_t value_size): # <<<<<<<<<<<<<<
+ * """unpack a block on data, all the same size
+ *
+ */
+
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_11unpack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_5fabio_3ext_9mar345_IO_15UnpackContainer_unpack(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self, __Pyx_memviewslice __pyx_v_stream, __pyx_t_5numpy_uint32_t __pyx_v_pos, __pyx_t_5numpy_uint32_t __pyx_v_offset, __pyx_t_5numpy_uint32_t __pyx_v_nb_value, __pyx_t_5numpy_uint32_t __pyx_v_value_size, int __pyx_skip_dispatch) {
+ CYTHON_UNUSED __pyx_t_5numpy_uint32_t __pyx_v_i;
+ __pyx_t_5numpy_uint32_t __pyx_v_j;
+ __pyx_t_5numpy_uint32_t __pyx_v_new_offset;
+ __pyx_t_5numpy_int64_t __pyx_v_cur;
+ __pyx_t_5numpy_uint64_t __pyx_v_tmp;
+ int __pyx_v_to_read;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ Py_ssize_t __pyx_t_10;
+ PyObject *__pyx_t_11 = NULL;
+ __pyx_t_5numpy_uint32_t __pyx_t_12;
+ __pyx_t_5numpy_uint32_t __pyx_t_13;
+ __pyx_t_5numpy_uint32_t __pyx_t_14;
+ int __pyx_t_15;
+ __pyx_t_5numpy_uint32_t __pyx_t_16;
+ __pyx_t_5numpy_uint32_t __pyx_t_17;
+ int __pyx_t_18;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("unpack", 0);
+ /* Check if called by wrapper */
+ if (unlikely(__pyx_skip_dispatch)) ;
+ /* Check if overridden in Python */
+ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_11unpack)) {
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_stream, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyInt_From_npy_uint32(__pyx_v_pos); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyInt_From_npy_uint32(__pyx_v_offset); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = __Pyx_PyInt_From_npy_uint32(__pyx_v_nb_value); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = __Pyx_PyInt_From_npy_uint32(__pyx_v_value_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_8 = __pyx_t_1; __pyx_t_9 = NULL;
+ __pyx_t_10 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
+ __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
+ if (likely(__pyx_t_9)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+ __Pyx_INCREF(__pyx_t_9);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_8, function);
+ __pyx_t_10 = 1;
+ }
+ }
+ __pyx_t_11 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ if (__pyx_t_9) {
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
+ }
+ PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_10, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_3 = 0;
+ __pyx_t_4 = 0;
+ __pyx_t_5 = 0;
+ __pyx_t_6 = 0;
+ __pyx_t_7 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ goto __pyx_L0;
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":688
+ * int to_read # number of bytes to read
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * cur = 0
+ * for i in range(nb_value):
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "fabio/ext/mar345_IO.pyx":689
+ *
+ * with nogil:
+ * cur = 0 # <<<<<<<<<<<<<<
+ * for i in range(nb_value):
+ *
+ */
+ __pyx_v_cur = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":690
+ * with nogil:
+ * cur = 0
+ * for i in range(nb_value): # <<<<<<<<<<<<<<
+ *
+ * # read as many bytes as needed and unpack them to tmp variable
+ */
+ __pyx_t_12 = __pyx_v_nb_value;
+ for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
+ __pyx_v_i = __pyx_t_13;
+
+ /* "fabio/ext/mar345_IO.pyx":694
+ * # read as many bytes as needed and unpack them to tmp variable
+ *
+ * tmp = stream[pos] >> offset # <<<<<<<<<<<<<<
+ *
+ * new_offset = value_size + offset
+ */
+ __pyx_t_14 = __pyx_v_pos;
+ __pyx_v_tmp = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint8_t *) __pyx_v_stream.data) + __pyx_t_14)) ))) >> __pyx_v_offset);
+
+ /* "fabio/ext/mar345_IO.pyx":696
+ * tmp = stream[pos] >> offset
+ *
+ * new_offset = value_size + offset # <<<<<<<<<<<<<<
+ * to_read = (new_offset + 7) // 8
+ *
+ */
+ __pyx_v_new_offset = (__pyx_v_value_size + __pyx_v_offset);
+
+ /* "fabio/ext/mar345_IO.pyx":697
+ *
+ * new_offset = value_size + offset
+ * to_read = (new_offset + 7) // 8 # <<<<<<<<<<<<<<
+ *
+ * for j in range(1, to_read):
+ */
+ __pyx_v_to_read = ((__pyx_v_new_offset + 7) / 8);
+
+ /* "fabio/ext/mar345_IO.pyx":699
+ * to_read = (new_offset + 7) // 8
+ *
+ * for j in range(1, to_read): # <<<<<<<<<<<<<<
+ * tmp |= (stream[pos + j]) << (8 * j - offset)
+ *
+ */
+ __pyx_t_15 = __pyx_v_to_read;
+ for (__pyx_t_16 = 1; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
+ __pyx_v_j = __pyx_t_16;
+
+ /* "fabio/ext/mar345_IO.pyx":700
+ *
+ * for j in range(1, to_read):
+ * tmp |= (stream[pos + j]) << (8 * j - offset) # <<<<<<<<<<<<<<
+ *
+ * # Remove the msb of tmp to keep only the interesting values
+ */
+ __pyx_t_17 = (__pyx_v_pos + __pyx_v_j);
+ __pyx_v_tmp = (__pyx_v_tmp | ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint8_t *) __pyx_v_stream.data) + __pyx_t_17)) ))) << ((8 * __pyx_v_j) - __pyx_v_offset)));
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":703
+ *
+ * # Remove the msb of tmp to keep only the interesting values
+ * cur = tmp & ((1 << (value_size)) - 1) # <<<<<<<<<<<<<<
+ *
+ * # change sign if most significant bit is 1
+ */
+ __pyx_v_cur = (__pyx_v_tmp & ((1 << __pyx_v_value_size) - 1));
+
+ /* "fabio/ext/mar345_IO.pyx":706
+ *
+ * # change sign if most significant bit is 1
+ * if cur >> (value_size - 1): # <<<<<<<<<<<<<<
+ * cur |= (-1) << (value_size - 1)
+ *
+ */
+ __pyx_t_18 = ((__pyx_v_cur >> (__pyx_v_value_size - 1)) != 0);
+ if (__pyx_t_18) {
+
+ /* "fabio/ext/mar345_IO.pyx":707
+ * # change sign if most significant bit is 1
+ * if cur >> (value_size - 1):
+ * cur |= (-1) << (value_size - 1) # <<<<<<<<<<<<<<
+ *
+ * # Update the storage
+ */
+ __pyx_v_cur = (__pyx_v_cur | (-1 << (__pyx_v_value_size - 1)));
+ goto __pyx_L10;
+ }
+ __pyx_L10:;
+
+ /* "fabio/ext/mar345_IO.pyx":710
+ *
+ * # Update the storage
+ * self.data[self.position] = cur # <<<<<<<<<<<<<<
+ * self.position += 1
+ *
+ */
+ __pyx_t_16 = __pyx_v_self->position;
+ *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_self->data.data) + __pyx_t_16)) )) = __pyx_v_cur;
+
+ /* "fabio/ext/mar345_IO.pyx":711
+ * # Update the storage
+ * self.data[self.position] = cur
+ * self.position += 1 # <<<<<<<<<<<<<<
+ *
+ * # Update the position in the array
+ */
+ __pyx_v_self->position = (__pyx_v_self->position + 1);
+
+ /* "fabio/ext/mar345_IO.pyx":714
+ *
+ * # Update the position in the array
+ * pos = pos + new_offset // 8 # <<<<<<<<<<<<<<
+ * offset = new_offset % 8
+ */
+ __pyx_v_pos = (__pyx_v_pos + (__pyx_v_new_offset / 8));
+
+ /* "fabio/ext/mar345_IO.pyx":715
+ * # Update the position in the array
+ * pos = pos + new_offset // 8
+ * offset = new_offset % 8 # <<<<<<<<<<<<<<
+ */
+ __pyx_v_offset = (__pyx_v_new_offset % 8);
+ }
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":688
+ * int to_read # number of bytes to read
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * cur = 0
+ * for i in range(nb_value):
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+ }
+
+ /* "fabio/ext/mar345_IO.pyx":673
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef unpack(self, cnp.uint8_t[::1] stream, cnp.uint32_t pos, cnp.uint32_t offset, cnp.uint32_t nb_value, cnp.uint32_t value_size): # <<<<<<<<<<<<<<
+ * """unpack a block on data, all the same size
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_11);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.UnpackContainer.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_11unpack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_5fabio_3ext_9mar345_IO_15UnpackContainer_10unpack[] = "unpack a block on data, all the same size\n\n :param stream: input stream, already sliced\n :param offset: number of bits of offset, at the begining of the stream\n :param nb_value: number of values to unpack\n :param value_size: number of bits of each value\n ";
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_11unpack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ __Pyx_memviewslice __pyx_v_stream = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __pyx_t_5numpy_uint32_t __pyx_v_pos;
+ __pyx_t_5numpy_uint32_t __pyx_v_offset;
+ __pyx_t_5numpy_uint32_t __pyx_v_nb_value;
+ __pyx_t_5numpy_uint32_t __pyx_v_value_size;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("unpack (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,&__pyx_n_s_pos,&__pyx_n_s_offset,&__pyx_n_s_nb_value,&__pyx_n_s_value_size,0};
+ PyObject* values[5] = {0,0,0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("unpack", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("unpack", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 3:
+ if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nb_value)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("unpack", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 4:
+ if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value_size)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("unpack", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unpack") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ }
+ __pyx_v_stream = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_stream.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_pos = __Pyx_PyInt_As_npy_uint32(values[1]); if (unlikely((__pyx_v_pos == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_offset = __Pyx_PyInt_As_npy_uint32(values[2]); if (unlikely((__pyx_v_offset == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_nb_value = __Pyx_PyInt_As_npy_uint32(values[3]); if (unlikely((__pyx_v_nb_value == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_value_size = __Pyx_PyInt_As_npy_uint32(values[4]); if (unlikely((__pyx_v_value_size == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("unpack", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.UnpackContainer.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_10unpack(((struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *)__pyx_v_self), __pyx_v_stream, __pyx_v_pos, __pyx_v_offset, __pyx_v_nb_value, __pyx_v_value_size);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_10unpack(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self, __Pyx_memviewslice __pyx_v_stream, __pyx_t_5numpy_uint32_t __pyx_v_pos, __pyx_t_5numpy_uint32_t __pyx_v_offset, __pyx_t_5numpy_uint32_t __pyx_v_nb_value, __pyx_t_5numpy_uint32_t __pyx_v_value_size) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("unpack", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_f_5fabio_3ext_9mar345_IO_15UnpackContainer_unpack(__pyx_v_self, __pyx_v_stream, __pyx_v_pos, __pyx_v_offset, __pyx_v_nb_value, __pyx_v_value_size, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.UnpackContainer.unpack", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_stream, 1);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":643
+ * cdef class UnpackContainer:
+ * cdef:
+ * readonly cnp.uint32_t nrow, ncol, position, size # <<<<<<<<<<<<<<
+ * readonly cnp.int32_t[::1] data
+ * # readonly list debug
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_4nrow_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_4nrow_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_4nrow___get__(((struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_4nrow___get__(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_v_self->nrow); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.UnpackContainer.nrow.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_4ncol_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_4ncol_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_4ncol___get__(((struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_4ncol___get__(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_v_self->ncol); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.UnpackContainer.ncol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_8position_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_8position_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_8position___get__(((struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_8position___get__(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_v_self->position); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.UnpackContainer.position.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_4size_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_4size___get__(((struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_4size___get__(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_npy_uint32(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.UnpackContainer.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "fabio/ext/mar345_IO.pyx":644
+ * cdef:
+ * readonly cnp.uint32_t nrow, ncol, position, size
+ * readonly cnp.int32_t[::1] data # <<<<<<<<<<<<<<
+ * # readonly list debug
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_4data_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_4data_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_4data___get__(((struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_5fabio_3ext_9mar345_IO_15UnpackContainer_4data___get__(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->data, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("fabio.ext.mar345_IO.UnpackContainer.data.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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) {
+ int __pyx_r;
+ __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;
+}
+
+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;
+ int __pyx_v_ndim;
+ int __pyx_v_endian_detector;
+ int __pyx_v_little_endian;
+ int __pyx_v_t;
+ char *__pyx_v_f;
+ PyArray_Descr *__pyx_v_descr = 0;
+ int __pyx_v_offset;
+ int __pyx_v_hasfields;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ char *__pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ if (__pyx_v_info != NULL) {
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_info->obj);
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
+ *
+ * cdef int copy_shape, i, ndim
+ * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ *
+ */
+ __pyx_v_endian_detector = 1;
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ *
+ * ndim = PyArray_NDIM(self)
+ */
+ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ *
+ * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
+ *
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
+ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
+
+ /* "../../../usr/lib/python2.7/dist-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))) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209
+ *
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * copy_shape = 1 # <<<<<<<<<<<<<<
+ * else:
+ * copy_shape = 0
+ */
+ __pyx_v_copy_shape = 1;
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
+ * copy_shape = 1
+ * else:
+ * copy_shape = 0 # <<<<<<<<<<<<<<
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ */
+ __pyx_v_copy_shape = 0;
+ }
+ __pyx_L4:;
+
+ /* "../../../usr/lib/python2.7/dist-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_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/lib/python2.7/dist-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) != 0)) != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L6_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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) {
+
+ /* "../../../usr/lib/python2.7/dist-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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
+ * raise ValueError(u"ndarray is not Fortran contiguous")
+ *
+ * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
+ * info.ndim = ndim
+ * if copy_shape:
+ */
+ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
+ *
+ * info.buf = PyArray_DATA(self)
+ * info.ndim = ndim # <<<<<<<<<<<<<<
+ * if copy_shape:
+ * # Allocate new buffer for strides and shape info.
+ */
+ __pyx_v_info->ndim = __pyx_v_ndim;
+
+ /* "../../../usr/lib/python2.7/dist-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.
+ */
+ __pyx_t_1 = (__pyx_v_copy_shape != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ * info.shape = info.strides + ndim
+ * for i in range(ndim):
+ */
+ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
+
+ /* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i]
+ */
+ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229
+ * info.shape = info.strides + ndim
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ * else:
+ */
+ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
+
+ /* "../../../usr/lib/python2.7/dist-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] # <<<<<<<<<<<<<<
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ */
+ (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
+ }
+ goto __pyx_L11;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ * info.suboffsets = NULL
+ */
+ __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ */
+ __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
+ }
+ __pyx_L11:;
+
+ /* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ * info.readonly = not PyArray_ISWRITEABLE(self)
+ */
+ __pyx_v_info->suboffsets = NULL;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
+ * info.readonly = not PyArray_ISWRITEABLE(self)
+ *
+ */
+ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
+
+ /* "../../../usr/lib/python2.7/dist-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) != 0));
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
+ *
+ * cdef int t
+ * cdef char* f = NULL # <<<<<<<<<<<<<<
+ * cdef dtype descr = self.descr
+ * cdef list stack
+ */
+ __pyx_v_f = NULL;
+
+ /* "../../../usr/lib/python2.7/dist-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_3 = ((PyObject *)__pyx_v_self->descr);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":244
+ * cdef int offset
+ *
+ * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
+ *
+ * if not hasfields and not copy_shape:
+ */
+ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
+
+ /* "../../../usr/lib/python2.7/dist-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 != 0)) != 0);
+ if (__pyx_t_2) {
+ } 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) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
+ * if not hasfields and not copy_shape:
+ * # do not call releasebuffer
+ * info.obj = None # <<<<<<<<<<<<<<
+ * else:
+ * # need to call releasebuffer
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = Py_None;
+ goto __pyx_L14;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251
+ * else:
+ * # need to call releasebuffer
+ * info.obj = self # <<<<<<<<<<<<<<
+ *
+ * if not hasfields:
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
+ }
+ __pyx_L14:;
+
+ /* "../../../usr/lib/python2.7/dist-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 != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-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_4 = __pyx_v_descr->type_num;
+ __pyx_v_t = __pyx_t_4;
+
+ /* "../../../usr/lib/python2.7/dist-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_2 = ((__pyx_v_descr->byteorder == '>') != 0);
+ if (!__pyx_t_2) {
+ goto __pyx_L20_next_or;
+ } else {
+ }
+ __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:;
+
+ /* "../../../usr/lib/python2.7/dist-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_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) {
+
+ /* "../../../usr/lib/python2.7/dist-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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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/lib/python2.7/dist-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"
+ */
+ case NPY_BYTE:
+ __pyx_v_f = __pyx_k_b;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_UBYTE:
+ __pyx_v_f = __pyx_k_B;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_SHORT:
+ __pyx_v_f = __pyx_k_h;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_USHORT:
+ __pyx_v_f = __pyx_k_H;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_INT:
+ __pyx_v_f = __pyx_k_i;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_UINT:
+ __pyx_v_f = __pyx_k_I;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_LONG:
+ __pyx_v_f = __pyx_k_l;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_ULONG:
+ __pyx_v_f = __pyx_k_L;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_LONGLONG:
+ __pyx_v_f = __pyx_k_q;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_ULONGLONG:
+ __pyx_v_f = __pyx_k_Q;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_FLOAT:
+ __pyx_v_f = __pyx_k_f;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_DOUBLE:
+ __pyx_v_f = __pyx_k_d;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_LONGDOUBLE:
+ __pyx_v_f = __pyx_k_g;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_CFLOAT:
+ __pyx_v_f = __pyx_k_Zf;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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"
+ */
+ case NPY_CDOUBLE:
+ __pyx_v_f = __pyx_k_Zd;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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:
+ */
+ case NPY_CLONGDOUBLE:
+ __pyx_v_f = __pyx_k_Zg;
+ break;
+
+ /* "../../../usr/lib/python2.7/dist-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)
+ */
+ case NPY_OBJECT:
+ __pyx_v_f = __pyx_k_O;
+ break;
+ default:
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * info.format = f # <<<<<<<<<<<<<<
+ * return
+ * else:
+ */
+ __pyx_v_info->format = __pyx_v_f;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * info.format = f
+ * return # <<<<<<<<<<<<<<
+ * else:
+ * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
+ * return
+ * else:
+ * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
+ * info.format[0] = c'^' # Native data types, manual alignment
+ * offset = 0
+ */
+ __pyx_v_info->format = ((char *)malloc(255));
+
+ /* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * offset = 0
+ * f = _util_dtypestring(descr, info.format + 1,
+ */
+ (__pyx_v_info->format[0]) = '^';
+
+ /* "../../../usr/lib/python2.7/dist-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 # <<<<<<<<<<<<<<
+ * f = _util_dtypestring(descr, info.format + 1,
+ * info.format + _buffer_format_string_len,
+ */
+ __pyx_v_offset = 0;
+
+ /* "../../../usr/lib/python2.7/dist-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)
+ */
+ __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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286
+ * info.format + _buffer_format_string_len,
+ * &offset)
+ * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ */
+ (__pyx_v_f[0]) = '\x00';
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
+ }
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
+ __Pyx_GOTREF(Py_None);
+ __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
+ }
+ __pyx_L2:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_descr);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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();
+}
+
+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);
+
+ /* "../../../usr/lib/python2.7/dist-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) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self):
+ * stdlib.free(info.format) # <<<<<<<<<<<<<<
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * stdlib.free(info.strides)
+ */
+ free(__pyx_v_info->format);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "../../../usr/lib/python2.7/dist-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))) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292
+ * 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
+ *
+ */
+ free(__pyx_v_info->strides);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "../../../usr/lib/python2.7/dist-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();
+}
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
+ * ctypedef npy_cdouble complex_t
+ *
+ * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(1, <void*>a)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":769
+ *
+ * cdef inline object PyArray_MultiIterNew1(a):
+ * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":772
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b):
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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) # <<<<<<<<<<<<<<
+ *
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-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.
+ */
+
+static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
+ PyArray_Descr *__pyx_v_child = 0;
+ int __pyx_v_endian_detector;
+ int __pyx_v_little_endian;
+ PyObject *__pyx_v_fields = 0;
+ PyObject *__pyx_v_childname = NULL;
+ PyObject *__pyx_v_new_offset = NULL;
+ PyObject *__pyx_v_t = NULL;
+ char *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ 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);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790
+ * cdef int delta_offset
+ * cdef tuple i
+ * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ * cdef tuple fields
+ */
+ __pyx_v_endian_detector = 1;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791
+ * cdef tuple i
+ * cdef int endian_detector = 1
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
+ * cdef tuple fields
+ *
+ */
+ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
+
+ /* "../../../usr/lib/python2.7/dist-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(__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 = __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
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #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_SET(__pyx_v_childname, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "../../../usr/lib/python2.7/dist-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 (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 %.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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":796
+ * for childname in descr.names:
+ * fields = descr.fields[childname]
+ * child, new_offset = fields # <<<<<<<<<<<<<<
+ *
+ * if (end - f) - <int>(new_offset - offset[0]) < 15:
+ */
+ 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
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ #else
+ __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __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 {
+ __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ 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_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
+ __pyx_t_3 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":798
+ * child, new_offset = fields
+ *
+ * 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 = __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 = 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_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_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
+ if (__pyx_t_6) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
+ *
+ * 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_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__22, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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 == '>') != 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_6 = __pyx_t_7;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_L8_next_or:;
+
+ /* "../../../usr/lib/python2.7/dist-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 == '<') != 0);
+ if (__pyx_t_7) {
+ } else {
+ __pyx_t_6 = __pyx_t_7;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
+ __pyx_t_6 = __pyx_t_7;
+ __pyx_L7_bool_binop_done:;
+ if (__pyx_t_6) {
+
+ /* "../../../usr/lib/python2.7/dist-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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
+ *
+ * # Output padding bytes
+ * while offset[0] < new_offset: # <<<<<<<<<<<<<<
+ * f[0] = 120 # "x"; pad byte
+ * f += 1
+ */
+ while (1) {
+ __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;
+ __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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":814
+ * # Output padding bytes
+ * while offset[0] < new_offset:
+ * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
+ * f += 1
+ * offset[0] += 1
+ */
+ (__pyx_v_f[0]) = 120;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815
+ * while offset[0] < new_offset:
+ * f[0] = 120 # "x"; pad byte
+ * f += 1 # <<<<<<<<<<<<<<
+ * offset[0] += 1
+ *
+ */
+ __pyx_v_f = (__pyx_v_f + 1);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
+ * f[0] = 120 # "x"; pad byte
+ * f += 1
+ * offset[0] += 1 # <<<<<<<<<<<<<<
+ *
+ * offset[0] += child.itemsize
+ */
+ __pyx_t_8 = 0;
+ (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
+ }
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818
+ * offset[0] += 1
+ *
+ * offset[0] += child.itemsize # <<<<<<<<<<<<<<
+ *
+ * if not PyDataType_HASFIELDS(child):
+ */
+ __pyx_t_8 = 0;
+ (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
+
+ /* "../../../usr/lib/python2.7/dist-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_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
+ if (__pyx_t_6) {
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+
+ /* "../../../usr/lib/python2.7/dist-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_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
+ if (__pyx_t_6) {
+
+ /* "../../../usr/lib/python2.7/dist-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_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__24, 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;}
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 98;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 104;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 105;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 108;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 113;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 102;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 103;
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 90;
+ (__pyx_v_f[1]) = 100;
+ __pyx_v_f = (__pyx_v_f + 1);
+ goto __pyx_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ __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_L15;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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_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;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 79;
+ goto __pyx_L15;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-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_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);
+ __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_L15:;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * f += 1 # <<<<<<<<<<<<<<
+ * else:
+ * # Cython ignores struct boundary information ("T{...}"),
+ */
+ __pyx_v_f = (__pyx_v_f + 1);
+ goto __pyx_L13;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-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_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_L13:;
+
+ /* "../../../usr/lib/python2.7/dist-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;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850
+ * # so don't output it
+ * f = _util_dtypestring(child, f, end, offset)
+ * return f # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_f;
+ goto __pyx_L0;
+
+ /* "../../../usr/lib/python2.7/dist-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_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_child);
+ __Pyx_XDECREF(__pyx_v_fields);
+ __Pyx_XDECREF(__pyx_v_childname);
+ __Pyx_XDECREF(__pyx_v_new_offset);
+ __Pyx_XDECREF(__pyx_v_t);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
+ *
+ *
+ * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
+ * cdef PyObject* baseptr
+ * if base is None:
+ */
+
+static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
+ PyObject *__pyx_v_baseptr;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ __Pyx_RefNannySetupContext("set_array_base", 0);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968
+ * cdef inline void set_array_base(ndarray arr, object base):
+ * cdef PyObject* baseptr
+ * if base is None: # <<<<<<<<<<<<<<
+ * baseptr = NULL
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_base == Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
+ * cdef PyObject* baseptr
+ * if base is None:
+ * baseptr = NULL # <<<<<<<<<<<<<<
+ * else:
+ * Py_INCREF(base) # important to do this before decref below!
+ */
+ __pyx_v_baseptr = NULL;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971
+ * baseptr = NULL
+ * else:
+ * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base)
+ */
+ Py_INCREF(__pyx_v_base);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972
+ * else:
+ * Py_INCREF(base) # important to do this before decref below!
+ * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
+ * Py_XDECREF(arr.base)
+ * arr.base = baseptr
+ */
+ __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
+ }
+ __pyx_L3:;
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973
+ * Py_INCREF(base) # important to do this before decref below!
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
+ * arr.base = baseptr
+ *
+ */
+ Py_XDECREF(__pyx_v_arr->base);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base)
+ * arr.base = baseptr # <<<<<<<<<<<<<<
+ *
+ * cdef inline object get_array_base(ndarray arr):
+ */
+ __pyx_v_arr->base = __pyx_v_baseptr;
+
+ /* "../../../usr/lib/python2.7/dist-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();
+}
+
+/* "../../../usr/lib/python2.7/dist-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
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("get_array_base", 0);
+
+ /* "../../../usr/lib/python2.7/dist-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) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":978
+ * cdef inline object get_array_base(ndarray arr):
+ * if arr.base is NULL:
+ * return None # <<<<<<<<<<<<<<
+ * else:
+ * return <object>arr.base
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(Py_None);
+ __pyx_r = Py_None;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
+ * return None
+ * else:
+ * return <object>arr.base # <<<<<<<<<<<<<<
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
+ __pyx_r = ((PyObject *)__pyx_v_arr->base);
+ goto __pyx_L0;
+ }
+
+ /* "../../../usr/lib/python2.7/dist-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();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":116
+ * cdef bint dtype_is_object
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
+ * mode="c", bint allocate_buffer=True):
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_shape = 0;
+ Py_ssize_t __pyx_v_itemsize;
+ PyObject *__pyx_v_format = 0;
+ PyObject *__pyx_v_mode = 0;
+ int __pyx_v_allocate_buffer;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
+ PyObject* values[5] = {0,0,0,0,0};
+ values[3] = ((PyObject *)__pyx_n_s_c);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 3:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode);
+ if (value) { values[3] = value; kw_args--; }
+ }
+ case 4:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allocate_buffer);
+ if (value) { values[4] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_shape = ((PyObject*)values[0]);
+ __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_format = values[2];
+ __pyx_v_mode = values[3];
+ if (values[4]) {
+ __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+
+ /* "View.MemoryView":117
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
+ * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
+ *
+ * cdef int idx
+ */
+ __pyx_v_allocate_buffer = ((int)1);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_r = __pyx_array_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
+
+ /* "View.MemoryView":116
+ * cdef bint dtype_is_object
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
+ * mode="c", bint allocate_buffer=True):
+ *
+ */
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
+ int __pyx_v_idx;
+ Py_ssize_t __pyx_v_i;
+ Py_ssize_t __pyx_v_dim;
+ PyObject **__pyx_v_p;
+ char __pyx_v_order;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ char *__pyx_t_5;
+ int __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ Py_ssize_t __pyx_t_8;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__cinit__", 0);
+ __Pyx_INCREF(__pyx_v_format);
+
+ /* "View.MemoryView":123
+ * cdef PyObject **p
+ *
+ * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
+ * self.itemsize = itemsize
+ *
+ */
+ if (unlikely(__pyx_v_shape == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_self->ndim = ((int)__pyx_t_1);
+
+ /* "View.MemoryView":124
+ *
+ * self.ndim = <int> len(shape)
+ * self.itemsize = itemsize # <<<<<<<<<<<<<<
+ *
+ * if not self.ndim:
+ */
+ __pyx_v_self->itemsize = __pyx_v_itemsize;
+
+ /* "View.MemoryView":126
+ * self.itemsize = itemsize
+ *
+ * if not self.ndim: # <<<<<<<<<<<<<<
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":127
+ *
+ * if not self.ndim:
+ * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if itemsize <= 0:
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __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[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":129
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":130
+ *
+ * if itemsize <= 0:
+ * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if isinstance(format, unicode):
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __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[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":132
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ * if isinstance(format, unicode): # <<<<<<<<<<<<<<
+ * format = (<unicode>format).encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ */
+ __pyx_t_2 = PyUnicode_Check(__pyx_v_format);
+ __pyx_t_4 = (__pyx_t_2 != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":133
+ *
+ * if isinstance(format, unicode):
+ * format = (<unicode>format).encode('ASCII') # <<<<<<<<<<<<<<
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format
+ */
+ if (unlikely(__pyx_v_format == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "encode");
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_3 = PyUnicode_AsASCIIString(((PyObject*)__pyx_v_format)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
+ __pyx_t_3 = 0;
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":134
+ * if isinstance(format, unicode):
+ * format = (<unicode>format).encode('ASCII')
+ * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
+ * self.format = self._format
+ *
+ */
+ if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_v_format;
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_v_self->_format);
+ __Pyx_DECREF(__pyx_v_self->_format);
+ __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":135
+ * format = (<unicode>format).encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_self->format = __pyx_t_5;
+
+ /* "View.MemoryView":138
+ *
+ *
+ * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
+ * self._strides = self._shape + self.ndim
+ *
+ */
+ __pyx_v_self->_shape = ((Py_ssize_t *)PyMem_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
+
+ /* "View.MemoryView":139
+ *
+ * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
+ * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
+ *
+ * if not self._shape:
+ */
+ __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
+
+ /* "View.MemoryView":141
+ * self._strides = self._shape + self.ndim
+ *
+ * if not self._shape: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate shape and strides.")
+ *
+ */
+ __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":142
+ *
+ * if not self._shape:
+ * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __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[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":145
+ *
+ *
+ * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ */
+ __pyx_t_6 = 0;
+ __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
+ for (;;) {
+ if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_v_dim = __pyx_t_8;
+ __pyx_v_idx = __pyx_t_6;
+ __pyx_t_6 = (__pyx_t_6 + 1);
+
+ /* "View.MemoryView":146
+ *
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim
+ */
+ __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":147
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
+ * self._shape[idx] = dim
+ *
+ */
+ __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_9);
+ __pyx_t_7 = 0;
+ __pyx_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __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_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_Raise(__pyx_t_9, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":148
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim # <<<<<<<<<<<<<<
+ *
+ * cdef char order
+ */
+ (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
+
+ /* "View.MemoryView":145
+ *
+ *
+ * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ */
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "View.MemoryView":151
+ *
+ * cdef char order
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
+ * order = b'F'
+ * self.mode = u'fortran'
+ */
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":152
+ * cdef char order
+ * if mode == 'fortran':
+ * order = b'F' # <<<<<<<<<<<<<<
+ * self.mode = u'fortran'
+ * elif mode == 'c':
+ */
+ __pyx_v_order = 'F';
+
+ /* "View.MemoryView":153
+ * if mode == 'fortran':
+ * order = b'F'
+ * self.mode = u'fortran' # <<<<<<<<<<<<<<
+ * elif mode == 'c':
+ * order = b'C'
+ */
+ __Pyx_INCREF(__pyx_n_u_fortran);
+ __Pyx_GIVEREF(__pyx_n_u_fortran);
+ __Pyx_GOTREF(__pyx_v_self->mode);
+ __Pyx_DECREF(__pyx_v_self->mode);
+ __pyx_v_self->mode = __pyx_n_u_fortran;
+ goto __pyx_L10;
+ }
+
+ /* "View.MemoryView":154
+ * order = b'F'
+ * self.mode = u'fortran'
+ * elif mode == 'c': # <<<<<<<<<<<<<<
+ * order = b'C'
+ * self.mode = u'c'
+ */
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":155
+ * self.mode = u'fortran'
+ * elif mode == 'c':
+ * order = b'C' # <<<<<<<<<<<<<<
+ * self.mode = u'c'
+ * else:
+ */
+ __pyx_v_order = 'C';
+
+ /* "View.MemoryView":156
+ * elif mode == 'c':
+ * order = b'C'
+ * self.mode = u'c' # <<<<<<<<<<<<<<
+ * else:
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
+ */
+ __Pyx_INCREF(__pyx_n_u_c);
+ __Pyx_GIVEREF(__pyx_n_u_c);
+ __Pyx_GOTREF(__pyx_v_self->mode);
+ __Pyx_DECREF(__pyx_v_self->mode);
+ __pyx_v_self->mode = __pyx_n_u_c;
+ goto __pyx_L10;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":158
+ * self.mode = u'c'
+ * else:
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
+ *
+ * self.len = fill_contig_strides_array(self._shape, self._strides,
+ */
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L10:;
+
+ /* "View.MemoryView":160
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
+ *
+ * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
+ * itemsize, self.ndim, order)
+ *
+ */
+ __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
+
+ /* "View.MemoryView":163
+ * itemsize, self.ndim, order)
+ *
+ * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer:
+ */
+ __pyx_v_self->free_data = __pyx_v_allocate_buffer;
+
+ /* "View.MemoryView":164
+ *
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
+ * if allocate_buffer:
+ *
+ */
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_self->dtype_is_object = __pyx_t_4;
+
+ /* "View.MemoryView":165
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer: # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":168
+ *
+ *
+ * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
+ * if not self.data:
+ * raise MemoryError("unable to allocate array data.")
+ */
+ __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
+
+ /* "View.MemoryView":169
+ *
+ * self.data = <char *>malloc(self.len)
+ * if not self.data: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate array data.")
+ *
+ */
+ __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":170
+ * self.data = <char *>malloc(self.len)
+ * if not self.data:
+ * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
+ *
+ * if self.dtype_is_object:
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __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[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":172
+ * raise MemoryError("unable to allocate array data.")
+ *
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ */
+ __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":173
+ *
+ * if self.dtype_is_object:
+ * p = <PyObject **> self.data # <<<<<<<<<<<<<<
+ * for i in range(self.len / itemsize):
+ * p[i] = Py_None
+ */
+ __pyx_v_p = ((PyObject **)__pyx_v_self->data);
+
+ /* "View.MemoryView":174
+ * if self.dtype_is_object:
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
+ * p[i] = Py_None
+ * Py_INCREF(Py_None)
+ */
+ if (unlikely(__pyx_v_itemsize == 0)) {
+ #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[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
+ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
+ __pyx_v_i = __pyx_t_8;
+
+ /* "View.MemoryView":175
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ * p[i] = Py_None # <<<<<<<<<<<<<<
+ * Py_INCREF(Py_None)
+ *
+ */
+ (__pyx_v_p[__pyx_v_i]) = Py_None;
+
+ /* "View.MemoryView":176
+ * for i in range(self.len / itemsize):
+ * p[i] = Py_None
+ * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
+ *
+ * @cname('getbuffer')
+ */
+ Py_INCREF(Py_None);
+ }
+ goto __pyx_L13;
+ }
+ __pyx_L13:;
+ goto __pyx_L11;
+ }
+ __pyx_L11:;
+
+ /* "View.MemoryView":116
+ * cdef bint dtype_is_object
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
+ * mode="c", bint allocate_buffer=True):
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_format);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":179
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * cdef int bufmode = -1
+ * if self.mode == u"c":
+ */
+
+/* Python wrapper */
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
+ __pyx_r = __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_v_bufmode;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ char *__pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+ int __pyx_t_6;
+ Py_ssize_t *__pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ if (__pyx_v_info != NULL) {
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_info->obj);
+ }
+
+ /* "View.MemoryView":180
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * cdef int bufmode = -1 # <<<<<<<<<<<<<<
+ * if self.mode == u"c":
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ */
+ __pyx_v_bufmode = -1;
+
+ /* "View.MemoryView":181
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * cdef int bufmode = -1
+ * if self.mode == u"c": # <<<<<<<<<<<<<<
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran":
+ */
+ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":182
+ * cdef int bufmode = -1
+ * if self.mode == u"c":
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
+ * elif self.mode == u"fortran":
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ */
+ __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":183
+ * if self.mode == u"c":
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode):
+ */
+ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":184
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran":
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ */
+ __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":185
+ * elif self.mode == u"fortran":
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode): # <<<<<<<<<<<<<<
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ * info.buf = self.data
+ */
+ __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":186
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
+ * info.buf = self.data
+ * info.len = self.len
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __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[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":187
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ * info.buf = self.data # <<<<<<<<<<<<<<
+ * info.len = self.len
+ * info.ndim = self.ndim
+ */
+ __pyx_t_4 = __pyx_v_self->data;
+ __pyx_v_info->buf = __pyx_t_4;
+
+ /* "View.MemoryView":188
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ * info.buf = self.data
+ * info.len = self.len # <<<<<<<<<<<<<<
+ * info.ndim = self.ndim
+ * info.shape = self._shape
+ */
+ __pyx_t_5 = __pyx_v_self->len;
+ __pyx_v_info->len = __pyx_t_5;
+
+ /* "View.MemoryView":189
+ * info.buf = self.data
+ * info.len = self.len
+ * info.ndim = self.ndim # <<<<<<<<<<<<<<
+ * info.shape = self._shape
+ * info.strides = self._strides
+ */
+ __pyx_t_6 = __pyx_v_self->ndim;
+ __pyx_v_info->ndim = __pyx_t_6;
+
+ /* "View.MemoryView":190
+ * info.len = self.len
+ * info.ndim = self.ndim
+ * info.shape = self._shape # <<<<<<<<<<<<<<
+ * info.strides = self._strides
+ * info.suboffsets = NULL
+ */
+ __pyx_t_7 = __pyx_v_self->_shape;
+ __pyx_v_info->shape = __pyx_t_7;
+
+ /* "View.MemoryView":191
+ * info.ndim = self.ndim
+ * info.shape = self._shape
+ * info.strides = self._strides # <<<<<<<<<<<<<<
+ * info.suboffsets = NULL
+ * info.itemsize = self.itemsize
+ */
+ __pyx_t_7 = __pyx_v_self->_strides;
+ __pyx_v_info->strides = __pyx_t_7;
+
+ /* "View.MemoryView":192
+ * info.shape = self._shape
+ * info.strides = self._strides
+ * info.suboffsets = NULL # <<<<<<<<<<<<<<
+ * info.itemsize = self.itemsize
+ * info.readonly = 0
+ */
+ __pyx_v_info->suboffsets = NULL;
+
+ /* "View.MemoryView":193
+ * info.strides = self._strides
+ * info.suboffsets = NULL
+ * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
+ * info.readonly = 0
+ *
+ */
+ __pyx_t_5 = __pyx_v_self->itemsize;
+ __pyx_v_info->itemsize = __pyx_t_5;
+
+ /* "View.MemoryView":194
+ * info.suboffsets = NULL
+ * info.itemsize = self.itemsize
+ * info.readonly = 0 # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_FORMAT:
+ */
+ __pyx_v_info->readonly = 0;
+
+ /* "View.MemoryView":196
+ * info.readonly = 0
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.format
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":197
+ *
+ * if flags & PyBUF_FORMAT:
+ * info.format = self.format # <<<<<<<<<<<<<<
+ * else:
+ * info.format = NULL
+ */
+ __pyx_t_4 = __pyx_v_self->format;
+ __pyx_v_info->format = __pyx_t_4;
+ goto __pyx_L5;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":199
+ * info.format = self.format
+ * else:
+ * info.format = NULL # <<<<<<<<<<<<<<
+ *
+ * info.obj = self
+ */
+ __pyx_v_info->format = NULL;
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":201
+ * info.format = NULL
+ *
+ * info.obj = self # <<<<<<<<<<<<<<
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
+
+ /* "View.MemoryView":179
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * cdef int bufmode = -1
+ * if self.mode == u"c":
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
+ }
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
+ __Pyx_GOTREF(Py_None);
+ __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
+ }
+ __pyx_L2:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":205
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
+ *
+ * def __dealloc__(array self): # <<<<<<<<<<<<<<
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data)
+ */
+
+/* Python wrapper */
+static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_array_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "View.MemoryView":206
+ *
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ */
+ __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":207
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
+ * elif self.free_data:
+ * if self.dtype_is_object:
+ */
+ __pyx_v_self->callback_free_data(__pyx_v_self->data);
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":208
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data)
+ * elif self.free_data: # <<<<<<<<<<<<<<
+ * if self.dtype_is_object:
+ * refcount_objects_in_slice(self.data, self._shape,
+ */
+ __pyx_t_1 = (__pyx_v_self->free_data != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":209
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice(self.data, self._shape,
+ * self._strides, self.ndim, False)
+ */
+ __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":210
+ * elif self.free_data:
+ * if self.dtype_is_object:
+ * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
+ * self._strides, self.ndim, False)
+ * free(self.data)
+ */
+ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":212
+ * refcount_objects_in_slice(self.data, self._shape,
+ * self._strides, self.ndim, False)
+ * free(self.data) # <<<<<<<<<<<<<<
+ * PyMem_Free(self._shape)
+ *
+ */
+ free(__pyx_v_self->data);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":213
+ * self._strides, self.ndim, False)
+ * free(self.data)
+ * PyMem_Free(self._shape) # <<<<<<<<<<<<<<
+ *
+ * property memview:
+ */
+ PyMem_Free(__pyx_v_self->_shape);
+
+ /* "View.MemoryView":205
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
+ *
+ * def __dealloc__(array self): # <<<<<<<<<<<<<<
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data)
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":217
+ * property memview:
+ * @cname('get_memview')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ *
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ */
+
+/* Python wrapper */
+static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/
+static PyObject *get_memview(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = get_memview_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+ int __pyx_v_flags;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":219
+ * def __get__(self):
+ *
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
+ * return memoryview(self, flags, self.dtype_is_object)
+ *
+ */
+ __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
+
+ /* "View.MemoryView":220
+ *
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":217
+ * property memview:
+ * @cname('get_memview')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ *
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":223
+ *
+ *
+ * def __getattr__(self, attr): # <<<<<<<<<<<<<<
+ * return getattr(self.memview, attr)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
+static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
+ __pyx_r = __pyx_array_MemoryView_5array_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getattr__", 0);
+
+ /* "View.MemoryView":224
+ *
+ * def __getattr__(self, attr):
+ * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
+ *
+ * def __getitem__(self, item):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":223
+ *
+ *
+ * def __getattr__(self, attr): # <<<<<<<<<<<<<<
+ * return getattr(self.memview, attr)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":226
+ * return getattr(self.memview, attr)
+ *
+ * def __getitem__(self, item): # <<<<<<<<<<<<<<
+ * return self.memview[item]
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
+ __pyx_r = __pyx_array_MemoryView_5array_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getitem__", 0);
+
+ /* "View.MemoryView":227
+ *
+ * def __getitem__(self, item):
+ * return self.memview[item] # <<<<<<<<<<<<<<
+ *
+ * def __setitem__(self, item, value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":226
+ * return getattr(self.memview, attr)
+ *
+ * def __getitem__(self, item): # <<<<<<<<<<<<<<
+ * return self.memview[item]
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":229
+ * return self.memview[item]
+ *
+ * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
+ * self.memview[item] = value
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
+ __pyx_r = __pyx_array_MemoryView_5array_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__setitem__", 0);
+
+ /* "View.MemoryView":230
+ *
+ * def __setitem__(self, item, value):
+ * self.memview[item] = value # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "View.MemoryView":229
+ * return self.memview[item]
+ *
+ * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
+ * self.memview[item] = value
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":234
+ *
+ * @cname("__pyx_array_new")
+ * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
+ * char *mode, char *buf):
+ * cdef array result
+ */
+
+static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
+ struct __pyx_array_obj *__pyx_v_result = 0;
+ struct __pyx_array_obj *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("array_cwrapper", 0);
+
+ /* "View.MemoryView":238
+ * cdef array result
+ *
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":239
+ *
+ * if buf == NULL:
+ * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
+ */
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
+ __Pyx_GIVEREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 0;
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
+ __pyx_t_4 = 0;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":241
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
+ * allocate_buffer=False)
+ * result.data = buf
+ */
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __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[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
+ __Pyx_GIVEREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_4 = 0;
+ __pyx_t_5 = 0;
+ __pyx_t_3 = 0;
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+
+ /* "View.MemoryView":242
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
+ * allocate_buffer=False) # <<<<<<<<<<<<<<
+ * result.data = buf
+ *
+ */
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":241
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
+ * allocate_buffer=False)
+ * result.data = buf
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":243
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
+ * allocate_buffer=False)
+ * result.data = buf # <<<<<<<<<<<<<<
+ *
+ * return result
+ */
+ __pyx_v_result->data = __pyx_v_buf;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":245
+ * result.data = buf
+ *
+ * return result # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":234
+ *
+ * @cname("__pyx_array_new")
+ * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
+ * char *mode, char *buf):
+ * cdef array result
+ */
+
+ /* 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);
+ __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF((PyObject *)__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":271
+ * cdef class Enum(object):
+ * cdef object name
+ * def __init__(self, name): # <<<<<<<<<<<<<<
+ * self.name = name
+ * def __repr__(self):
+ */
+
+/* Python wrapper */
+static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_name = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
+ PyObject* values[1] = {0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ }
+ __pyx_v_name = values[0];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__", 0);
+
+ /* "View.MemoryView":272
+ * cdef object name
+ * def __init__(self, name):
+ * self.name = name # <<<<<<<<<<<<<<
+ * def __repr__(self):
+ * return self.name
+ */
+ __Pyx_INCREF(__pyx_v_name);
+ __Pyx_GIVEREF(__pyx_v_name);
+ __Pyx_GOTREF(__pyx_v_self->name);
+ __Pyx_DECREF(__pyx_v_self->name);
+ __pyx_v_self->name = __pyx_v_name;
+
+ /* "View.MemoryView":271
+ * cdef class Enum(object):
+ * cdef object name
+ * def __init__(self, name): # <<<<<<<<<<<<<<
+ * self.name = name
+ * def __repr__(self):
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":273
+ * def __init__(self, name):
+ * self.name = name
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return self.name
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+ __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__repr__", 0);
+
+ /* "View.MemoryView":274
+ * self.name = name
+ * def __repr__(self):
+ * return self.name # <<<<<<<<<<<<<<
+ *
+ * cdef generic = Enum("<strided and direct or indirect>")
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->name);
+ __pyx_r = __pyx_v_self->name;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":273
+ * def __init__(self, name):
+ * self.name = name
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return self.name
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":288
+ *
+ * @cname('__pyx_align_pointer')
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
+ * "Align pointer memory on a given boundary"
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
+ */
+
+static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
+ Py_intptr_t __pyx_v_aligned_p;
+ size_t __pyx_v_offset;
+ void *__pyx_r;
+ int __pyx_t_1;
+
+ /* "View.MemoryView":290
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil:
+ * "Align pointer memory on a given boundary"
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
+ * cdef size_t offset
+ *
+ */
+ __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
+
+ /* "View.MemoryView":294
+ *
+ * with cython.cdivision(True):
+ * offset = aligned_p % alignment # <<<<<<<<<<<<<<
+ *
+ * if offset > 0:
+ */
+ __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
+
+ /* "View.MemoryView":296
+ * offset = aligned_p % alignment
+ *
+ * if offset > 0: # <<<<<<<<<<<<<<
+ * aligned_p += alignment - offset
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":297
+ *
+ * if offset > 0:
+ * aligned_p += alignment - offset # <<<<<<<<<<<<<<
+ *
+ * return <void *> aligned_p
+ */
+ __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":299
+ * aligned_p += alignment - offset
+ *
+ * return <void *> aligned_p # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview')
+ */
+ __pyx_r = ((void *)__pyx_v_aligned_p);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":288
+ *
+ * @cname('__pyx_align_pointer')
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
+ * "Align pointer memory on a given boundary"
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":317
+ * cdef __Pyx_TypeInfo *typeinfo
+ *
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
+ * self.obj = obj
+ * self.flags = flags
+ */
+
+/* Python wrapper */
+static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_obj = 0;
+ int __pyx_v_flags;
+ int __pyx_v_dtype_is_object;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_is_object);
+ if (value) { values[2] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_obj = values[0];
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (values[2]) {
+ __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+ __pyx_v_dtype_is_object = ((int)0);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__cinit__", 0);
+
+ /* "View.MemoryView":318
+ *
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
+ * self.obj = obj # <<<<<<<<<<<<<<
+ * self.flags = flags
+ * if type(self) is memoryview or obj is not None:
+ */
+ __Pyx_INCREF(__pyx_v_obj);
+ __Pyx_GIVEREF(__pyx_v_obj);
+ __Pyx_GOTREF(__pyx_v_self->obj);
+ __Pyx_DECREF(__pyx_v_self->obj);
+ __pyx_v_self->obj = __pyx_v_obj;
+
+ /* "View.MemoryView":319
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
+ * self.obj = obj
+ * self.flags = flags # <<<<<<<<<<<<<<
+ * if type(self) is memoryview or obj is not None:
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ */
+ __pyx_v_self->flags = __pyx_v_flags;
+
+ /* "View.MemoryView":320
+ * self.obj = obj
+ * self.flags = flags
+ * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL:
+ */
+ __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)((PyObject *)__pyx_memoryview_type)));
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (!__pyx_t_3) {
+ } else {
+ __pyx_t_1 = __pyx_t_3;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_3 = (__pyx_v_obj != Py_None);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L4_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":321
+ * self.flags = flags
+ * if type(self) is memoryview or obj is not None:
+ * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
+ * if <PyObject *> self.view.obj == NULL:
+ * (<__pyx_buffer *> &self.view).obj = Py_None
+ */
+ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":322
+ * if type(self) is memoryview or obj is not None:
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
+ * (<__pyx_buffer *> &self.view).obj = Py_None
+ * Py_INCREF(Py_None)
+ */
+ __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":323
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL:
+ * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
+ * Py_INCREF(Py_None)
+ *
+ */
+ ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
+
+ /* "View.MemoryView":324
+ * if <PyObject *> self.view.obj == NULL:
+ * (<__pyx_buffer *> &self.view).obj = Py_None
+ * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
+ *
+ * self.lock = PyThread_allocate_lock()
+ */
+ Py_INCREF(Py_None);
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":326
+ * Py_INCREF(Py_None)
+ *
+ * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
+ * if self.lock == NULL:
+ * raise MemoryError
+ */
+ __pyx_v_self->lock = PyThread_allocate_lock();
+
+ /* "View.MemoryView":327
+ *
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":328
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock == NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_FORMAT:
+ */
+ PyErr_NoMemory(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":330
+ * raise MemoryError
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * self.dtype_is_object = self.view.format == b'O'
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":331
+ *
+ * if flags & PyBUF_FORMAT:
+ * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<<
+ * else:
+ * self.dtype_is_object = dtype_is_object
+ */
+ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_v_self->dtype_is_object = __pyx_t_1;
+ goto __pyx_L8;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":333
+ * self.dtype_is_object = self.view.format == b'O'
+ * else:
+ * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
+ *
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
+ */
+ __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
+ }
+ __pyx_L8:;
+
+ /* "View.MemoryView":335
+ * self.dtype_is_object = dtype_is_object
+ *
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
+ * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
+ * self.typeinfo = NULL
+ */
+ __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
+
+ /* "View.MemoryView":337
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
+ * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
+ * self.typeinfo = NULL # <<<<<<<<<<<<<<
+ *
+ * def __dealloc__(memoryview self):
+ */
+ __pyx_v_self->typeinfo = NULL;
+
+ /* "View.MemoryView":317
+ * cdef __Pyx_TypeInfo *typeinfo
+ *
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
+ * self.obj = obj
+ * self.flags = flags
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":339
+ * self.typeinfo = NULL
+ *
+ * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
+ * if self.obj is not None:
+ * __Pyx_ReleaseBuffer(&self.view)
+ */
+
+/* Python wrapper */
+static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "View.MemoryView":340
+ *
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None: # <<<<<<<<<<<<<<
+ * __Pyx_ReleaseBuffer(&self.view)
+ *
+ */
+ __pyx_t_1 = (__pyx_v_self->obj != Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":341
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None:
+ * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
+ *
+ * if self.lock != NULL:
+ */
+ __Pyx_ReleaseBuffer((&__pyx_v_self->view));
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":343
+ * __Pyx_ReleaseBuffer(&self.view)
+ *
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
+ * PyThread_free_lock(self.lock)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":344
+ *
+ * if self.lock != NULL:
+ * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
+ *
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL:
+ */
+ PyThread_free_lock(__pyx_v_self->lock);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":339
+ * self.typeinfo = NULL
+ *
+ * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
+ * if self.obj is not None:
+ * __Pyx_ReleaseBuffer(&self.view)
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":346
+ * PyThread_free_lock(self.lock)
+ *
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dim
+ * cdef char *itemp = <char *> self.view.buf
+ */
+
+static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
+ Py_ssize_t __pyx_v_dim;
+ char *__pyx_v_itemp;
+ PyObject *__pyx_v_idx = NULL;
+ char *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ Py_ssize_t __pyx_t_3;
+ PyObject *(*__pyx_t_4)(PyObject *);
+ PyObject *__pyx_t_5 = NULL;
+ Py_ssize_t __pyx_t_6;
+ char *__pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("get_item_pointer", 0);
+
+ /* "View.MemoryView":348
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL:
+ * cdef Py_ssize_t dim
+ * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
+ *
+ * for dim, idx in enumerate(index):
+ */
+ __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
+
+ /* "View.MemoryView":350
+ * cdef char *itemp = <char *> self.view.buf
+ *
+ * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
+ *
+ */
+ __pyx_t_1 = 0;
+ if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
+ __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
+ __pyx_t_4 = NULL;
+ } else {
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ for (;;) {
+ if (likely(!__pyx_t_4)) {
+ if (likely(PyList_CheckExact(__pyx_t_2))) {
+ if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else {
+ if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ }
+ } else {
+ __pyx_t_5 = __pyx_t_4(__pyx_t_2);
+ if (unlikely(!__pyx_t_5)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_5);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_v_dim = __pyx_t_1;
+ __pyx_t_1 = (__pyx_t_1 + 1);
+
+ /* "View.MemoryView":351
+ *
+ * for dim, idx in enumerate(index):
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
+ *
+ * return itemp
+ */
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_itemp = __pyx_t_7;
+
+ /* "View.MemoryView":350
+ * cdef char *itemp = <char *> self.view.buf
+ *
+ * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
+ *
+ */
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":353
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
+ *
+ * return itemp # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_itemp;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":346
+ * PyThread_free_lock(self.lock)
+ *
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dim
+ * cdef char *itemp = <char *> self.view.buf
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_idx);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":356
+ *
+ *
+ * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
+ * if index is Ellipsis:
+ * return self
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
+static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
+ PyObject *__pyx_v_have_slices = NULL;
+ PyObject *__pyx_v_indices = NULL;
+ char *__pyx_v_itemp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getitem__", 0);
+
+ /* "View.MemoryView":357
+ *
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
+ __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":358
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis:
+ * return self # <<<<<<<<<<<<<<
+ *
+ * have_slices, indices = _unellipsify(index, self.view.ndim)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __pyx_r = ((PyObject *)__pyx_v_self);
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":360
+ * return self
+ *
+ * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * cdef char *itemp
+ */
+ __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (likely(__pyx_t_3 != Py_None)) {
+ PyObject* sequence = __pyx_t_3;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ Py_ssize_t size = Py_SIZE(sequence);
+ #else
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ #else
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ #endif
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else {
+ __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_v_have_slices = __pyx_t_4;
+ __pyx_t_4 = 0;
+ __pyx_v_indices = __pyx_t_5;
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":363
+ *
+ * cdef char *itemp
+ * if have_slices: # <<<<<<<<<<<<<<
+ * return memview_slice(self, indices)
+ * else:
+ */
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":364
+ * cdef char *itemp
+ * if have_slices:
+ * return memview_slice(self, indices) # <<<<<<<<<<<<<<
+ * else:
+ * itemp = self.get_item_pointer(indices)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":366
+ * return memview_slice(self, indices)
+ * else:
+ * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
+ * return self.convert_item_to_object(itemp)
+ *
+ */
+ __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_itemp = __pyx_t_6;
+
+ /* "View.MemoryView":367
+ * else:
+ * itemp = self.get_item_pointer(indices)
+ * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
+ *
+ * def __setitem__(memoryview self, object index, object value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":356
+ *
+ *
+ * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
+ * if index is Ellipsis:
+ * return self
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_have_slices);
+ __Pyx_XDECREF(__pyx_v_indices);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":369
+ * return self.convert_item_to_object(itemp)
+ *
+ * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
+ PyObject *__pyx_v_have_slices = NULL;
+ PyObject *__pyx_v_obj = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__setitem__", 0);
+ __Pyx_INCREF(__pyx_v_index);
+
+ /* "View.MemoryView":370
+ *
+ * def __setitem__(memoryview self, object index, object value):
+ * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * if have_slices:
+ */
+ __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (likely(__pyx_t_1 != Py_None)) {
+ PyObject* sequence = __pyx_t_1;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ Py_ssize_t size = Py_SIZE(sequence);
+ #else
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_3);
+ #else
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ #endif
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else {
+ __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_v_have_slices = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":372
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ * if have_slices: # <<<<<<<<<<<<<<
+ * obj = self.is_slice(value)
+ * if obj:
+ */
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":373
+ *
+ * if have_slices:
+ * obj = self.is_slice(value) # <<<<<<<<<<<<<<
+ * if obj:
+ * self.setitem_slice_assignment(self[index], obj)
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_obj = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":374
+ * if have_slices:
+ * obj = self.is_slice(value)
+ * if obj: # <<<<<<<<<<<<<<
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ */
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":375
+ * obj = self.is_slice(value)
+ * if obj:
+ * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
+ * else:
+ * self.setitem_slice_assign_scalar(self[index], value)
+ */
+ __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":377
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
+ * else:
+ * self.setitem_indexed(index, value)
+ */
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __Pyx_GOTREF(__pyx_t_3);
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
+ __pyx_L4:;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":379
+ * self.setitem_slice_assign_scalar(self[index], value)
+ * else:
+ * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
+ *
+ * cdef is_slice(self, obj):
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":369
+ * return self.convert_item_to_object(itemp)
+ *
+ * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_have_slices);
+ __Pyx_XDECREF(__pyx_v_obj);
+ __Pyx_XDECREF(__pyx_v_index);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":381
+ * self.setitem_indexed(index, value)
+ *
+ * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
+ * if not isinstance(obj, memoryview):
+ * try:
+ */
+
+static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ int __pyx_t_9;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("is_slice", 0);
+ __Pyx_INCREF(__pyx_v_obj);
+
+ /* "View.MemoryView":382
+ *
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, ((PyObject *)__pyx_memoryview_type));
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":383
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ {
+ __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_5);
+ /*try:*/ {
+
+ /* "View.MemoryView":384
+ * if not isinstance(obj, memoryview):
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
+ * self.dtype_is_object)
+ * except TypeError:
+ */
+ __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "View.MemoryView":385
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object) # <<<<<<<<<<<<<<
+ * except TypeError:
+ * return None
+ */
+ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "View.MemoryView":384
+ * if not isinstance(obj, memoryview):
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
+ * self.dtype_is_object)
+ * except TypeError:
+ */
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_INCREF(__pyx_v_obj);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
+ __Pyx_GIVEREF(__pyx_v_obj);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_6 = 0;
+ __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
+ __pyx_t_7 = 0;
+ }
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ goto __pyx_L11_try_end;
+ __pyx_L4_error:;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "View.MemoryView":386
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ * except TypeError: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
+ __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ if (__pyx_t_9) {
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "View.MemoryView":387
+ * self.dtype_is_object)
+ * except TypeError:
+ * return None # <<<<<<<<<<<<<<
+ *
+ * return obj
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(Py_None);
+ __pyx_r = Py_None;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ goto __pyx_L7_except_return;
+ }
+ goto __pyx_L6_except_error;
+ __pyx_L6_except_error:;
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+ goto __pyx_L1_error;
+ __pyx_L7_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+ goto __pyx_L0;
+ __pyx_L11_try_end:;
+ }
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":389
+ * return None
+ *
+ * return obj # <<<<<<<<<<<<<<
+ *
+ * cdef setitem_slice_assignment(self, dst, src):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_obj);
+ __pyx_r = __pyx_v_obj;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":381
+ * self.setitem_indexed(index, value)
+ *
+ * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
+ * if not isinstance(obj, memoryview):
+ * try:
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_obj);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":391
+ * return obj
+ *
+ * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice dst_slice
+ * cdef __Pyx_memviewslice src_slice
+ */
+
+static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
+ __Pyx_memviewslice __pyx_v_dst_slice;
+ __Pyx_memviewslice __pyx_v_src_slice;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
+
+ /* "View.MemoryView":395
+ * cdef __Pyx_memviewslice src_slice
+ *
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
+ * get_slice_from_memview(dst, &dst_slice)[0],
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ */
+ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":396
+ *
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
+ * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ *
+ */
+ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":397
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
+ * get_slice_from_memview(dst, &dst_slice)[0],
+ * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "View.MemoryView":395
+ * cdef __Pyx_memviewslice src_slice
+ *
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
+ * get_slice_from_memview(dst, &dst_slice)[0],
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ */
+ __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":391
+ * return obj
+ *
+ * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice dst_slice
+ * cdef __Pyx_memviewslice src_slice
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":399
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ *
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
+ * cdef int array[128]
+ * cdef void *tmp = NULL
+ */
+
+static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
+ int __pyx_v_array[128];
+ void *__pyx_v_tmp;
+ void *__pyx_v_item;
+ __Pyx_memviewslice *__pyx_v_dst_slice;
+ __Pyx_memviewslice __pyx_v_tmp_slice;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ char const *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ PyObject *__pyx_t_11 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
+
+ /* "View.MemoryView":401
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
+ * cdef int array[128]
+ * cdef void *tmp = NULL # <<<<<<<<<<<<<<
+ * cdef void *item
+ *
+ */
+ __pyx_v_tmp = NULL;
+
+ /* "View.MemoryView":406
+ * cdef __Pyx_memviewslice *dst_slice
+ * cdef __Pyx_memviewslice tmp_slice
+ * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
+ *
+ * if <size_t>self.view.itemsize > sizeof(array):
+ */
+ __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
+
+ /* "View.MemoryView":408
+ * dst_slice = get_slice_from_memview(dst, &tmp_slice)
+ *
+ * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL:
+ */
+ __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":409
+ *
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
+ * if tmp == NULL:
+ * raise MemoryError
+ */
+ __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
+
+ /* "View.MemoryView":410
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ * item = tmp
+ */
+ __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":411
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
+ * item = tmp
+ * else:
+ */
+ PyErr_NoMemory(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":412
+ * if tmp == NULL:
+ * raise MemoryError
+ * item = tmp # <<<<<<<<<<<<<<
+ * else:
+ * item = <void *> array
+ */
+ __pyx_v_item = __pyx_v_tmp;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":414
+ * item = tmp
+ * else:
+ * item = <void *> array # <<<<<<<<<<<<<<
+ *
+ * try:
+ */
+ __pyx_v_item = ((void *)__pyx_v_array);
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":416
+ * item = <void *> array
+ *
+ * try: # <<<<<<<<<<<<<<
+ * if self.dtype_is_object:
+ * (<PyObject **> item)[0] = <PyObject *> value
+ */
+ /*try:*/ {
+
+ /* "View.MemoryView":417
+ *
+ * try:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":418
+ * try:
+ * if self.dtype_is_object:
+ * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
+ * else:
+ * self.assign_item_from_object(<char *> item, value)
+ */
+ (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
+ goto __pyx_L8;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":420
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ __pyx_L8:;
+
+ /* "View.MemoryView":424
+ *
+ *
+ * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":425
+ *
+ * if self.view.suboffsets != NULL:
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
+ * item, self.dtype_is_object)
+ */
+ __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ goto __pyx_L9;
+ }
+ __pyx_L9:;
+
+ /* "View.MemoryView":426
+ * if self.view.suboffsets != NULL:
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
+ * item, self.dtype_is_object)
+ * finally:
+ */
+ __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
+ }
+
+ /* "View.MemoryView":429
+ * item, self.dtype_is_object)
+ * finally:
+ * PyMem_Free(tmp) # <<<<<<<<<<<<<<
+ *
+ * cdef setitem_indexed(self, index, value):
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ PyMem_Free(__pyx_v_tmp);
+ goto __pyx_L7;
+ }
+ /*exception exit:*/{
+ __pyx_L6_error:;
+ __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+ if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
+ __Pyx_XGOTREF(__pyx_t_6);
+ __Pyx_XGOTREF(__pyx_t_7);
+ __Pyx_XGOTREF(__pyx_t_8);
+ __Pyx_XGOTREF(__pyx_t_9);
+ __Pyx_XGOTREF(__pyx_t_10);
+ __Pyx_XGOTREF(__pyx_t_11);
+ __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
+ {
+ PyMem_Free(__pyx_v_tmp);
+ }
+ if (PY_MAJOR_VERSION >= 3) {
+ __Pyx_XGIVEREF(__pyx_t_9);
+ __Pyx_XGIVEREF(__pyx_t_10);
+ __Pyx_XGIVEREF(__pyx_t_11);
+ __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+ }
+ __Pyx_XGIVEREF(__pyx_t_6);
+ __Pyx_XGIVEREF(__pyx_t_7);
+ __Pyx_XGIVEREF(__pyx_t_8);
+ __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+ __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
+ __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
+ goto __pyx_L1_error;
+ }
+ __pyx_L7:;
+ }
+
+ /* "View.MemoryView":399
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ *
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
+ * cdef int array[128]
+ * cdef void *tmp = NULL
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":431
+ * PyMem_Free(tmp)
+ *
+ * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
+ * cdef char *itemp = self.get_item_pointer(index)
+ * self.assign_item_from_object(itemp, value)
+ */
+
+static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
+ char *__pyx_v_itemp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ char *__pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("setitem_indexed", 0);
+
+ /* "View.MemoryView":432
+ *
+ * cdef setitem_indexed(self, index, value):
+ * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
+ * self.assign_item_from_object(itemp, value)
+ *
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_itemp = __pyx_t_1;
+
+ /* "View.MemoryView":433
+ * cdef setitem_indexed(self, index, value):
+ * cdef char *itemp = self.get_item_pointer(index)
+ * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ */
+ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":431
+ * PyMem_Free(tmp)
+ *
+ * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
+ * cdef char *itemp = self.get_item_pointer(index)
+ * self.assign_item_from_object(itemp, value)
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":435
+ * self.assign_item_from_object(itemp, value)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
+ PyObject *__pyx_v_struct = NULL;
+ PyObject *__pyx_v_bytesitem = 0;
+ PyObject *__pyx_v_result = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ Py_ssize_t __pyx_t_8;
+ PyObject *__pyx_t_9 = NULL;
+ size_t __pyx_t_10;
+ int __pyx_t_11;
+ int __pyx_t_12;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("convert_item_to_object", 0);
+
+ /* "View.MemoryView":438
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ * import struct # <<<<<<<<<<<<<<
+ * cdef bytes bytesitem
+ *
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_struct = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":441
+ * cdef bytes bytesitem
+ *
+ * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
+ * try:
+ * result = struct.unpack(self.view.format, bytesitem)
+ */
+ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":442
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ {
+ __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ /*try:*/ {
+
+ /* "View.MemoryView":443
+ * bytesitem = itemp[:self.view.itemsize]
+ * try:
+ * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
+ * except struct.error:
+ * raise ValueError("Unable to convert item to object")
+ */
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = NULL;
+ __pyx_t_8 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_7)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ __pyx_t_8 = 1;
+ }
+ }
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+ }
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_v_bytesitem);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
+ __Pyx_GIVEREF(__pyx_v_bytesitem);
+ __pyx_t_6 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_result = __pyx_t_1;
+ __pyx_t_1 = 0;
+ }
+ /*else:*/ {
+
+ /* "View.MemoryView":447
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
+ * return result[0]
+ * return result
+ */
+ __pyx_t_10 = strlen(__pyx_v_self->view.format);
+ __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
+ if (__pyx_t_11) {
+
+ /* "View.MemoryView":448
+ * else:
+ * if len(self.view.format) == 1:
+ * return result[0] # <<<<<<<<<<<<<<
+ * return result
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;};
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L6_except_return;
+ }
+
+ /* "View.MemoryView":449
+ * if len(self.view.format) == 1:
+ * return result[0]
+ * return result # <<<<<<<<<<<<<<
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_result);
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L6_except_return;
+ }
+ __pyx_L3_error:;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "View.MemoryView":444
+ * try:
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error: # <<<<<<<<<<<<<<
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_12 = PyErr_ExceptionMatches(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__pyx_t_12) {
+ __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_9);
+
+ /* "View.MemoryView":445
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
+ * else:
+ * if len(self.view.format) == 1:
+ */
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L1_error;
+ __pyx_L6_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":435
+ * self.assign_item_from_object(itemp, value)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_struct);
+ __Pyx_XDECREF(__pyx_v_bytesitem);
+ __Pyx_XDECREF(__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":451
+ * return result
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
+ PyObject *__pyx_v_struct = NULL;
+ char __pyx_v_c;
+ PyObject *__pyx_v_bytesvalue = 0;
+ Py_ssize_t __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ Py_ssize_t __pyx_t_7;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ char *__pyx_t_10;
+ char *__pyx_t_11;
+ char *__pyx_t_12;
+ char *__pyx_t_13;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("assign_item_from_object", 0);
+
+ /* "View.MemoryView":454
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ * import struct # <<<<<<<<<<<<<<
+ * cdef char c
+ * cdef bytes bytesvalue
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_struct = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":459
+ * cdef Py_ssize_t i
+ *
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ */
+ __pyx_t_2 = PyTuple_Check(__pyx_v_value);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "View.MemoryView":460
+ *
+ * if isinstance(value, tuple):
+ * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
+ * else:
+ * bytesvalue = struct.pack(self.view.format, value)
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __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_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
+ __pyx_t_4 = 0;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":462
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
+ *
+ * for i, c in enumerate(bytesvalue):
+ */
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = NULL;
+ __pyx_t_7 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ __pyx_t_7 = 1;
+ }
+ }
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ if (__pyx_t_5) {
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ }
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ __pyx_t_1 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
+ __pyx_t_4 = 0;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":464
+ * bytesvalue = struct.pack(self.view.format, value)
+ *
+ * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
+ * itemp[i] = c
+ *
+ */
+ __pyx_t_7 = 0;
+ if (unlikely(__pyx_v_bytesvalue == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_INCREF(__pyx_v_bytesvalue);
+ __pyx_t_9 = __pyx_v_bytesvalue;
+ __pyx_t_11 = PyBytes_AS_STRING(__pyx_t_9);
+ __pyx_t_12 = (__pyx_t_11 + PyBytes_GET_SIZE(__pyx_t_9));
+ for (__pyx_t_13 = __pyx_t_11; __pyx_t_13 < __pyx_t_12; __pyx_t_13++) {
+ __pyx_t_10 = __pyx_t_13;
+ __pyx_v_c = (__pyx_t_10[0]);
+
+ /* "View.MemoryView":465
+ *
+ * for i, c in enumerate(bytesvalue):
+ * itemp[i] = c # <<<<<<<<<<<<<<
+ *
+ * @cname('getbuffer')
+ */
+ __pyx_v_i = __pyx_t_7;
+
+ /* "View.MemoryView":464
+ * bytesvalue = struct.pack(self.view.format, value)
+ *
+ * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
+ * itemp[i] = c
+ *
+ */
+ __pyx_t_7 = (__pyx_t_7 + 1);
+
+ /* "View.MemoryView":465
+ *
+ * for i, c in enumerate(bytesvalue):
+ * itemp[i] = c # <<<<<<<<<<<<<<
+ *
+ * @cname('getbuffer')
+ */
+ (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
+ }
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+ /* "View.MemoryView":451
+ * return result
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_struct);
+ __Pyx_XDECREF(__pyx_v_bytesvalue);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":468
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * if flags & PyBUF_STRIDES:
+ * info.shape = self.view.shape
+ */
+
+/* Python wrapper */
+static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ char *__pyx_t_3;
+ void *__pyx_t_4;
+ int __pyx_t_5;
+ Py_ssize_t __pyx_t_6;
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ if (__pyx_v_info != NULL) {
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_info->obj);
+ }
+
+ /* "View.MemoryView":469
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.shape = self.view.shape
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":470
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_STRIDES:
+ * info.shape = self.view.shape # <<<<<<<<<<<<<<
+ * else:
+ * info.shape = NULL
+ */
+ __pyx_t_2 = __pyx_v_self->view.shape;
+ __pyx_v_info->shape = __pyx_t_2;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":472
+ * info.shape = self.view.shape
+ * else:
+ * info.shape = NULL # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_STRIDES:
+ */
+ __pyx_v_info->shape = NULL;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":474
+ * info.shape = NULL
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.strides = self.view.strides
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":475
+ *
+ * if flags & PyBUF_STRIDES:
+ * info.strides = self.view.strides # <<<<<<<<<<<<<<
+ * else:
+ * info.strides = NULL
+ */
+ __pyx_t_2 = __pyx_v_self->view.strides;
+ __pyx_v_info->strides = __pyx_t_2;
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":477
+ * info.strides = self.view.strides
+ * else:
+ * info.strides = NULL # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_INDIRECT:
+ */
+ __pyx_v_info->strides = NULL;
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":479
+ * info.strides = NULL
+ *
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":480
+ *
+ * if flags & PyBUF_INDIRECT:
+ * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
+ * else:
+ * info.suboffsets = NULL
+ */
+ __pyx_t_2 = __pyx_v_self->view.suboffsets;
+ __pyx_v_info->suboffsets = __pyx_t_2;
+ goto __pyx_L5;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":482
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ * info.suboffsets = NULL # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_FORMAT:
+ */
+ __pyx_v_info->suboffsets = NULL;
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":484
+ * info.suboffsets = NULL
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.view.format
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":485
+ *
+ * if flags & PyBUF_FORMAT:
+ * info.format = self.view.format # <<<<<<<<<<<<<<
+ * else:
+ * info.format = NULL
+ */
+ __pyx_t_3 = __pyx_v_self->view.format;
+ __pyx_v_info->format = __pyx_t_3;
+ goto __pyx_L6;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":487
+ * info.format = self.view.format
+ * else:
+ * info.format = NULL # <<<<<<<<<<<<<<
+ *
+ * info.buf = self.view.buf
+ */
+ __pyx_v_info->format = NULL;
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":489
+ * info.format = NULL
+ *
+ * info.buf = self.view.buf # <<<<<<<<<<<<<<
+ * info.ndim = self.view.ndim
+ * info.itemsize = self.view.itemsize
+ */
+ __pyx_t_4 = __pyx_v_self->view.buf;
+ __pyx_v_info->buf = __pyx_t_4;
+
+ /* "View.MemoryView":490
+ *
+ * info.buf = self.view.buf
+ * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
+ * info.itemsize = self.view.itemsize
+ * info.len = self.view.len
+ */
+ __pyx_t_5 = __pyx_v_self->view.ndim;
+ __pyx_v_info->ndim = __pyx_t_5;
+
+ /* "View.MemoryView":491
+ * info.buf = self.view.buf
+ * info.ndim = self.view.ndim
+ * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
+ * info.len = self.view.len
+ * info.readonly = 0
+ */
+ __pyx_t_6 = __pyx_v_self->view.itemsize;
+ __pyx_v_info->itemsize = __pyx_t_6;
+
+ /* "View.MemoryView":492
+ * info.ndim = self.view.ndim
+ * info.itemsize = self.view.itemsize
+ * info.len = self.view.len # <<<<<<<<<<<<<<
+ * info.readonly = 0
+ * info.obj = self
+ */
+ __pyx_t_6 = __pyx_v_self->view.len;
+ __pyx_v_info->len = __pyx_t_6;
+
+ /* "View.MemoryView":493
+ * info.itemsize = self.view.itemsize
+ * info.len = self.view.len
+ * info.readonly = 0 # <<<<<<<<<<<<<<
+ * info.obj = self
+ *
+ */
+ __pyx_v_info->readonly = 0;
+
+ /* "View.MemoryView":494
+ * info.len = self.view.len
+ * info.readonly = 0
+ * info.obj = self # <<<<<<<<<<<<<<
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
+
+ /* "View.MemoryView":468
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * if flags & PyBUF_STRIDES:
+ * info.shape = self.view.shape
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
+ __Pyx_GOTREF(Py_None);
+ __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
+ }
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":501
+ * property T:
+ * @cname('__pyx_memoryview_transpose')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":502
+ * @cname('__pyx_memoryview_transpose')
+ * def __get__(self):
+ * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
+ * transpose_memslice(&result.from_slice)
+ * return result
+ */
+ __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":503
+ * def __get__(self):
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
+ * return result
+ *
+ */
+ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":504
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ * return result # <<<<<<<<<<<<<<
+ *
+ * property base:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = ((PyObject *)__pyx_v_result);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":501
+ * property T:
+ * @cname('__pyx_memoryview_transpose')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":508
+ * property base:
+ * @cname('__pyx_memoryview__get__base')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.obj
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":509
+ * @cname('__pyx_memoryview__get__base')
+ * def __get__(self):
+ * return self.obj # <<<<<<<<<<<<<<
+ *
+ * property shape:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->obj);
+ __pyx_r = __pyx_v_self->obj;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":508
+ * property base:
+ * @cname('__pyx_memoryview__get__base')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.obj
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":513
+ * property shape:
+ * @cname('__pyx_memoryview_get_shape')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)])
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":514
+ * @cname('__pyx_memoryview_get_shape')
+ * def __get__(self):
+ * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ *
+ * property strides:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __pyx_v_self->view.ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+ __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_self->view.shape[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
+ __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":513
+ * property shape:
+ * @cname('__pyx_memoryview_get_shape')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)])
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":518
+ * property strides:
+ * @cname('__pyx_memoryview_get_strides')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":519
+ * @cname('__pyx_memoryview_get_strides')
+ * def __get__(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ *
+ * raise ValueError("Buffer view does not expose strides")
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":521
+ * if self.view.strides == NULL:
+ *
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ *
+ * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ */
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __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[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":523
+ * raise ValueError("Buffer view does not expose strides")
+ *
+ * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ *
+ * property suboffsets:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __pyx_v_self->view.ndim;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+ __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.strides[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":518
+ * property strides:
+ * @cname('__pyx_memoryview_get_strides')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":527
+ * property suboffsets:
+ * @cname('__pyx_memoryview_get_suboffsets')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self.view.suboffsets == NULL:
+ * return [-1] * self.view.ndim
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":528
+ * @cname('__pyx_memoryview_get_suboffsets')
+ * def __get__(self):
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
+ * return [-1] * self.view.ndim
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":529
+ * def __get__(self):
+ * if self.view.suboffsets == NULL:
+ * return [-1] * self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyList_New(1 * ((__pyx_v_self->view.ndim<0) ? 0:__pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ { Py_ssize_t __pyx_temp;
+ for (__pyx_temp=0; __pyx_temp < __pyx_v_self->view.ndim; __pyx_temp++) {
+ __Pyx_INCREF(__pyx_int_neg_1);
+ PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_int_neg_1);
+ }
+ }
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":531
+ * return [-1] * self.view.ndim
+ *
+ * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ *
+ * property ndim:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __pyx_v_self->view.ndim;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+ __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.suboffsets[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":527
+ * property suboffsets:
+ * @cname('__pyx_memoryview_get_suboffsets')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self.view.suboffsets == NULL:
+ * return [-1] * self.view.ndim
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":535
+ * property ndim:
+ * @cname('__pyx_memoryview_get_ndim')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":536
+ * @cname('__pyx_memoryview_get_ndim')
+ * def __get__(self):
+ * return self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * property itemsize:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":535
+ * property ndim:
+ * @cname('__pyx_memoryview_get_ndim')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":540
+ * property itemsize:
+ * @cname('__pyx_memoryview_get_itemsize')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":541
+ * @cname('__pyx_memoryview_get_itemsize')
+ * def __get__(self):
+ * return self.view.itemsize # <<<<<<<<<<<<<<
+ *
+ * property nbytes:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":540
+ * property itemsize:
+ * @cname('__pyx_memoryview_get_itemsize')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":545
+ * property nbytes:
+ * @cname('__pyx_memoryview_get_nbytes')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":546
+ * @cname('__pyx_memoryview_get_nbytes')
+ * def __get__(self):
+ * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
+ *
+ * property size:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":545
+ * property nbytes:
+ * @cname('__pyx_memoryview_get_nbytes')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":550
+ * property size:
+ * @cname('__pyx_memoryview_get_size')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self._size is None:
+ * result = 1
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_v_result = NULL;
+ PyObject *__pyx_v_length = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ Py_ssize_t __pyx_t_5;
+ PyObject *(*__pyx_t_6)(PyObject *);
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":551
+ * @cname('__pyx_memoryview_get_size')
+ * def __get__(self):
+ * if self._size is None: # <<<<<<<<<<<<<<
+ * result = 1
+ *
+ */
+ __pyx_t_1 = (__pyx_v_self->_size == Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":552
+ * def __get__(self):
+ * if self._size is None:
+ * result = 1 # <<<<<<<<<<<<<<
+ *
+ * for length in self.shape:
+ */
+ __Pyx_INCREF(__pyx_int_1);
+ __pyx_v_result = __pyx_int_1;
+
+ /* "View.MemoryView":554
+ * result = 1
+ *
+ * for length in self.shape: # <<<<<<<<<<<<<<
+ * result *= length
+ *
+ */
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
+ __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
+ __pyx_t_6 = NULL;
+ } else {
+ __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ for (;;) {
+ if (likely(!__pyx_t_6)) {
+ if (likely(PyList_CheckExact(__pyx_t_4))) {
+ if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else {
+ if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ }
+ } else {
+ __pyx_t_3 = __pyx_t_6(__pyx_t_4);
+ if (unlikely(!__pyx_t_3)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_3);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":555
+ *
+ * for length in self.shape:
+ * result *= length # <<<<<<<<<<<<<<
+ *
+ * self._size = result
+ */
+ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":554
+ * result = 1
+ *
+ * for length in self.shape: # <<<<<<<<<<<<<<
+ * result *= length
+ *
+ */
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "View.MemoryView":557
+ * result *= length
+ *
+ * self._size = result # <<<<<<<<<<<<<<
+ *
+ * return self._size
+ */
+ __Pyx_INCREF(__pyx_v_result);
+ __Pyx_GIVEREF(__pyx_v_result);
+ __Pyx_GOTREF(__pyx_v_self->_size);
+ __Pyx_DECREF(__pyx_v_self->_size);
+ __pyx_v_self->_size = __pyx_v_result;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":559
+ * self._size = result
+ *
+ * return self._size # <<<<<<<<<<<<<<
+ *
+ * def __len__(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->_size);
+ __pyx_r = __pyx_v_self->_size;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":550
+ * property size:
+ * @cname('__pyx_memoryview_get_size')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * if self._size is None:
+ * result = 1
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_length);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":561
+ * return self._size
+ *
+ * def __len__(self): # <<<<<<<<<<<<<<
+ * if self.view.ndim >= 1:
+ * return self.view.shape[0]
+ */
+
+/* Python wrapper */
+static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
+static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("__len__", 0);
+
+ /* "View.MemoryView":562
+ *
+ * def __len__(self):
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
+ * return self.view.shape[0]
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":563
+ * def __len__(self):
+ * if self.view.ndim >= 1:
+ * return self.view.shape[0] # <<<<<<<<<<<<<<
+ *
+ * return 0
+ */
+ __pyx_r = (__pyx_v_self->view.shape[0]);
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":565
+ * return self.view.shape[0]
+ *
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ * def __repr__(self):
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":561
+ * return self._size
+ *
+ * def __len__(self): # <<<<<<<<<<<<<<
+ * if self.view.ndim >= 1:
+ * return self.view.shape[0]
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":567
+ * return 0
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
+ * id(self))
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__repr__", 0);
+
+ /* "View.MemoryView":568
+ *
+ * def __repr__(self):
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
+ * id(self))
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":569
+ * def __repr__(self):
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
+ * id(self)) # <<<<<<<<<<<<<<
+ *
+ * def __str__(self):
+ */
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":568
+ *
+ * def __repr__(self):
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
+ * id(self))
+ *
+ */
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_1 = 0;
+ __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":567
+ * return 0
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
+ * id(self))
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":571
+ * id(self))
+ *
+ * def __str__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__str__", 0);
+
+ /* "View.MemoryView":572
+ *
+ * def __str__(self):
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":571
+ * id(self))
+ *
+ * def __str__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":575
+ *
+ *
+ * def is_c_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice *__pyx_v_mslice;
+ __Pyx_memviewslice __pyx_v_tmp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("is_c_contig", 0);
+
+ /* "View.MemoryView":578
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice, 'C', self.view.ndim)
+ *
+ */
+ __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
+
+ /* "View.MemoryView":579
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp)
+ * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * def is_f_contig(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":575
+ *
+ *
+ * def is_c_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":581
+ * return slice_is_contig(mslice, 'C', self.view.ndim)
+ *
+ * def is_f_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice *__pyx_v_mslice;
+ __Pyx_memviewslice __pyx_v_tmp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("is_f_contig", 0);
+
+ /* "View.MemoryView":584
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice, 'F', self.view.ndim)
+ *
+ */
+ __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
+
+ /* "View.MemoryView":585
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp)
+ * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * def copy(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":581
+ * return slice_is_contig(mslice, 'C', self.view.ndim)
+ *
+ * def is_f_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":587
+ * return slice_is_contig(mslice, 'F', self.view.ndim)
+ *
+ * def copy(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice mslice
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("copy (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice __pyx_v_mslice;
+ int __pyx_v_flags;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_memviewslice __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("copy", 0);
+
+ /* "View.MemoryView":589
+ * def copy(self):
+ * cdef __Pyx_memviewslice mslice
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
+ *
+ * slice_copy(self, &mslice)
+ */
+ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
+
+ /* "View.MemoryView":591
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
+ *
+ * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
+ * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
+ * self.view.itemsize,
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
+
+ /* "View.MemoryView":592
+ *
+ * slice_copy(self, &mslice)
+ * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
+ * self.view.itemsize,
+ * flags|PyBUF_C_CONTIGUOUS,
+ */
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), __pyx_k_c, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_mslice = __pyx_t_1;
+
+ /* "View.MemoryView":597
+ * self.dtype_is_object)
+ *
+ * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
+ *
+ * def copy_fortran(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":587
+ * return slice_is_contig(mslice, 'F', self.view.ndim)
+ *
+ * def copy(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice mslice
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":599
+ * return memoryview_copy_from_slice(self, &mslice)
+ *
+ * def copy_fortran(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice src, dst
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
+ __pyx_r = __pyx_memoryview_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice __pyx_v_src;
+ __Pyx_memviewslice __pyx_v_dst;
+ int __pyx_v_flags;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_memviewslice __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("copy_fortran", 0);
+
+ /* "View.MemoryView":601
+ * def copy_fortran(self):
+ * cdef __Pyx_memviewslice src, dst
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
+ *
+ * slice_copy(self, &src)
+ */
+ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
+
+ /* "View.MemoryView":603
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
+ *
+ * slice_copy(self, &src) # <<<<<<<<<<<<<<
+ * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
+ * self.view.itemsize,
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
+
+ /* "View.MemoryView":604
+ *
+ * slice_copy(self, &src)
+ * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
+ * self.view.itemsize,
+ * flags|PyBUF_F_CONTIGUOUS,
+ */
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), __pyx_k_fortran, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_dst = __pyx_t_1;
+
+ /* "View.MemoryView":609
+ * self.dtype_is_object)
+ *
+ * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":599
+ * return memoryview_copy_from_slice(self, &mslice)
+ *
+ * def copy_fortran(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice src, dst
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":613
+ *
+ * @cname('__pyx_memoryview_new')
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo
+ */
+
+static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
+ struct __pyx_memoryview_obj *__pyx_v_result = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
+
+ /* "View.MemoryView":614
+ * @cname('__pyx_memoryview_new')
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
+ * result.typeinfo = typeinfo
+ * return result
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_o);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
+ __Pyx_GIVEREF(__pyx_v_o);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":615
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
+ * return result
+ *
+ */
+ __pyx_v_result->typeinfo = __pyx_v_typeinfo;
+
+ /* "View.MemoryView":616
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo
+ * return result # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_check')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = ((PyObject *)__pyx_v_result);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":613
+ *
+ * @cname('__pyx_memoryview_new')
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":619
+ *
+ * @cname('__pyx_memoryview_check')
+ * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
+ * return isinstance(o, memoryview)
+ *
+ */
+
+static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("memoryview_check", 0);
+
+ /* "View.MemoryView":620
+ * @cname('__pyx_memoryview_check')
+ * cdef inline bint memoryview_check(object o):
+ * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
+ *
+ * cdef tuple _unellipsify(object index, int ndim):
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, ((PyObject *)__pyx_memoryview_type));
+ __pyx_r = __pyx_t_1;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":619
+ *
+ * @cname('__pyx_memoryview_check')
+ * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
+ * return isinstance(o, memoryview)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":622
+ * return isinstance(o, memoryview)
+ *
+ * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
+ * """
+ * Replace all ellipses with full slices and fill incomplete indices with
+ */
+
+static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
+ PyObject *__pyx_v_tup = NULL;
+ PyObject *__pyx_v_result = NULL;
+ int __pyx_v_have_slices;
+ int __pyx_v_seen_ellipsis;
+ CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
+ PyObject *__pyx_v_item = NULL;
+ Py_ssize_t __pyx_v_nslices;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ Py_ssize_t __pyx_t_5;
+ PyObject *(*__pyx_t_6)(PyObject *);
+ PyObject *__pyx_t_7 = NULL;
+ Py_ssize_t __pyx_t_8;
+ int __pyx_t_9;
+ int __pyx_t_10;
+ PyObject *__pyx_t_11 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_unellipsify", 0);
+
+ /* "View.MemoryView":627
+ * full slices.
+ * """
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
+ * tup = (index,)
+ * else:
+ */
+ __pyx_t_1 = PyTuple_Check(__pyx_v_index);
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":628
+ * """
+ * if not isinstance(index, tuple):
+ * tup = (index,) # <<<<<<<<<<<<<<
+ * else:
+ * tup = index
+ */
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_index);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
+ __Pyx_GIVEREF(__pyx_v_index);
+ __pyx_v_tup = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":630
+ * tup = (index,)
+ * else:
+ * tup = index # <<<<<<<<<<<<<<
+ *
+ * result = []
+ */
+ __Pyx_INCREF(__pyx_v_index);
+ __pyx_v_tup = __pyx_v_index;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":632
+ * tup = index
+ *
+ * result = [] # <<<<<<<<<<<<<<
+ * have_slices = False
+ * seen_ellipsis = False
+ */
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_v_result = ((PyObject*)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":633
+ *
+ * result = []
+ * have_slices = False # <<<<<<<<<<<<<<
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup):
+ */
+ __pyx_v_have_slices = 0;
+
+ /* "View.MemoryView":634
+ * result = []
+ * have_slices = False
+ * seen_ellipsis = False # <<<<<<<<<<<<<<
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis:
+ */
+ __pyx_v_seen_ellipsis = 0;
+
+ /* "View.MemoryView":635
+ * have_slices = False
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ */
+ __Pyx_INCREF(__pyx_int_0);
+ __pyx_t_3 = __pyx_int_0;
+ if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
+ __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
+ __pyx_t_6 = NULL;
+ } else {
+ __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ for (;;) {
+ if (likely(!__pyx_t_6)) {
+ if (likely(PyList_CheckExact(__pyx_t_4))) {
+ if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else {
+ if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ }
+ } else {
+ __pyx_t_7 = __pyx_t_6(__pyx_t_4);
+ if (unlikely(!__pyx_t_7)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_7);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
+ __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3);
+ __pyx_t_3 = __pyx_t_7;
+ __pyx_t_7 = 0;
+
+ /* "View.MemoryView":636
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis: # <<<<<<<<<<<<<<
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ */
+ __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":637
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis:
+ * if not seen_ellipsis: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ * seen_ellipsis = True
+ */
+ __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":638
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
+ * seen_ellipsis = True
+ * else:
+ */
+ __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ { Py_ssize_t __pyx_temp;
+ for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
+ __Pyx_INCREF(__pyx_slice__32);
+ PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__32);
+ __Pyx_GIVEREF(__pyx_slice__32);
+ }
+ }
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "View.MemoryView":639
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ * seen_ellipsis = True # <<<<<<<<<<<<<<
+ * else:
+ * result.append(slice(None))
+ */
+ __pyx_v_seen_ellipsis = 1;
+ goto __pyx_L7;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":641
+ * seen_ellipsis = True
+ * else:
+ * result.append(slice(None)) # <<<<<<<<<<<<<<
+ * have_slices = True
+ * else:
+ */
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__33); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L7:;
+
+ /* "View.MemoryView":642
+ * else:
+ * result.append(slice(None))
+ * have_slices = True # <<<<<<<<<<<<<<
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item):
+ */
+ __pyx_v_have_slices = 1;
+ goto __pyx_L6;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":644
+ * have_slices = True
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ */
+ __pyx_t_2 = PySlice_Check(__pyx_v_item);
+ __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
+ if (__pyx_t_10) {
+ } else {
+ __pyx_t_1 = __pyx_t_10;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
+ __pyx_t_1 = __pyx_t_10;
+ __pyx_L9_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":645
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item):
+ * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
+ *
+ * have_slices = have_slices or isinstance(item, slice)
+ */
+ __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_Raise(__pyx_t_7, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":647
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
+ * result.append(item)
+ *
+ */
+ __pyx_t_10 = (__pyx_v_have_slices != 0);
+ if (!__pyx_t_10) {
+ } else {
+ __pyx_t_1 = __pyx_t_10;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_10 = PySlice_Check(__pyx_v_item);
+ __pyx_t_2 = (__pyx_t_10 != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L11_bool_binop_done:;
+ __pyx_v_have_slices = __pyx_t_1;
+
+ /* "View.MemoryView":648
+ *
+ * have_slices = have_slices or isinstance(item, slice)
+ * result.append(item) # <<<<<<<<<<<<<<
+ *
+ * nslices = ndim - len(result)
+ */
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":635
+ * have_slices = False
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ */
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "View.MemoryView":650
+ * result.append(item)
+ *
+ * nslices = ndim - len(result) # <<<<<<<<<<<<<<
+ * if nslices:
+ * result.extend([slice(None)] * nslices)
+ */
+ __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
+
+ /* "View.MemoryView":651
+ *
+ * nslices = ndim - len(result)
+ * if nslices: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * nslices)
+ *
+ */
+ __pyx_t_1 = (__pyx_v_nslices != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":652
+ * nslices = ndim - len(result)
+ * if nslices:
+ * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
+ *
+ * return have_slices or nslices, tuple(result)
+ */
+ __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ { Py_ssize_t __pyx_temp;
+ for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
+ __Pyx_INCREF(__pyx_slice__34);
+ PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__34);
+ __Pyx_GIVEREF(__pyx_slice__34);
+ }
+ }
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L13;
+ }
+ __pyx_L13:;
+
+ /* "View.MemoryView":654
+ * result.extend([slice(None)] * nslices)
+ *
+ * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
+ *
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ if (!__pyx_v_have_slices) {
+ } else {
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L14_bool_binop_done;
+ }
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __pyx_t_4;
+ __pyx_t_4 = 0;
+ __pyx_L14_bool_binop_done:;
+ __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_3 = 0;
+ __pyx_t_4 = 0;
+ __pyx_r = ((PyObject*)__pyx_t_7);
+ __pyx_t_7 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":622
+ * return isinstance(o, memoryview)
+ *
+ * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
+ * """
+ * Replace all ellipses with full slices and fill incomplete indices with
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_11);
+ __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_tup);
+ __Pyx_XDECREF(__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_idx);
+ __Pyx_XDECREF(__pyx_v_item);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":656
+ * return have_slices or nslices, tuple(result)
+ *
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
+ * cdef int i
+ * for i in range(ndim):
+ */
+
+static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
+ int __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
+
+ /* "View.MemoryView":658
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * cdef int i
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if suboffsets[i] >= 0:
+ * raise ValueError("Indirect dimensions not supported")
+ */
+ __pyx_t_1 = __pyx_v_ndim;
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "View.MemoryView":659
+ * cdef int i
+ * for i in range(ndim):
+ * if suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Indirect dimensions not supported")
+ *
+ */
+ __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0);
+ if (__pyx_t_3) {
+
+ /* "View.MemoryView":660
+ * for i in range(ndim):
+ * if suboffsets[i] >= 0:
+ * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 660; __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[2]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+
+ /* "View.MemoryView":656
+ * return have_slices or nslices, tuple(result)
+ *
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
+ * cdef int i
+ * for i in range(ndim):
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":667
+ *
+ * @cname('__pyx_memview_slice')
+ * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim
+ * cdef bint negative_step
+ */
+
+static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
+ int __pyx_v_new_ndim;
+ int __pyx_v_suboffset_dim;
+ int __pyx_v_dim;
+ __Pyx_memviewslice __pyx_v_src;
+ __Pyx_memviewslice __pyx_v_dst;
+ __Pyx_memviewslice *__pyx_v_p_src;
+ struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
+ __Pyx_memviewslice *__pyx_v_p_dst;
+ int *__pyx_v_p_suboffset_dim;
+ Py_ssize_t __pyx_v_start;
+ Py_ssize_t __pyx_v_stop;
+ Py_ssize_t __pyx_v_step;
+ int __pyx_v_have_start;
+ int __pyx_v_have_stop;
+ int __pyx_v_have_step;
+ PyObject *__pyx_v_index = NULL;
+ struct __pyx_memoryview_obj *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ struct __pyx_memoryview_obj *__pyx_t_4;
+ char *__pyx_t_5;
+ int __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ PyObject *(*__pyx_t_8)(PyObject *);
+ PyObject *__pyx_t_9 = NULL;
+ Py_ssize_t __pyx_t_10;
+ int __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("memview_slice", 0);
+
+ /* "View.MemoryView":668
+ * @cname('__pyx_memview_slice')
+ * cdef memoryview memview_slice(memoryview memview, object indices):
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
+ * cdef bint negative_step
+ * cdef __Pyx_memviewslice src, dst
+ */
+ __pyx_v_new_ndim = 0;
+ __pyx_v_suboffset_dim = -1;
+
+ /* "View.MemoryView":675
+ *
+ *
+ * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
+ *
+ * cdef _memoryviewslice memviewsliceobj
+ */
+ memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));
+
+ /* "View.MemoryView":679
+ * cdef _memoryviewslice memviewsliceobj
+ *
+ * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
+ *
+ * if isinstance(memview, _memoryviewslice):
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
+ PyErr_SetNone(PyExc_AssertionError);
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+
+ /* "View.MemoryView":681
+ * assert memview.view.ndim > 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":682
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * memviewsliceobj = memview # <<<<<<<<<<<<<<
+ * p_src = &memviewsliceobj.from_slice
+ * else:
+ */
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)__pyx_v_memview);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":683
+ * if isinstance(memview, _memoryviewslice):
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
+ * else:
+ * slice_copy(memview, &src)
+ */
+ __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":685
+ * p_src = &memviewsliceobj.from_slice
+ * else:
+ * slice_copy(memview, &src) # <<<<<<<<<<<<<<
+ * p_src = &src
+ *
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
+
+ /* "View.MemoryView":686
+ * else:
+ * slice_copy(memview, &src)
+ * p_src = &src # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_p_src = (&__pyx_v_src);
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":692
+ *
+ *
+ * dst.memview = p_src.memview # <<<<<<<<<<<<<<
+ * dst.data = p_src.data
+ *
+ */
+ __pyx_t_4 = __pyx_v_p_src->memview;
+ __pyx_v_dst.memview = __pyx_t_4;
+
+ /* "View.MemoryView":693
+ *
+ * dst.memview = p_src.memview
+ * dst.data = p_src.data # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __pyx_v_p_src->data;
+ __pyx_v_dst.data = __pyx_t_5;
+
+ /* "View.MemoryView":698
+ *
+ *
+ * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
+ * cdef int *p_suboffset_dim = &suboffset_dim
+ * cdef Py_ssize_t start, stop, step
+ */
+ __pyx_v_p_dst = (&__pyx_v_dst);
+
+ /* "View.MemoryView":699
+ *
+ * cdef __Pyx_memviewslice *p_dst = &dst
+ * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t start, stop, step
+ * cdef bint have_start, have_stop, have_step
+ */
+ __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
+
+ /* "View.MemoryView":703
+ * cdef bint have_start, have_stop, have_step
+ *
+ * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
+ * if PyIndex_Check(index):
+ * slice_memviewslice(
+ */
+ __pyx_t_6 = 0;
+ if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
+ __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
+ __pyx_t_8 = NULL;
+ } else {
+ __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ for (;;) {
+ if (likely(!__pyx_t_8)) {
+ if (likely(PyList_CheckExact(__pyx_t_3))) {
+ if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else {
+ if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ }
+ } else {
+ __pyx_t_9 = __pyx_t_8(__pyx_t_3);
+ if (unlikely(!__pyx_t_9)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_9);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_v_dim = __pyx_t_6;
+ __pyx_t_6 = (__pyx_t_6 + 1);
+
+ /* "View.MemoryView":704
+ *
+ * for dim, index in enumerate(indices):
+ * if PyIndex_Check(index): # <<<<<<<<<<<<<<
+ * slice_memviewslice(
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ */
+ __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":708
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ * dim, new_ndim, p_suboffset_dim,
+ * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ */
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":705
+ * for dim, index in enumerate(indices):
+ * if PyIndex_Check(index):
+ * slice_memviewslice( # <<<<<<<<<<<<<<
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ * dim, new_ndim, p_suboffset_dim,
+ */
+ __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L6;
+ }
+
+ /* "View.MemoryView":711
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ * elif index is None: # <<<<<<<<<<<<<<
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ */
+ __pyx_t_2 = (__pyx_v_index == Py_None);
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":712
+ * False)
+ * elif index is None:
+ * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
+ * p_dst.strides[new_ndim] = 0
+ * p_dst.suboffsets[new_ndim] = -1
+ */
+ (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
+
+ /* "View.MemoryView":713
+ * elif index is None:
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
+ * p_dst.suboffsets[new_ndim] = -1
+ * new_ndim += 1
+ */
+ (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
+
+ /* "View.MemoryView":714
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
+ * new_ndim += 1
+ * else:
+ */
+ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1;
+
+ /* "View.MemoryView":715
+ * p_dst.strides[new_ndim] = 0
+ * p_dst.suboffsets[new_ndim] = -1
+ * new_ndim += 1 # <<<<<<<<<<<<<<
+ * else:
+ * start = index.start or 0
+ */
+ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+ goto __pyx_L6;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":717
+ * new_ndim += 1
+ * else:
+ * start = index.start or 0 # <<<<<<<<<<<<<<
+ * stop = index.stop or 0
+ * step = index.step or 0
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_1) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else {
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __pyx_t_12;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_t_10 = 0;
+ __pyx_L7_bool_binop_done:;
+ __pyx_v_start = __pyx_t_10;
+
+ /* "View.MemoryView":718
+ * else:
+ * start = index.start or 0
+ * stop = index.stop or 0 # <<<<<<<<<<<<<<
+ * step = index.step or 0
+ *
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_1) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else {
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __pyx_t_12;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_10 = 0;
+ __pyx_L9_bool_binop_done:;
+ __pyx_v_stop = __pyx_t_10;
+
+ /* "View.MemoryView":719
+ * start = index.start or 0
+ * stop = index.stop or 0
+ * step = index.step or 0 # <<<<<<<<<<<<<<
+ *
+ * have_start = index.start is not None
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_1) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else {
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __pyx_t_12;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_10 = 0;
+ __pyx_L11_bool_binop_done:;
+ __pyx_v_step = __pyx_t_10;
+
+ /* "View.MemoryView":721
+ * step = index.step or 0
+ *
+ * have_start = index.start is not None # <<<<<<<<<<<<<<
+ * have_stop = index.stop is not None
+ * have_step = index.step is not None
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_have_start = __pyx_t_1;
+
+ /* "View.MemoryView":722
+ *
+ * have_start = index.start is not None
+ * have_stop = index.stop is not None # <<<<<<<<<<<<<<
+ * have_step = index.step is not None
+ *
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_have_stop = __pyx_t_1;
+
+ /* "View.MemoryView":723
+ * have_start = index.start is not None
+ * have_stop = index.stop is not None
+ * have_step = index.step is not None # <<<<<<<<<<<<<<
+ *
+ * slice_memviewslice(
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_have_step = __pyx_t_1;
+
+ /* "View.MemoryView":725
+ * have_step = index.step is not None
+ *
+ * slice_memviewslice( # <<<<<<<<<<<<<<
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ * dim, new_ndim, p_suboffset_dim,
+ */
+ __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":731
+ * have_start, have_stop, have_step,
+ * True)
+ * new_ndim += 1 # <<<<<<<<<<<<<<
+ *
+ * if isinstance(memview, _memoryviewslice):
+ */
+ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":703
+ * cdef bint have_start, have_stop, have_step
+ *
+ * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
+ * if PyIndex_Check(index):
+ * slice_memviewslice(
+ */
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "View.MemoryView":733
+ * new_ndim += 1
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":734
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
+ * memviewsliceobj.to_object_func,
+ * memviewsliceobj.to_dtype_func,
+ */
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+
+ /* "View.MemoryView":735
+ * if isinstance(memview, _memoryviewslice):
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
+ * memviewsliceobj.to_dtype_func,
+ * memview.dtype_is_object)
+ */
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+
+ /* "View.MemoryView":736
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
+ * memview.dtype_is_object)
+ * else:
+ */
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+
+ /* "View.MemoryView":734
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
+ * memviewsliceobj.to_object_func,
+ * memviewsliceobj.to_dtype_func,
+ */
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":739
+ * memview.dtype_is_object)
+ * else:
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
+ * memview.dtype_is_object)
+ *
+ */
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+
+ /* "View.MemoryView":740
+ * else:
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
+ * memview.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+
+ /* "View.MemoryView":739
+ * memview.dtype_is_object)
+ * else:
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
+ * memview.dtype_is_object)
+ *
+ */
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":667
+ *
+ * @cname('__pyx_memview_slice')
+ * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim
+ * cdef bint negative_step
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
+ __Pyx_XDECREF(__pyx_v_index);
+ __Pyx_XGIVEREF((PyObject *)__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":764
+ *
+ * @cname('__pyx_memoryview_slice_memviewslice')
+ * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
+ */
+
+static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
+ Py_ssize_t __pyx_v_new_shape;
+ int __pyx_v_negative_step;
+ int __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+
+ /* "View.MemoryView":784
+ * cdef bint negative_step
+ *
+ * if not is_slice: # <<<<<<<<<<<<<<
+ *
+ * if start < 0:
+ */
+ __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":786
+ * if not is_slice:
+ *
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if not 0 <= start < shape:
+ */
+ __pyx_t_1 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":787
+ *
+ * if start < 0:
+ * start += shape # <<<<<<<<<<<<<<
+ * if not 0 <= start < shape:
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ */
+ __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":788
+ * if start < 0:
+ * start += shape
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ * else:
+ */
+ __pyx_t_1 = (0 <= __pyx_v_start);
+ if (__pyx_t_1) {
+ __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
+ }
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":789
+ * start += shape
+ * if not 0 <= start < shape:
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
+ * else:
+ *
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":792
+ * else:
+ *
+ * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
+ *
+ * if have_step and step == 0:
+ */
+ __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L6_bool_binop_done;
+ }
+ __pyx_t_1 = ((__pyx_v_step < 0) != 0);
+ __pyx_t_2 = __pyx_t_1;
+ __pyx_L6_bool_binop_done:;
+ __pyx_v_negative_step = __pyx_t_2;
+
+ /* "View.MemoryView":794
+ * negative_step = have_step != 0 and step < 0
+ *
+ * if have_step and step == 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
+ *
+ */
+ __pyx_t_1 = (__pyx_v_have_step != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_1 = ((__pyx_v_step == 0) != 0);
+ __pyx_t_2 = __pyx_t_1;
+ __pyx_L9_bool_binop_done:;
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":795
+ *
+ * if have_step and step == 0:
+ * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+
+ /* "View.MemoryView":798
+ *
+ *
+ * if have_start: # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start += shape
+ */
+ __pyx_t_2 = (__pyx_v_have_start != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":799
+ *
+ * if have_start:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if start < 0:
+ */
+ __pyx_t_2 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":800
+ * if have_start:
+ * if start < 0:
+ * start += shape # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start = 0
+ */
+ __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
+
+ /* "View.MemoryView":801
+ * if start < 0:
+ * start += shape
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = 0
+ * elif start >= shape:
+ */
+ __pyx_t_2 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":802
+ * start += shape
+ * if start < 0:
+ * start = 0 # <<<<<<<<<<<<<<
+ * elif start >= shape:
+ * if negative_step:
+ */
+ __pyx_v_start = 0;
+ goto __pyx_L13;
+ }
+ __pyx_L13:;
+ goto __pyx_L12;
+ }
+
+ /* "View.MemoryView":803
+ * if start < 0:
+ * start = 0
+ * elif start >= shape: # <<<<<<<<<<<<<<
+ * if negative_step:
+ * start = shape - 1
+ */
+ __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":804
+ * start = 0
+ * elif start >= shape:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":805
+ * elif start >= shape:
+ * if negative_step:
+ * start = shape - 1 # <<<<<<<<<<<<<<
+ * else:
+ * start = shape
+ */
+ __pyx_v_start = (__pyx_v_shape - 1);
+ goto __pyx_L14;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":807
+ * start = shape - 1
+ * else:
+ * start = shape # <<<<<<<<<<<<<<
+ * else:
+ * if negative_step:
+ */
+ __pyx_v_start = __pyx_v_shape;
+ }
+ __pyx_L14:;
+ goto __pyx_L12;
+ }
+ __pyx_L12:;
+ goto __pyx_L11;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":809
+ * start = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":810
+ * else:
+ * if negative_step:
+ * start = shape - 1 # <<<<<<<<<<<<<<
+ * else:
+ * start = 0
+ */
+ __pyx_v_start = (__pyx_v_shape - 1);
+ goto __pyx_L15;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":812
+ * start = shape - 1
+ * else:
+ * start = 0 # <<<<<<<<<<<<<<
+ *
+ * if have_stop:
+ */
+ __pyx_v_start = 0;
+ }
+ __pyx_L15:;
+ }
+ __pyx_L11:;
+
+ /* "View.MemoryView":814
+ * start = 0
+ *
+ * if have_stop: # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop += shape
+ */
+ __pyx_t_2 = (__pyx_v_have_stop != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":815
+ *
+ * if have_stop:
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop += shape
+ * if stop < 0:
+ */
+ __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":816
+ * if have_stop:
+ * if stop < 0:
+ * stop += shape # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop = 0
+ */
+ __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
+
+ /* "View.MemoryView":817
+ * if stop < 0:
+ * stop += shape
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop = 0
+ * elif stop > shape:
+ */
+ __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":818
+ * stop += shape
+ * if stop < 0:
+ * stop = 0 # <<<<<<<<<<<<<<
+ * elif stop > shape:
+ * stop = shape
+ */
+ __pyx_v_stop = 0;
+ goto __pyx_L18;
+ }
+ __pyx_L18:;
+ goto __pyx_L17;
+ }
+
+ /* "View.MemoryView":819
+ * if stop < 0:
+ * stop = 0
+ * elif stop > shape: # <<<<<<<<<<<<<<
+ * stop = shape
+ * else:
+ */
+ __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":820
+ * stop = 0
+ * elif stop > shape:
+ * stop = shape # <<<<<<<<<<<<<<
+ * else:
+ * if negative_step:
+ */
+ __pyx_v_stop = __pyx_v_shape;
+ goto __pyx_L17;
+ }
+ __pyx_L17:;
+ goto __pyx_L16;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":822
+ * stop = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * stop = -1
+ * else:
+ */
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":823
+ * else:
+ * if negative_step:
+ * stop = -1 # <<<<<<<<<<<<<<
+ * else:
+ * stop = shape
+ */
+ __pyx_v_stop = -1;
+ goto __pyx_L19;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":825
+ * stop = -1
+ * else:
+ * stop = shape # <<<<<<<<<<<<<<
+ *
+ * if not have_step:
+ */
+ __pyx_v_stop = __pyx_v_shape;
+ }
+ __pyx_L19:;
+ }
+ __pyx_L16:;
+
+ /* "View.MemoryView":827
+ * stop = shape
+ *
+ * if not have_step: # <<<<<<<<<<<<<<
+ * step = 1
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":828
+ *
+ * if not have_step:
+ * step = 1 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_step = 1;
+ goto __pyx_L20;
+ }
+ __pyx_L20:;
+
+ /* "View.MemoryView":832
+ *
+ * with cython.cdivision(True):
+ * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
+ *
+ * if (stop - start) - step * new_shape:
+ */
+ __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
+
+ /* "View.MemoryView":834
+ * new_shape = (stop - start) // step
+ *
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
+ * new_shape += 1
+ *
+ */
+ __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":835
+ *
+ * if (stop - start) - step * new_shape:
+ * new_shape += 1 # <<<<<<<<<<<<<<
+ *
+ * if new_shape < 0:
+ */
+ __pyx_v_new_shape = (__pyx_v_new_shape + 1);
+ goto __pyx_L21;
+ }
+ __pyx_L21:;
+
+ /* "View.MemoryView":837
+ * new_shape += 1
+ *
+ * if new_shape < 0: # <<<<<<<<<<<<<<
+ * new_shape = 0
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":838
+ *
+ * if new_shape < 0:
+ * new_shape = 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_new_shape = 0;
+ goto __pyx_L22;
+ }
+ __pyx_L22:;
+
+ /* "View.MemoryView":841
+ *
+ *
+ * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
+ * dst.shape[new_ndim] = new_shape
+ * dst.suboffsets[new_ndim] = suboffset
+ */
+ (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
+
+ /* "View.MemoryView":842
+ *
+ * dst.strides[new_ndim] = stride * step
+ * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
+ * dst.suboffsets[new_ndim] = suboffset
+ *
+ */
+ (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
+
+ /* "View.MemoryView":843
+ * dst.strides[new_ndim] = stride * step
+ * dst.shape[new_ndim] = new_shape
+ * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":846
+ *
+ *
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
+ * dst.data += start * stride
+ * else:
+ */
+ __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":847
+ *
+ * if suboffset_dim[0] < 0:
+ * dst.data += start * stride # <<<<<<<<<<<<<<
+ * else:
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ */
+ __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
+ goto __pyx_L23;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":849
+ * dst.data += start * stride
+ * else:
+ * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
+ *
+ * if suboffset >= 0:
+ */
+ __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
+ (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
+ }
+ __pyx_L23:;
+
+ /* "View.MemoryView":851
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ *
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * if not is_slice:
+ * if new_ndim == 0:
+ */
+ __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":852
+ *
+ * if suboffset >= 0:
+ * if not is_slice: # <<<<<<<<<<<<<<
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ */
+ __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":853
+ * if suboffset >= 0:
+ * if not is_slice:
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ */
+ __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":854
+ * if not is_slice:
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
+ */
+ __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
+ goto __pyx_L26;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":856
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
+ * "must be indexed and not sliced", dim)
+ * else:
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L26:;
+ goto __pyx_L25;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":859
+ * "must be indexed and not sliced", dim)
+ * else:
+ * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
+ *
+ * return 0
+ */
+ (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
+ }
+ __pyx_L25:;
+ goto __pyx_L24;
+ }
+ __pyx_L24:;
+
+ /* "View.MemoryView":861
+ * suboffset_dim[0] = new_ndim
+ *
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":764
+ *
+ * @cname('__pyx_memoryview_slice_memviewslice')
+ * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = -1;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":867
+ *
+ * @cname('__pyx_pybuffer_index')
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1
+ */
+
+static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
+ Py_ssize_t __pyx_v_shape;
+ Py_ssize_t __pyx_v_stride;
+ Py_ssize_t __pyx_v_suboffset;
+ Py_ssize_t __pyx_v_itemsize;
+ char *__pyx_v_resultp;
+ char *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("pybuffer_index", 0);
+
+ /* "View.MemoryView":869
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t itemsize = view.itemsize
+ * cdef char *resultp
+ */
+ __pyx_v_suboffset = -1;
+
+ /* "View.MemoryView":870
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1
+ * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
+ * cdef char *resultp
+ *
+ */
+ __pyx_t_1 = __pyx_v_view->itemsize;
+ __pyx_v_itemsize = __pyx_t_1;
+
+ /* "View.MemoryView":873
+ * cdef char *resultp
+ *
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
+ * shape = view.len / itemsize
+ * stride = itemsize
+ */
+ __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":874
+ *
+ * if view.ndim == 0:
+ * shape = view.len / itemsize # <<<<<<<<<<<<<<
+ * stride = itemsize
+ * else:
+ */
+ if (unlikely(__pyx_v_itemsize == 0)) {
+ #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[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
+
+ /* "View.MemoryView":875
+ * if view.ndim == 0:
+ * shape = view.len / itemsize
+ * stride = itemsize # <<<<<<<<<<<<<<
+ * else:
+ * shape = view.shape[dim]
+ */
+ __pyx_v_stride = __pyx_v_itemsize;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":877
+ * stride = itemsize
+ * else:
+ * shape = view.shape[dim] # <<<<<<<<<<<<<<
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL:
+ */
+ __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
+
+ /* "View.MemoryView":878
+ * else:
+ * shape = view.shape[dim]
+ * stride = view.strides[dim] # <<<<<<<<<<<<<<
+ * if view.suboffsets != NULL:
+ * suboffset = view.suboffsets[dim]
+ */
+ __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
+
+ /* "View.MemoryView":879
+ * shape = view.shape[dim]
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * suboffset = view.suboffsets[dim]
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":880
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL:
+ * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
+ *
+ * if index < 0:
+ */
+ __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":882
+ * suboffset = view.suboffsets[dim]
+ *
+ * if index < 0: # <<<<<<<<<<<<<<
+ * index += view.shape[dim]
+ * if index < 0:
+ */
+ __pyx_t_2 = ((__pyx_v_index < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":883
+ *
+ * if index < 0:
+ * index += view.shape[dim] # <<<<<<<<<<<<<<
+ * if index < 0:
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ */
+ __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
+
+ /* "View.MemoryView":884
+ * if index < 0:
+ * index += view.shape[dim]
+ * if index < 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_index < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":885
+ * index += view.shape[dim]
+ * if index < 0:
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
+ *
+ * if index >= shape:
+ */
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":887
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ * if index >= shape: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":888
+ *
+ * if index >= shape:
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
+ *
+ * resultp = bufp + index * stride
+ */
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 888; __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_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 888; __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[2]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":890
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ * resultp = bufp + index * stride # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * resultp = (<char **> resultp)[0] + suboffset
+ */
+ __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
+
+ /* "View.MemoryView":891
+ *
+ * resultp = bufp + index * stride
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":892
+ * resultp = bufp + index * stride
+ * if suboffset >= 0:
+ * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
+ *
+ * return resultp
+ */
+ __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+
+ /* "View.MemoryView":894
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ * return resultp # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_resultp;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":867
+ *
+ * @cname('__pyx_pybuffer_index')
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":900
+ *
+ * @cname('__pyx_memslice_transpose')
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
+ * cdef int ndim = memslice.memview.view.ndim
+ *
+ */
+
+static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
+ int __pyx_v_ndim;
+ Py_ssize_t *__pyx_v_shape;
+ Py_ssize_t *__pyx_v_strides;
+ int __pyx_v_i;
+ int __pyx_v_j;
+ int __pyx_r;
+ int __pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ long __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ int __pyx_t_8;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+
+ /* "View.MemoryView":901
+ * @cname('__pyx_memslice_transpose')
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
+ * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
+ *
+ * cdef Py_ssize_t *shape = memslice.shape
+ */
+ __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
+ __pyx_v_ndim = __pyx_t_1;
+
+ /* "View.MemoryView":903
+ * cdef int ndim = memslice.memview.view.ndim
+ *
+ * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t *strides = memslice.strides
+ *
+ */
+ __pyx_t_2 = __pyx_v_memslice->shape;
+ __pyx_v_shape = __pyx_t_2;
+
+ /* "View.MemoryView":904
+ *
+ * cdef Py_ssize_t *shape = memslice.shape
+ * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = __pyx_v_memslice->strides;
+ __pyx_v_strides = __pyx_t_2;
+
+ /* "View.MemoryView":908
+ *
+ * cdef int i, j
+ * for i in range(ndim / 2): # <<<<<<<<<<<<<<
+ * j = ndim - 1 - i
+ * strides[i], strides[j] = strides[j], strides[i]
+ */
+ __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
+ for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
+ __pyx_v_i = __pyx_t_1;
+
+ /* "View.MemoryView":909
+ * cdef int i, j
+ * for i in range(ndim / 2):
+ * j = ndim - 1 - i # <<<<<<<<<<<<<<
+ * strides[i], strides[j] = strides[j], strides[i]
+ * shape[i], shape[j] = shape[j], shape[i]
+ */
+ __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
+
+ /* "View.MemoryView":910
+ * for i in range(ndim / 2):
+ * j = ndim - 1 - i
+ * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
+ * shape[i], shape[j] = shape[j], shape[i]
+ *
+ */
+ __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]);
+ __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]);
+ (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
+ (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;
+
+ /* "View.MemoryView":911
+ * j = ndim - 1 - i
+ * strides[i], strides[j] = strides[j], strides[i]
+ * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
+ *
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
+ */
+ __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]);
+ __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]);
+ (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
+ (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;
+
+ /* "View.MemoryView":913
+ * shape[i], shape[j] = shape[j], shape[i]
+ *
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
+ *
+ */
+ __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
+ if (!__pyx_t_7) {
+ } else {
+ __pyx_t_6 = __pyx_t_7;
+ goto __pyx_L6_bool_binop_done;
+ }
+ __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
+ __pyx_t_6 = __pyx_t_7;
+ __pyx_L6_bool_binop_done:;
+ if (__pyx_t_6) {
+
+ /* "View.MemoryView":914
+ *
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
+ *
+ * return 1
+ */
+ __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, __pyx_k_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+
+ /* "View.MemoryView":916
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
+ *
+ * return 1 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = 1;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":900
+ *
+ * @cname('__pyx_memslice_transpose')
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
+ * cdef int ndim = memslice.memview.view.ndim
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = 0;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":933
+ * cdef int (*to_dtype_func)(char *, object) except 0
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ */
+
+/* Python wrapper */
+static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "View.MemoryView":934
+ *
+ * def __dealloc__(self):
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ */
+ __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
+
+ /* "View.MemoryView":933
+ * cdef int (*to_dtype_func)(char *, object) except 0
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":936
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * if self.to_object_func != NULL:
+ * return self.to_object_func(itemp)
+ */
+
+static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("convert_item_to_object", 0);
+
+ /* "View.MemoryView":937
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
+ * return self.to_object_func(itemp)
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":938
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL:
+ * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
+ * else:
+ * return memoryview.convert_item_to_object(self, itemp)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":940
+ * return self.to_object_func(itemp)
+ * else:
+ * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":936
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * if self.to_object_func != NULL:
+ * return self.to_object_func(itemp)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":942
+ * return memoryview.convert_item_to_object(self, itemp)
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * if self.to_dtype_func != NULL:
+ * self.to_dtype_func(itemp, value)
+ */
+
+static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("assign_item_from_object", 0);
+
+ /* "View.MemoryView":943
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
+ * self.to_dtype_func(itemp, value)
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":944
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL:
+ * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
+ * else:
+ * memoryview.assign_item_from_object(self, itemp, value)
+ */
+ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":946
+ * self.to_dtype_func(itemp, value)
+ * else:
+ * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
+ *
+ * property base:
+ */
+ __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":942
+ * return memoryview.convert_item_to_object(self, itemp)
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * if self.to_dtype_func != NULL:
+ * self.to_dtype_func(itemp, value)
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":950
+ * property base:
+ * @cname('__pyx_memoryviewslice__get__base')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.from_object
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":951
+ * @cname('__pyx_memoryviewslice__get__base')
+ * def __get__(self):
+ * return self.from_object # <<<<<<<<<<<<<<
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->from_object);
+ __pyx_r = __pyx_v_self->from_object;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":950
+ * property base:
+ * @cname('__pyx_memoryviewslice__get__base')
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * return self.from_object
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":957
+ *
+ * @cname('__pyx_memoryview_fromslice')
+ * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * object (*to_object_func)(char *),
+ */
+
+static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
+ struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
+ int __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_TypeInfo *__pyx_t_4;
+ Py_buffer __pyx_t_5;
+ Py_ssize_t __pyx_t_6;
+ int __pyx_t_7;
+ int __pyx_t_8;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
+
+ /* "View.MemoryView":966
+ * cdef int i
+ *
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
+ __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":967
+ *
+ * if <PyObject *> memviewslice.memview == Py_None:
+ * return None # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(Py_None);
+ __pyx_r = Py_None;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":972
+ *
+ *
+ * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ * result.from_slice = memviewslice
+ */
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_INCREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
+ __Pyx_GIVEREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryviewslice_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":974
+ * result = _memoryviewslice(None, 0, dtype_is_object)
+ *
+ * result.from_slice = memviewslice # <<<<<<<<<<<<<<
+ * __PYX_INC_MEMVIEW(&memviewslice, 1)
+ *
+ */
+ __pyx_v_result->from_slice = __pyx_v_memviewslice;
+
+ /* "View.MemoryView":975
+ *
+ * result.from_slice = memviewslice
+ * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
+ *
+ * result.from_object = (<memoryview> memviewslice.memview).base
+ */
+ __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
+
+ /* "View.MemoryView":977
+ * __PYX_INC_MEMVIEW(&memviewslice, 1)
+ *
+ * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
+ * result.typeinfo = memviewslice.memview.typeinfo
+ *
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_v_result->from_object);
+ __Pyx_DECREF(__pyx_v_result->from_object);
+ __pyx_v_result->from_object = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":978
+ *
+ * result.from_object = (<memoryview> memviewslice.memview).base
+ * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
+ *
+ * result.view = memviewslice.memview.view
+ */
+ __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
+ __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
+
+ /* "View.MemoryView":980
+ * result.typeinfo = memviewslice.memview.typeinfo
+ *
+ * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
+ * result.view.buf = <void *> memviewslice.data
+ * result.view.ndim = ndim
+ */
+ __pyx_t_5 = __pyx_v_memviewslice.memview->view;
+ __pyx_v_result->__pyx_base.view = __pyx_t_5;
+
+ /* "View.MemoryView":981
+ *
+ * result.view = memviewslice.memview.view
+ * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
+ * result.view.ndim = ndim
+ * (<__pyx_buffer *> &result.view).obj = Py_None
+ */
+ __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
+
+ /* "View.MemoryView":982
+ * result.view = memviewslice.memview.view
+ * result.view.buf = <void *> memviewslice.data
+ * result.view.ndim = ndim # <<<<<<<<<<<<<<
+ * (<__pyx_buffer *> &result.view).obj = Py_None
+ * Py_INCREF(Py_None)
+ */
+ __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
+
+ /* "View.MemoryView":983
+ * result.view.buf = <void *> memviewslice.data
+ * result.view.ndim = ndim
+ * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
+ * Py_INCREF(Py_None)
+ *
+ */
+ ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
+
+ /* "View.MemoryView":984
+ * result.view.ndim = ndim
+ * (<__pyx_buffer *> &result.view).obj = Py_None
+ * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
+ *
+ * result.flags = PyBUF_RECORDS
+ */
+ Py_INCREF(Py_None);
+
+ /* "View.MemoryView":986
+ * Py_INCREF(Py_None)
+ *
+ * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
+ *
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape
+ */
+ __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
+
+ /* "View.MemoryView":988
+ * result.flags = PyBUF_RECORDS
+ *
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
+ * result.view.strides = <Py_ssize_t *> result.from_slice.strides
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ */
+ __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
+
+ /* "View.MemoryView":989
+ *
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape
+ * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ *
+ */
+ __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
+
+ /* "View.MemoryView":990
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape
+ * result.view.strides = <Py_ssize_t *> result.from_slice.strides
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
+ *
+ * result.view.len = result.view.itemsize
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+
+ /* "View.MemoryView":992
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ *
+ * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
+ * for i in range(ndim):
+ * result.view.len *= result.view.shape[i]
+ */
+ __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_6;
+
+ /* "View.MemoryView":993
+ *
+ * result.view.len = result.view.itemsize
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * result.view.len *= result.view.shape[i]
+ *
+ */
+ __pyx_t_7 = __pyx_v_ndim;
+ for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
+ __pyx_v_i = __pyx_t_8;
+
+ /* "View.MemoryView":994
+ * result.view.len = result.view.itemsize
+ * for i in range(ndim):
+ * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<<
+ *
+ * result.to_object_func = to_object_func
+ */
+ __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * (__pyx_v_result->__pyx_base.view.shape[__pyx_v_i]));
+ }
+
+ /* "View.MemoryView":996
+ * result.view.len *= result.view.shape[i]
+ *
+ * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
+ * result.to_dtype_func = to_dtype_func
+ *
+ */
+ __pyx_v_result->to_object_func = __pyx_v_to_object_func;
+
+ /* "View.MemoryView":997
+ *
+ * result.to_object_func = to_object_func
+ * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
+ *
+ * return result
+ */
+ __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
+
+ /* "View.MemoryView":999
+ * result.to_dtype_func = to_dtype_func
+ *
+ * return result # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_get_slice_from_memoryview')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = ((PyObject *)__pyx_v_result);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":957
+ *
+ * @cname('__pyx_memoryview_fromslice')
+ * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * object (*to_object_func)(char *),
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1002
+ *
+ * @cname('__pyx_memoryview_get_slice_from_memoryview')
+ * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ */
+
+static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
+ struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
+ __Pyx_memviewslice *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
+
+ /* "View.MemoryView":1005
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * obj = memview
+ * return &obj.from_slice
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1006
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice):
+ * obj = memview # <<<<<<<<<<<<<<
+ * return &obj.from_slice
+ * else:
+ */
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)__pyx_v_memview);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":1007
+ * if isinstance(memview, _memoryviewslice):
+ * obj = memview
+ * return &obj.from_slice # <<<<<<<<<<<<<<
+ * else:
+ * slice_copy(memview, mslice)
+ */
+ __pyx_r = (&__pyx_v_obj->from_slice);
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1009
+ * return &obj.from_slice
+ * else:
+ * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
+ * return mslice
+ *
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
+
+ /* "View.MemoryView":1010
+ * else:
+ * slice_copy(memview, mslice)
+ * return mslice # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_slice_copy')
+ */
+ __pyx_r = __pyx_v_mslice;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":1002
+ *
+ * @cname('__pyx_memoryview_get_slice_from_memoryview')
+ * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_obj);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1013
+ *
+ * @cname('__pyx_memoryview_slice_copy')
+ * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
+ * cdef int dim
+ * cdef (Py_ssize_t*) shape, strides, suboffsets
+ */
+
+static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
+ int __pyx_v_dim;
+ Py_ssize_t *__pyx_v_shape;
+ Py_ssize_t *__pyx_v_strides;
+ Py_ssize_t *__pyx_v_suboffsets;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t *__pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ __Pyx_RefNannySetupContext("slice_copy", 0);
+
+ /* "View.MemoryView":1017
+ * cdef (Py_ssize_t*) shape, strides, suboffsets
+ *
+ * shape = memview.view.shape # <<<<<<<<<<<<<<
+ * strides = memview.view.strides
+ * suboffsets = memview.view.suboffsets
+ */
+ __pyx_t_1 = __pyx_v_memview->view.shape;
+ __pyx_v_shape = __pyx_t_1;
+
+ /* "View.MemoryView":1018
+ *
+ * shape = memview.view.shape
+ * strides = memview.view.strides # <<<<<<<<<<<<<<
+ * suboffsets = memview.view.suboffsets
+ *
+ */
+ __pyx_t_1 = __pyx_v_memview->view.strides;
+ __pyx_v_strides = __pyx_t_1;
+
+ /* "View.MemoryView":1019
+ * shape = memview.view.shape
+ * strides = memview.view.strides
+ * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
+ *
+ * dst.memview = <__pyx_memoryview *> memview
+ */
+ __pyx_t_1 = __pyx_v_memview->view.suboffsets;
+ __pyx_v_suboffsets = __pyx_t_1;
+
+ /* "View.MemoryView":1021
+ * suboffsets = memview.view.suboffsets
+ *
+ * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
+ * dst.data = <char *> memview.view.buf
+ *
+ */
+ __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
+
+ /* "View.MemoryView":1022
+ *
+ * dst.memview = <__pyx_memoryview *> memview
+ * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
+ *
+ * for dim in range(memview.view.ndim):
+ */
+ __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
+
+ /* "View.MemoryView":1024
+ * dst.data = <char *> memview.view.buf
+ *
+ * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
+ * dst.shape[dim] = shape[dim]
+ * dst.strides[dim] = strides[dim]
+ */
+ __pyx_t_2 = __pyx_v_memview->view.ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_dim = __pyx_t_3;
+
+ /* "View.MemoryView":1025
+ *
+ * for dim in range(memview.view.ndim):
+ * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
+ * dst.strides[dim] = strides[dim]
+ * if suboffsets == NULL:
+ */
+ (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
+
+ /* "View.MemoryView":1026
+ * for dim in range(memview.view.ndim):
+ * dst.shape[dim] = shape[dim]
+ * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
+ * if suboffsets == NULL:
+ * dst.suboffsets[dim] = -1
+ */
+ (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
+
+ /* "View.MemoryView":1027
+ * dst.shape[dim] = shape[dim]
+ * dst.strides[dim] = strides[dim]
+ * if suboffsets == NULL: # <<<<<<<<<<<<<<
+ * dst.suboffsets[dim] = -1
+ * else:
+ */
+ __pyx_t_4 = ((__pyx_v_suboffsets == NULL) != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":1028
+ * dst.strides[dim] = strides[dim]
+ * if suboffsets == NULL:
+ * dst.suboffsets[dim] = -1 # <<<<<<<<<<<<<<
+ * else:
+ * dst.suboffsets[dim] = suboffsets[dim]
+ */
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = -1;
+ goto __pyx_L5;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1030
+ * dst.suboffsets[dim] = -1
+ * else:
+ * dst.suboffsets[dim] = suboffsets[dim] # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_object')
+ */
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]);
+ }
+ __pyx_L5:;
+ }
+
+ /* "View.MemoryView":1013
+ *
+ * @cname('__pyx_memoryview_slice_copy')
+ * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
+ * cdef int dim
+ * cdef (Py_ssize_t*) shape, strides, suboffsets
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":1033
+ *
+ * @cname('__pyx_memoryview_copy_object')
+ * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
+ * "Create a new memoryview object"
+ * cdef __Pyx_memviewslice memviewslice
+ */
+
+static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
+ __Pyx_memviewslice __pyx_v_memviewslice;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("memoryview_copy", 0);
+
+ /* "View.MemoryView":1036
+ * "Create a new memoryview object"
+ * cdef __Pyx_memviewslice memviewslice
+ * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
+ * return memoryview_copy_from_slice(memview, &memviewslice)
+ *
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
+
+ /* "View.MemoryView":1037
+ * cdef __Pyx_memviewslice memviewslice
+ * slice_copy(memview, &memviewslice)
+ * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_object_from_slice')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1033
+ *
+ * @cname('__pyx_memoryview_copy_object')
+ * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
+ * "Create a new memoryview object"
+ * cdef __Pyx_memviewslice memviewslice
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1040
+ *
+ * @cname('__pyx_memoryview_copy_object_from_slice')
+ * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
+ * """
+ * Create a new memoryview object from a given memoryview object and slice.
+ */
+
+static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
+ PyObject *(*__pyx_v_to_object_func)(char *);
+ int (*__pyx_v_to_dtype_func)(char *, PyObject *);
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *(*__pyx_t_3)(char *);
+ int (*__pyx_t_4)(char *, PyObject *);
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
+
+ /* "View.MemoryView":1047
+ * cdef int (*to_dtype_func)(char *, object) except 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * to_object_func = (<_memoryviewslice> memview).to_object_func
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1048
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
+ * else:
+ */
+ __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
+ __pyx_v_to_object_func = __pyx_t_3;
+
+ /* "View.MemoryView":1049
+ * if isinstance(memview, _memoryviewslice):
+ * to_object_func = (<_memoryviewslice> memview).to_object_func
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
+ * else:
+ * to_object_func = NULL
+ */
+ __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
+ __pyx_v_to_dtype_func = __pyx_t_4;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1051
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
+ * else:
+ * to_object_func = NULL # <<<<<<<<<<<<<<
+ * to_dtype_func = NULL
+ *
+ */
+ __pyx_v_to_object_func = NULL;
+
+ /* "View.MemoryView":1052
+ * else:
+ * to_object_func = NULL
+ * to_dtype_func = NULL # <<<<<<<<<<<<<<
+ *
+ * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
+ */
+ __pyx_v_to_dtype_func = NULL;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1054
+ * to_dtype_func = NULL
+ *
+ * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
+ * to_object_func, to_dtype_func,
+ * memview.dtype_is_object)
+ */
+ __Pyx_XDECREF(__pyx_r);
+
+ /* "View.MemoryView":1056
+ * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
+ * to_object_func, to_dtype_func,
+ * memview.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1040
+ *
+ * @cname('__pyx_memoryview_copy_object_from_slice')
+ * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
+ * """
+ * Create a new memoryview object from a given memoryview object and slice.
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1062
+ *
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
+ * if arg < 0:
+ * return -arg
+ */
+
+static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
+ Py_ssize_t __pyx_r;
+ int __pyx_t_1;
+
+ /* "View.MemoryView":1063
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0: # <<<<<<<<<<<<<<
+ * return -arg
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1064
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0:
+ * return -arg # <<<<<<<<<<<<<<
+ * else:
+ * return arg
+ */
+ __pyx_r = (-__pyx_v_arg);
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1066
+ * return -arg
+ * else:
+ * return arg # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_get_best_slice_order')
+ */
+ __pyx_r = __pyx_v_arg;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":1062
+ *
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
+ * if arg < 0:
+ * return -arg
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1069
+ *
+ * @cname('__pyx_get_best_slice_order')
+ * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
+ * """
+ * Figure out the best memory access order for a given slice.
+ */
+
+static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
+ int __pyx_v_i;
+ Py_ssize_t __pyx_v_c_stride;
+ Py_ssize_t __pyx_v_f_stride;
+ char __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+
+ /* "View.MemoryView":1074
+ * """
+ * cdef int i
+ * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t f_stride = 0
+ *
+ */
+ __pyx_v_c_stride = 0;
+
+ /* "View.MemoryView":1075
+ * cdef int i
+ * cdef Py_ssize_t c_stride = 0
+ * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim - 1, -1, -1):
+ */
+ __pyx_v_f_stride = 0;
+
+ /* "View.MemoryView":1077
+ * cdef Py_ssize_t f_stride = 0
+ *
+ * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
+ * if mslice.shape[i] > 1:
+ * c_stride = mslice.strides[i]
+ */
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ __pyx_v_i = __pyx_t_1;
+
+ /* "View.MemoryView":1078
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * c_stride = mslice.strides[i]
+ * break
+ */
+ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1079
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1:
+ * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
+
+ /* "View.MemoryView":1080
+ * if mslice.shape[i] > 1:
+ * c_stride = mslice.strides[i]
+ * break # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim):
+ */
+ goto __pyx_L4_break;
+ }
+ }
+ __pyx_L4_break:;
+
+ /* "View.MemoryView":1082
+ * break
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if mslice.shape[i] > 1:
+ * f_stride = mslice.strides[i]
+ */
+ __pyx_t_1 = __pyx_v_ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1083
+ *
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * f_stride = mslice.strides[i]
+ * break
+ */
+ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1084
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1:
+ * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
+
+ /* "View.MemoryView":1085
+ * if mslice.shape[i] > 1:
+ * f_stride = mslice.strides[i]
+ * break # <<<<<<<<<<<<<<
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
+ */
+ goto __pyx_L7_break;
+ }
+ }
+ __pyx_L7_break:;
+
+ /* "View.MemoryView":1087
+ * break
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
+ * return 'C'
+ * else:
+ */
+ __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1088
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
+ * return 'C' # <<<<<<<<<<<<<<
+ * else:
+ * return 'F'
+ */
+ __pyx_r = 'C';
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1090
+ * return 'C'
+ * else:
+ * return 'F' # <<<<<<<<<<<<<<
+ *
+ * @cython.cdivision(True)
+ */
+ __pyx_r = 'F';
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":1069
+ *
+ * @cname('__pyx_get_best_slice_order')
+ * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
+ * """
+ * Figure out the best memory access order for a given slice.
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1093
+ *
+ * @cython.cdivision(True)
+ * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
+ * char *dst_data, Py_ssize_t *dst_strides,
+ * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
+ */
+
+static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
+ CYTHON_UNUSED Py_ssize_t __pyx_v_i;
+ CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
+ Py_ssize_t __pyx_v_dst_extent;
+ Py_ssize_t __pyx_v_src_stride;
+ Py_ssize_t __pyx_v_dst_stride;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+
+ /* "View.MemoryView":1100
+ *
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dst_extent = dst_shape[0]
+ * cdef Py_ssize_t src_stride = src_strides[0]
+ */
+ __pyx_v_src_extent = (__pyx_v_src_shape[0]);
+
+ /* "View.MemoryView":1101
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t src_extent = src_shape[0]
+ * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t src_stride = src_strides[0]
+ * cdef Py_ssize_t dst_stride = dst_strides[0]
+ */
+ __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
+
+ /* "View.MemoryView":1102
+ * cdef Py_ssize_t src_extent = src_shape[0]
+ * cdef Py_ssize_t dst_extent = dst_shape[0]
+ * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dst_stride = dst_strides[0]
+ *
+ */
+ __pyx_v_src_stride = (__pyx_v_src_strides[0]);
+
+ /* "View.MemoryView":1103
+ * cdef Py_ssize_t dst_extent = dst_shape[0]
+ * cdef Py_ssize_t src_stride = src_strides[0]
+ * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
+ *
+ * if ndim == 1:
+ */
+ __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
+
+ /* "View.MemoryView":1105
+ * cdef Py_ssize_t dst_stride = dst_strides[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if (src_stride > 0 and dst_stride > 0 and
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ */
+ __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1106
+ *
+ * if ndim == 1:
+ * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ */
+ __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L5_bool_binop_done;
+ }
+
+ /* "View.MemoryView":1107
+ * if ndim == 1:
+ * if (src_stride > 0 and dst_stride > 0 and
+ * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ * else:
+ */
+ __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
+ if (__pyx_t_2) {
+ __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
+ }
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_L5_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1108
+ * if (src_stride > 0 and dst_stride > 0 and
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
+ * else:
+ * for i in range(dst_extent):
+ */
+ memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1110
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ * else:
+ * for i in range(dst_extent): # <<<<<<<<<<<<<<
+ * memcpy(dst_data, src_data, itemsize)
+ * src_data += src_stride
+ */
+ __pyx_t_4 = __pyx_v_dst_extent;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "View.MemoryView":1111
+ * else:
+ * for i in range(dst_extent):
+ * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
+ * src_data += src_stride
+ * dst_data += dst_stride
+ */
+ memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);
+
+ /* "View.MemoryView":1112
+ * for i in range(dst_extent):
+ * memcpy(dst_data, src_data, itemsize)
+ * src_data += src_stride # <<<<<<<<<<<<<<
+ * dst_data += dst_stride
+ * else:
+ */
+ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
+
+ /* "View.MemoryView":1113
+ * memcpy(dst_data, src_data, itemsize)
+ * src_data += src_stride
+ * dst_data += dst_stride # <<<<<<<<<<<<<<
+ * else:
+ * for i in range(dst_extent):
+ */
+ __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
+ }
+ }
+ __pyx_L4:;
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1115
+ * dst_data += dst_stride
+ * else:
+ * for i in range(dst_extent): # <<<<<<<<<<<<<<
+ * _copy_strided_to_strided(src_data, src_strides + 1,
+ * dst_data, dst_strides + 1,
+ */
+ __pyx_t_4 = __pyx_v_dst_extent;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "View.MemoryView":1116
+ * else:
+ * for i in range(dst_extent):
+ * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
+ * dst_data, dst_strides + 1,
+ * src_shape + 1, dst_shape + 1,
+ */
+ _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
+
+ /* "View.MemoryView":1120
+ * src_shape + 1, dst_shape + 1,
+ * ndim - 1, itemsize)
+ * src_data += src_stride # <<<<<<<<<<<<<<
+ * dst_data += dst_stride
+ *
+ */
+ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
+
+ /* "View.MemoryView":1121
+ * ndim - 1, itemsize)
+ * src_data += src_stride
+ * dst_data += dst_stride # <<<<<<<<<<<<<<
+ *
+ * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
+ */
+ __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
+ }
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1093
+ *
+ * @cython.cdivision(True)
+ * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
+ * char *dst_data, Py_ssize_t *dst_strides,
+ * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1123
+ * dst_data += dst_stride
+ *
+ * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * int ndim, size_t itemsize) nogil:
+ */
+
+static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
+
+ /* "View.MemoryView":1126
+ * __Pyx_memviewslice *dst,
+ * int ndim, size_t itemsize) nogil:
+ * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
+ * src.shape, dst.shape, ndim, itemsize)
+ *
+ */
+ _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
+
+ /* "View.MemoryView":1123
+ * dst_data += dst_stride
+ *
+ * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * int ndim, size_t itemsize) nogil:
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1130
+ *
+ * @cname('__pyx_memoryview_slice_get_size')
+ * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
+ * "Return the size of the memory occupied by the slice in number of bytes"
+ * cdef int i
+ */
+
+static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
+ int __pyx_v_i;
+ Py_ssize_t __pyx_v_size;
+ Py_ssize_t __pyx_r;
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+
+ /* "View.MemoryView":1133
+ * "Return the size of the memory occupied by the slice in number of bytes"
+ * cdef int i
+ * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim):
+ */
+ __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
+ __pyx_v_size = __pyx_t_1;
+
+ /* "View.MemoryView":1135
+ * cdef Py_ssize_t size = src.memview.view.itemsize
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * size *= src.shape[i]
+ *
+ */
+ __pyx_t_2 = __pyx_v_ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1136
+ *
+ * for i in range(ndim):
+ * size *= src.shape[i] # <<<<<<<<<<<<<<
+ *
+ * return size
+ */
+ __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
+ }
+
+ /* "View.MemoryView":1138
+ * size *= src.shape[i]
+ *
+ * return size # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_fill_contig_strides_array')
+ */
+ __pyx_r = __pyx_v_size;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1130
+ *
+ * @cname('__pyx_memoryview_slice_get_size')
+ * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
+ * "Return the size of the memory occupied by the slice in number of bytes"
+ * cdef int i
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1141
+ *
+ * @cname('__pyx_fill_contig_strides_array')
+ * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
+ * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
+ * int ndim, char order) nogil:
+ */
+
+static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
+ int __pyx_v_idx;
+ Py_ssize_t __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+
+ /* "View.MemoryView":1150
+ * cdef int idx
+ *
+ * if order == 'F': # <<<<<<<<<<<<<<
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ */
+ __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1151
+ *
+ * if order == 'F':
+ * for idx in range(ndim): # <<<<<<<<<<<<<<
+ * strides[idx] = stride
+ * stride = stride * shape[idx]
+ */
+ __pyx_t_2 = __pyx_v_ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_idx = __pyx_t_3;
+
+ /* "View.MemoryView":1152
+ * if order == 'F':
+ * for idx in range(ndim):
+ * strides[idx] = stride # <<<<<<<<<<<<<<
+ * stride = stride * shape[idx]
+ * else:
+ */
+ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
+
+ /* "View.MemoryView":1153
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ * stride = stride * shape[idx] # <<<<<<<<<<<<<<
+ * else:
+ * for idx in range(ndim - 1, -1, -1):
+ */
+ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
+ }
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1155
+ * stride = stride * shape[idx]
+ * else:
+ * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
+ * strides[idx] = stride
+ * stride = stride * shape[idx]
+ */
+ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
+ __pyx_v_idx = __pyx_t_2;
+
+ /* "View.MemoryView":1156
+ * else:
+ * for idx in range(ndim - 1, -1, -1):
+ * strides[idx] = stride # <<<<<<<<<<<<<<
+ * stride = stride * shape[idx]
+ *
+ */
+ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
+
+ /* "View.MemoryView":1157
+ * for idx in range(ndim - 1, -1, -1):
+ * strides[idx] = stride
+ * stride = stride * shape[idx] # <<<<<<<<<<<<<<
+ *
+ * return stride
+ */
+ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
+ }
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1159
+ * stride = stride * shape[idx]
+ *
+ * return stride # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_data_to_temp')
+ */
+ __pyx_r = __pyx_v_stride;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1141
+ *
+ * @cname('__pyx_fill_contig_strides_array')
+ * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
+ * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
+ * int ndim, char order) nogil:
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1162
+ *
+ * @cname('__pyx_memoryview_copy_data_to_temp')
+ * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *tmpslice,
+ * char order,
+ */
+
+static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
+ int __pyx_v_i;
+ void *__pyx_v_result;
+ size_t __pyx_v_itemsize;
+ size_t __pyx_v_size;
+ void *__pyx_r;
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ struct __pyx_memoryview_obj *__pyx_t_4;
+ int __pyx_t_5;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+
+ /* "View.MemoryView":1173
+ * cdef void *result
+ *
+ * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
+ * cdef size_t size = slice_get_size(src, ndim)
+ *
+ */
+ __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
+ __pyx_v_itemsize = __pyx_t_1;
+
+ /* "View.MemoryView":1174
+ *
+ * cdef size_t itemsize = src.memview.view.itemsize
+ * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
+ *
+ * result = malloc(size)
+ */
+ __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
+
+ /* "View.MemoryView":1176
+ * cdef size_t size = slice_get_size(src, ndim)
+ *
+ * result = malloc(size) # <<<<<<<<<<<<<<
+ * if not result:
+ * _err(MemoryError, NULL)
+ */
+ __pyx_v_result = malloc(__pyx_v_size);
+
+ /* "View.MemoryView":1177
+ *
+ * result = malloc(size)
+ * if not result: # <<<<<<<<<<<<<<
+ * _err(MemoryError, NULL)
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1178
+ * result = malloc(size)
+ * if not result:
+ * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1181
+ *
+ *
+ * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
+ * tmpslice.memview = src.memview
+ * for i in range(ndim):
+ */
+ __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
+
+ /* "View.MemoryView":1182
+ *
+ * tmpslice.data = <char *> result
+ * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
+ * for i in range(ndim):
+ * tmpslice.shape[i] = src.shape[i]
+ */
+ __pyx_t_4 = __pyx_v_src->memview;
+ __pyx_v_tmpslice->memview = __pyx_t_4;
+
+ /* "View.MemoryView":1183
+ * tmpslice.data = <char *> result
+ * tmpslice.memview = src.memview
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * tmpslice.shape[i] = src.shape[i]
+ * tmpslice.suboffsets[i] = -1
+ */
+ __pyx_t_3 = __pyx_v_ndim;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "View.MemoryView":1184
+ * tmpslice.memview = src.memview
+ * for i in range(ndim):
+ * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
+ * tmpslice.suboffsets[i] = -1
+ *
+ */
+ (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
+
+ /* "View.MemoryView":1185
+ * for i in range(ndim):
+ * tmpslice.shape[i] = src.shape[i]
+ * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ *
+ * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
+ */
+ (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1;
+ }
+
+ /* "View.MemoryView":1187
+ * tmpslice.suboffsets[i] = -1
+ *
+ * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
+ * ndim, order)
+ *
+ */
+ __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order);
+
+ /* "View.MemoryView":1191
+ *
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if tmpslice.shape[i] == 1:
+ * tmpslice.strides[i] = 0
+ */
+ __pyx_t_3 = __pyx_v_ndim;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "View.MemoryView":1192
+ *
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
+ * tmpslice.strides[i] = 0
+ *
+ */
+ __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1193
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1:
+ * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
+ *
+ * if slice_is_contig(src, order, ndim):
+ */
+ (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+ }
+
+ /* "View.MemoryView":1195
+ * tmpslice.strides[i] = 0
+ *
+ * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * memcpy(result, src.data, size)
+ * else:
+ */
+ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1196
+ *
+ * if slice_is_contig(src, order, ndim):
+ * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
+ * else:
+ * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
+ */
+ memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size);
+ goto __pyx_L9;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1198
+ * memcpy(result, src.data, size)
+ * else:
+ * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
+ *
+ * return result
+ */
+ copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
+ }
+ __pyx_L9:;
+
+ /* "View.MemoryView":1200
+ * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
+ *
+ * return result # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1162
+ *
+ * @cname('__pyx_memoryview_copy_data_to_temp')
+ * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *tmpslice,
+ * char order,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = NULL;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1205
+ *
+ * @cname('__pyx_memoryview_err_extents')
+ * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
+ */
+
+static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("_err_extents", 0);
+
+ /* "View.MemoryView":1208
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
+ * (i, extent1, extent2)) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_err_dim')
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":1207
+ * cdef int _err_extents(int i, Py_ssize_t extent1,
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
+ * (i, extent1, extent2))
+ *
+ */
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1207; __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[2]; __pyx_lineno = 1207; __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[2]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":1205
+ *
+ * @cname('__pyx_memoryview_err_extents')
+ * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1211
+ *
+ * @cname('__pyx_memoryview_err_dim')
+ * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii') % dim)
+ *
+ */
+
+static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("_err_dim", 0);
+ __Pyx_INCREF(__pyx_v_error);
+
+ /* "View.MemoryView":1212
+ * @cname('__pyx_memoryview_err_dim')
+ * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
+ * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_err')
+ */
+ __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __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_3); __pyx_t_3 = 0;
+ __Pyx_INCREF(__pyx_v_error);
+ __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_2)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (!__pyx_t_2) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __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_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":1211
+ *
+ * @cname('__pyx_memoryview_err_dim')
+ * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii') % dim)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __Pyx_XDECREF(__pyx_v_error);
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1215
+ *
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
+ * if msg != NULL:
+ * raise error(msg.decode('ascii'))
+ */
+
+static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("_err", 0);
+ __Pyx_INCREF(__pyx_v_error);
+
+ /* "View.MemoryView":1216
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii'))
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1217
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL:
+ * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
+ * else:
+ * raise error
+ */
+ __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_error);
+ __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ if (!__pyx_t_5) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ } else {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1219
+ * raise error(msg.decode('ascii'))
+ * else:
+ * raise error # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_contents')
+ */
+ __Pyx_Raise(__pyx_v_error, 0, 0, 0);
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "View.MemoryView":1215
+ *
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
+ * if msg != NULL:
+ * raise error(msg.decode('ascii'))
+ */
+
+ /* 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);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __Pyx_XDECREF(__pyx_v_error);
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1222
+ *
+ * @cname('__pyx_memoryview_copy_contents')
+ * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice dst,
+ * int src_ndim, int dst_ndim,
+ */
+
+static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
+ void *__pyx_v_tmpdata;
+ size_t __pyx_v_itemsize;
+ int __pyx_v_i;
+ char __pyx_v_order;
+ int __pyx_v_broadcasting;
+ int __pyx_v_direct_copy;
+ __Pyx_memviewslice __pyx_v_tmp;
+ int __pyx_v_ndim;
+ int __pyx_r;
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ void *__pyx_t_6;
+ int __pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+
+ /* "View.MemoryView":1230
+ * Check for overlapping memory and verify the shapes.
+ * """
+ * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
+ * cdef size_t itemsize = src.memview.view.itemsize
+ * cdef int i
+ */
+ __pyx_v_tmpdata = NULL;
+
+ /* "View.MemoryView":1231
+ * """
+ * cdef void *tmpdata = NULL
+ * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
+ * cdef int i
+ * cdef char order = get_best_order(&src, src_ndim)
+ */
+ __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
+ __pyx_v_itemsize = __pyx_t_1;
+
+ /* "View.MemoryView":1233
+ * cdef size_t itemsize = src.memview.view.itemsize
+ * cdef int i
+ * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
+ * cdef bint broadcasting = False
+ * cdef bint direct_copy = False
+ */
+ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
+
+ /* "View.MemoryView":1234
+ * cdef int i
+ * cdef char order = get_best_order(&src, src_ndim)
+ * cdef bint broadcasting = False # <<<<<<<<<<<<<<
+ * cdef bint direct_copy = False
+ * cdef __Pyx_memviewslice tmp
+ */
+ __pyx_v_broadcasting = 0;
+
+ /* "View.MemoryView":1235
+ * cdef char order = get_best_order(&src, src_ndim)
+ * cdef bint broadcasting = False
+ * cdef bint direct_copy = False # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice tmp
+ *
+ */
+ __pyx_v_direct_copy = 0;
+
+ /* "View.MemoryView":1238
+ * cdef __Pyx_memviewslice tmp
+ *
+ * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ */
+ __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1239
+ *
+ * if src_ndim < dst_ndim:
+ * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
+ * elif dst_ndim < src_ndim:
+ * broadcast_leading(&dst, dst_ndim, src_ndim)
+ */
+ __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":1240
+ * if src_ndim < dst_ndim:
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&dst, dst_ndim, src_ndim)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1241
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
+ *
+ * cdef int ndim = max(src_ndim, dst_ndim)
+ */
+ __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1243
+ * broadcast_leading(&dst, dst_ndim, src_ndim)
+ *
+ * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim):
+ */
+ __pyx_t_3 = __pyx_v_dst_ndim;
+ __pyx_t_4 = __pyx_v_src_ndim;
+ if (((__pyx_t_3 > __pyx_t_4) != 0)) {
+ __pyx_t_5 = __pyx_t_3;
+ } else {
+ __pyx_t_5 = __pyx_t_4;
+ }
+ __pyx_v_ndim = __pyx_t_5;
+
+ /* "View.MemoryView":1245
+ * cdef int ndim = max(src_ndim, dst_ndim)
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1:
+ */
+ __pyx_t_5 = __pyx_v_ndim;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1246
+ *
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ */
+ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1247
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1: # <<<<<<<<<<<<<<
+ * broadcasting = True
+ * src.strides[i] = 0
+ */
+ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1248
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1:
+ * broadcasting = True # <<<<<<<<<<<<<<
+ * src.strides[i] = 0
+ * else:
+ */
+ __pyx_v_broadcasting = 1;
+
+ /* "View.MemoryView":1249
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ * src.strides[i] = 0 # <<<<<<<<<<<<<<
+ * else:
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ */
+ (__pyx_v_src.strides[__pyx_v_i]) = 0;
+ goto __pyx_L7;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1251
+ * src.strides[i] = 0
+ * else:
+ * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
+ *
+ * if src.suboffsets[i] >= 0:
+ */
+ __pyx_t_4 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __pyx_L7:;
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":1253
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ *
+ * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ */
+ __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1254
+ *
+ * if src.suboffsets[i] >= 0:
+ * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
+ *
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ */
+ __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+ }
+
+ /* "View.MemoryView":1256
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
+ *
+ * if not slice_is_contig(&src, order, ndim):
+ */
+ __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1258
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ *
+ * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<<
+ * order = get_best_order(&dst, ndim)
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_memviewslice_is_contig((&__pyx_v_src), __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1259
+ *
+ * if not slice_is_contig(&src, order, ndim):
+ * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
+ *
+ * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
+ */
+ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
+ goto __pyx_L10;
+ }
+ __pyx_L10:;
+
+ /* "View.MemoryView":1261
+ * order = get_best_order(&dst, ndim)
+ *
+ * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
+ * src = tmp
+ *
+ */
+ __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_tmpdata = __pyx_t_6;
+
+ /* "View.MemoryView":1262
+ *
+ * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
+ * src = tmp # <<<<<<<<<<<<<<
+ *
+ * if not broadcasting:
+ */
+ __pyx_v_src = __pyx_v_tmp;
+ goto __pyx_L9;
+ }
+ __pyx_L9:;
+
+ /* "View.MemoryView":1264
+ * src = tmp
+ *
+ * if not broadcasting: # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1267
+ *
+ *
+ * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(&dst, 'C', ndim)
+ * elif slice_is_contig(&src, 'F', ndim):
+ */
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'C', __pyx_v_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1268
+ *
+ * if slice_is_contig(&src, 'C', ndim):
+ * direct_copy = slice_is_contig(&dst, 'C', ndim) # <<<<<<<<<<<<<<
+ * elif slice_is_contig(&src, 'F', ndim):
+ * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ */
+ __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'C', __pyx_v_ndim);
+ goto __pyx_L12;
+ }
+
+ /* "View.MemoryView":1269
+ * if slice_is_contig(&src, 'C', ndim):
+ * direct_copy = slice_is_contig(&dst, 'C', ndim)
+ * elif slice_is_contig(&src, 'F', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ *
+ */
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'F', __pyx_v_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1270
+ * direct_copy = slice_is_contig(&dst, 'C', ndim)
+ * elif slice_is_contig(&src, 'F', ndim):
+ * direct_copy = slice_is_contig(&dst, 'F', ndim) # <<<<<<<<<<<<<<
+ *
+ * if direct_copy:
+ */
+ __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'F', __pyx_v_ndim);
+ goto __pyx_L12;
+ }
+ __pyx_L12:;
+
+ /* "View.MemoryView":1272
+ * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ *
+ * if direct_copy: # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
+ __pyx_t_2 = (__pyx_v_direct_copy != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1274
+ * if direct_copy:
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
+
+ /* "View.MemoryView":1275
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ * free(tmpdata)
+ */
+ memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));
+
+ /* "View.MemoryView":1276
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
+ * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
+ * free(tmpdata)
+ * return 0
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
+
+ /* "View.MemoryView":1277
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ * free(tmpdata) # <<<<<<<<<<<<<<
+ * return 0
+ *
+ */
+ free(__pyx_v_tmpdata);
+
+ /* "View.MemoryView":1278
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ * free(tmpdata)
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ * if order == 'F' == get_best_order(&dst, ndim):
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+ goto __pyx_L11;
+ }
+ __pyx_L11:;
+
+ /* "View.MemoryView":1280
+ * return 0
+ *
+ * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = (__pyx_v_order == 'F');
+ if (__pyx_t_2) {
+ __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
+ }
+ __pyx_t_7 = (__pyx_t_2 != 0);
+ if (__pyx_t_7) {
+
+ /* "View.MemoryView":1283
+ *
+ *
+ * transpose_memslice(&src) # <<<<<<<<<<<<<<
+ * transpose_memslice(&dst)
+ *
+ */
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":1284
+ *
+ * transpose_memslice(&src)
+ * transpose_memslice(&dst) # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L14;
+ }
+ __pyx_L14:;
+
+ /* "View.MemoryView":1286
+ * transpose_memslice(&dst)
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
+ * copy_strided_to_strided(&src, &dst, ndim, itemsize)
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
+
+ /* "View.MemoryView":1287
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ *
+ */
+ copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
+
+ /* "View.MemoryView":1288
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * copy_strided_to_strided(&src, &dst, ndim, itemsize)
+ * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
+ *
+ * free(tmpdata)
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
+
+ /* "View.MemoryView":1290
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ *
+ * free(tmpdata) # <<<<<<<<<<<<<<
+ * return 0
+ *
+ */
+ free(__pyx_v_tmpdata);
+
+ /* "View.MemoryView":1291
+ *
+ * free(tmpdata)
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_broadcast_leading')
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1222
+ *
+ * @cname('__pyx_memoryview_copy_contents')
+ * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice dst,
+ * int src_ndim, int dst_ndim,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = -1;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1294
+ *
+ * @cname('__pyx_memoryview_broadcast_leading')
+ * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * int ndim_other) nogil:
+ */
+
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
+ int __pyx_v_i;
+ int __pyx_v_offset;
+ int __pyx_t_1;
+ int __pyx_t_2;
+
+ /* "View.MemoryView":1298
+ * int ndim_other) nogil:
+ * cdef int i
+ * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim - 1, -1, -1):
+ */
+ __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
+
+ /* "View.MemoryView":1300
+ * cdef int offset = ndim_other - ndim
+ *
+ * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
+ * slice.shape[i + offset] = slice.shape[i]
+ * slice.strides[i + offset] = slice.strides[i]
+ */
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ __pyx_v_i = __pyx_t_1;
+
+ /* "View.MemoryView":1301
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * slice.shape[i + offset] = slice.shape[i] # <<<<<<<<<<<<<<
+ * slice.strides[i + offset] = slice.strides[i]
+ * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ */
+ (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]);
+
+ /* "View.MemoryView":1302
+ * for i in range(ndim - 1, -1, -1):
+ * slice.shape[i + offset] = slice.shape[i]
+ * slice.strides[i + offset] = slice.strides[i] # <<<<<<<<<<<<<<
+ * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ *
+ */
+ (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]);
+
+ /* "View.MemoryView":1303
+ * slice.shape[i + offset] = slice.shape[i]
+ * slice.strides[i + offset] = slice.strides[i]
+ * slice.suboffsets[i + offset] = slice.suboffsets[i] # <<<<<<<<<<<<<<
+ *
+ * for i in range(offset):
+ */
+ (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]);
+ }
+
+ /* "View.MemoryView":1305
+ * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ *
+ * for i in range(offset): # <<<<<<<<<<<<<<
+ * slice.shape[i] = 1
+ * slice.strides[i] = slice.strides[0]
+ */
+ __pyx_t_1 = __pyx_v_offset;
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "View.MemoryView":1306
+ *
+ * for i in range(offset):
+ * slice.shape[i] = 1 # <<<<<<<<<<<<<<
+ * slice.strides[i] = slice.strides[0]
+ * slice.suboffsets[i] = -1
+ */
+ (__pyx_v_slice->shape[__pyx_v_i]) = 1;
+
+ /* "View.MemoryView":1307
+ * for i in range(offset):
+ * slice.shape[i] = 1
+ * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<<
+ * slice.suboffsets[i] = -1
+ *
+ */
+ (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]);
+
+ /* "View.MemoryView":1308
+ * slice.shape[i] = 1
+ * slice.strides[i] = slice.strides[0]
+ * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1;
+ }
+
+ /* "View.MemoryView":1294
+ *
+ * @cname('__pyx_memoryview_broadcast_leading')
+ * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * int ndim_other) nogil:
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1316
+ *
+ * @cname('__pyx_memoryview_refcount_copying')
+ * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
+ * int ndim, bint inc) nogil:
+ *
+ */
+
+static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
+ int __pyx_t_1;
+
+ /* "View.MemoryView":1320
+ *
+ *
+ * if dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
+ * dst.strides, ndim, inc)
+ */
+ __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1321
+ *
+ * if dtype_is_object:
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
+ * dst.strides, ndim, inc)
+ *
+ */
+ __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1316
+ *
+ * @cname('__pyx_memoryview_refcount_copying')
+ * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
+ * int ndim, bint inc) nogil:
+ *
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1325
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
+ * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * bint inc) with gil:
+ */
+
+static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
+ __Pyx_RefNannyDeclarations
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
+
+ /* "View.MemoryView":1328
+ * Py_ssize_t *strides, int ndim,
+ * bint inc) with gil:
+ * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice')
+ */
+ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
+
+ /* "View.MemoryView":1325
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
+ * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * bint inc) with gil:
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ PyGILState_Release(__pyx_gilstate_save);
+ #endif
+}
+
+/* "View.MemoryView":1331
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice')
+ * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim, bint inc):
+ * cdef Py_ssize_t i
+ */
+
+static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
+ CYTHON_UNUSED Py_ssize_t __pyx_v_i;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ Py_ssize_t __pyx_t_2;
+ int __pyx_t_3;
+ __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
+
+ /* "View.MemoryView":1335
+ * cdef Py_ssize_t i
+ *
+ * for i in range(shape[0]): # <<<<<<<<<<<<<<
+ * if ndim == 1:
+ * if inc:
+ */
+ __pyx_t_1 = (__pyx_v_shape[0]);
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "View.MemoryView":1336
+ *
+ * for i in range(shape[0]):
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0])
+ */
+ __pyx_t_3 = ((__pyx_v_ndim == 1) != 0);
+ if (__pyx_t_3) {
+
+ /* "View.MemoryView":1337
+ * for i in range(shape[0]):
+ * if ndim == 1:
+ * if inc: # <<<<<<<<<<<<<<
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ */
+ __pyx_t_3 = (__pyx_v_inc != 0);
+ if (__pyx_t_3) {
+
+ /* "View.MemoryView":1338
+ * if ndim == 1:
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
+ * else:
+ * Py_DECREF((<PyObject **> data)[0])
+ */
+ Py_INCREF((((PyObject **)__pyx_v_data)[0]));
+ goto __pyx_L6;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1340
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1,
+ */
+ Py_DECREF((((PyObject **)__pyx_v_data)[0]));
+ }
+ __pyx_L6:;
+ goto __pyx_L5;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1342
+ * Py_DECREF((<PyObject **> data)[0])
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
+ * ndim - 1, inc)
+ *
+ */
+ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":1345
+ * ndim - 1, inc)
+ *
+ * data += strides[0] # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
+ }
+
+ /* "View.MemoryView":1331
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice')
+ * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim, bint inc):
+ * cdef Py_ssize_t i
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":1351
+ *
+ * @cname('__pyx_memoryview_slice_assign_scalar')
+ * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
+ * size_t itemsize, void *item,
+ * bint dtype_is_object) nogil:
+ */
+
+static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
+
+ /* "View.MemoryView":1354
+ * size_t itemsize, void *item,
+ * bint dtype_is_object) nogil:
+ * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
+ * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
+ * itemsize, item)
+ */
+ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
+
+ /* "View.MemoryView":1355
+ * bint dtype_is_object) nogil:
+ * refcount_copying(dst, dtype_is_object, ndim, False)
+ * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
+ * itemsize, item)
+ * refcount_copying(dst, dtype_is_object, ndim, True)
+ */
+ __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
+
+ /* "View.MemoryView":1357
+ * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
+ * itemsize, item)
+ * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
+
+ /* "View.MemoryView":1351
+ *
+ * @cname('__pyx_memoryview_slice_assign_scalar')
+ * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
+ * size_t itemsize, void *item,
+ * bint dtype_is_object) nogil:
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1361
+ *
+ * @cname('__pyx_memoryview__slice_assign_scalar')
+ * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * size_t itemsize, void *item) nogil:
+ */
+
+static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
+ CYTHON_UNUSED Py_ssize_t __pyx_v_i;
+ Py_ssize_t __pyx_v_stride;
+ Py_ssize_t __pyx_v_extent;
+ int __pyx_t_1;
+ Py_ssize_t __pyx_t_2;
+ Py_ssize_t __pyx_t_3;
+
+ /* "View.MemoryView":1365
+ * size_t itemsize, void *item) nogil:
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ */
+ __pyx_v_stride = (__pyx_v_strides[0]);
+
+ /* "View.MemoryView":1366
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t stride = strides[0]
+ * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
+ *
+ * if ndim == 1:
+ */
+ __pyx_v_extent = (__pyx_v_shape[0]);
+
+ /* "View.MemoryView":1368
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ */
+ __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1369
+ *
+ * if ndim == 1:
+ * for i in range(extent): # <<<<<<<<<<<<<<
+ * memcpy(data, item, itemsize)
+ * data += stride
+ */
+ __pyx_t_2 = __pyx_v_extent;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1370
+ * if ndim == 1:
+ * for i in range(extent):
+ * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
+ * data += stride
+ * else:
+ */
+ memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);
+
+ /* "View.MemoryView":1371
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ * data += stride # <<<<<<<<<<<<<<
+ * else:
+ * for i in range(extent):
+ */
+ __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
+ }
+ goto __pyx_L3;
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":1373
+ * data += stride
+ * else:
+ * for i in range(extent): # <<<<<<<<<<<<<<
+ * _slice_assign_scalar(data, shape + 1, strides + 1,
+ * ndim - 1, itemsize, item)
+ */
+ __pyx_t_2 = __pyx_v_extent;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1374
+ * else:
+ * for i in range(extent):
+ * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
+ * ndim - 1, itemsize, item)
+ * data += stride
+ */
+ __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
+
+ /* "View.MemoryView":1376
+ * _slice_assign_scalar(data, shape + 1, strides + 1,
+ * ndim - 1, itemsize, item)
+ * data += stride # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
+ }
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1361
+ *
+ * @cname('__pyx_memoryview__slice_assign_scalar')
+ * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * size_t itemsize, void *item) nogil:
+ */
+
+ /* function exit code */
+}
+static struct __pyx_vtabstruct_5fabio_3ext_9mar345_IO_PackContainer __pyx_vtable_5fabio_3ext_9mar345_IO_PackContainer;
+
+static PyObject *__pyx_tp_new_5fabio_3ext_9mar345_IO_PackContainer(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *)o);
+ p->__pyx_vtab = __pyx_vtabptr_5fabio_3ext_9mar345_IO_PackContainer;
+ p->data.data = NULL;
+ p->data.memview = NULL;
+ if (unlikely(__pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_1__cinit__(o, a, k) < 0)) {
+ Py_DECREF(o); o = 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_5fabio_3ext_9mar345_IO_PackContainer(PyObject *o) {
+ struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *p = (struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_3__dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ __PYX_XDEC_MEMVIEW(&p->data, 1);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static PyObject *__pyx_getprop_5fabio_3ext_9mar345_IO_13PackContainer_position(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_8position_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_5fabio_3ext_9mar345_IO_13PackContainer_offset(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_6offset_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_5fabio_3ext_9mar345_IO_13PackContainer_allocated(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_9allocated_1__get__(o);
+}
+
+static PyMethodDef __pyx_methods_5fabio_3ext_9mar345_IO_PackContainer[] = {
+ {"get", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_5get, METH_NOARGS, __pyx_doc_5fabio_3ext_9mar345_IO_13PackContainer_4get},
+ {"append", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_13PackContainer_7append, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_9mar345_IO_13PackContainer_6append},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_5fabio_3ext_9mar345_IO_PackContainer[] = {
+ {(char *)"position", __pyx_getprop_5fabio_3ext_9mar345_IO_13PackContainer_position, 0, 0, 0},
+ {(char *)"offset", __pyx_getprop_5fabio_3ext_9mar345_IO_13PackContainer_offset, 0, 0, 0},
+ {(char *)"allocated", __pyx_getprop_5fabio_3ext_9mar345_IO_13PackContainer_allocated, 0, 0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_5fabio_3ext_9mar345_IO_PackContainer = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "fabio.ext.mar345_IO.PackContainer", /*tp_name*/
+ sizeof(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_5fabio_3ext_9mar345_IO_PackContainer, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /*tp_doc*/
+ 0, /*tp_traverse*/
+ 0, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_5fabio_3ext_9mar345_IO_PackContainer, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_5fabio_3ext_9mar345_IO_PackContainer, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_5fabio_3ext_9mar345_IO_PackContainer, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+static struct __pyx_vtabstruct_5fabio_3ext_9mar345_IO_UnpackContainer __pyx_vtable_5fabio_3ext_9mar345_IO_UnpackContainer;
+
+static PyObject *__pyx_tp_new_5fabio_3ext_9mar345_IO_UnpackContainer(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *)o);
+ p->__pyx_vtab = __pyx_vtabptr_5fabio_3ext_9mar345_IO_UnpackContainer;
+ p->data.data = NULL;
+ p->data.memview = NULL;
+ if (unlikely(__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_1__cinit__(o, a, k) < 0)) {
+ Py_DECREF(o); o = 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_5fabio_3ext_9mar345_IO_UnpackContainer(PyObject *o) {
+ struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *p = (struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_3__dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ __PYX_XDEC_MEMVIEW(&p->data, 1);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static PyObject *__pyx_getprop_5fabio_3ext_9mar345_IO_15UnpackContainer_nrow(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_4nrow_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_5fabio_3ext_9mar345_IO_15UnpackContainer_ncol(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_4ncol_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_5fabio_3ext_9mar345_IO_15UnpackContainer_position(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_8position_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_5fabio_3ext_9mar345_IO_15UnpackContainer_size(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_4size_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_5fabio_3ext_9mar345_IO_15UnpackContainer_data(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_4data_1__get__(o);
+}
+
+static PyMethodDef __pyx_methods_5fabio_3ext_9mar345_IO_UnpackContainer[] = {
+ {"get", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_5get, METH_NOARGS, __pyx_doc_5fabio_3ext_9mar345_IO_15UnpackContainer_4get},
+ {"get1d", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_7get1d, METH_NOARGS, __pyx_doc_5fabio_3ext_9mar345_IO_15UnpackContainer_6get1d},
+ {"set_zero", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_9set_zero, METH_O, __pyx_doc_5fabio_3ext_9mar345_IO_15UnpackContainer_8set_zero},
+ {"unpack", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_15UnpackContainer_11unpack, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_9mar345_IO_15UnpackContainer_10unpack},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_5fabio_3ext_9mar345_IO_UnpackContainer[] = {
+ {(char *)"nrow", __pyx_getprop_5fabio_3ext_9mar345_IO_15UnpackContainer_nrow, 0, 0, 0},
+ {(char *)"ncol", __pyx_getprop_5fabio_3ext_9mar345_IO_15UnpackContainer_ncol, 0, 0, 0},
+ {(char *)"position", __pyx_getprop_5fabio_3ext_9mar345_IO_15UnpackContainer_position, 0, 0, 0},
+ {(char *)"size", __pyx_getprop_5fabio_3ext_9mar345_IO_15UnpackContainer_size, 0, 0, 0},
+ {(char *)"data", __pyx_getprop_5fabio_3ext_9mar345_IO_15UnpackContainer_data, 0, 0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_5fabio_3ext_9mar345_IO_UnpackContainer = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "fabio.ext.mar345_IO.UnpackContainer", /*tp_name*/
+ sizeof(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_5fabio_3ext_9mar345_IO_UnpackContainer, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /*tp_doc*/
+ 0, /*tp_traverse*/
+ 0, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_5fabio_3ext_9mar345_IO_UnpackContainer, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_5fabio_3ext_9mar345_IO_UnpackContainer, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_5fabio_3ext_9mar345_IO_UnpackContainer, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+
+static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_array_obj *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_array_obj *)o);
+ p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) {
+ Py_DECREF(o); o = 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_array(PyObject *o) {
+ struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_array___dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ Py_CLEAR(p->mode);
+ Py_CLEAR(p->_format);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
+ PyObject *r;
+ PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
+ r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
+ Py_DECREF(x);
+ return r;
+}
+
+static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
+ if (v) {
+ return __pyx_array___setitem__(o, i, v);
+ }
+ else {
+ PyErr_Format(PyExc_NotImplementedError,
+ "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
+ return -1;
+ }
+}
+
+static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
+ PyObject *v = PyObject_GenericGetAttr(o, n);
+ if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Clear();
+ v = __pyx_array___getattr__(o, n);
+ }
+ return v;
+}
+
+static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
+ return get_memview(o);
+}
+
+static PyMethodDef __pyx_methods_array[] = {
+ {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_array[] = {
+ {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PySequenceMethods __pyx_tp_as_sequence_array = {
+ 0, /*sq_length*/
+ 0, /*sq_concat*/
+ 0, /*sq_repeat*/
+ __pyx_sq_item_array, /*sq_item*/
+ 0, /*sq_slice*/
+ 0, /*sq_ass_item*/
+ 0, /*sq_ass_slice*/
+ 0, /*sq_contains*/
+ 0, /*sq_inplace_concat*/
+ 0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping_array = {
+ 0, /*mp_length*/
+ __pyx_array___getitem__, /*mp_subscript*/
+ __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
+};
+
+static PyBufferProcs __pyx_tp_as_buffer_array = {
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getreadbuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getwritebuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getsegcount*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getcharbuffer*/
+ #endif
+ __pyx_array_getbuffer, /*bf_getbuffer*/
+ 0, /*bf_releasebuffer*/
+};
+
+static PyTypeObject __pyx_type___pyx_array = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "fabio.ext.mar345_IO.array", /*tp_name*/
+ sizeof(struct __pyx_array_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_array, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ __pyx_tp_getattro_array, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /*tp_doc*/
+ 0, /*tp_traverse*/
+ 0, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_array, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_array, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_array, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+
+static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_MemviewEnum_obj *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_MemviewEnum_obj *)o);
+ p->name = Py_None; Py_INCREF(Py_None);
+ return o;
+}
+
+static void __pyx_tp_dealloc_Enum(PyObject *o) {
+ struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->name);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
+ if (p->name) {
+ e = (*v)(p->name, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_Enum(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
+ tmp = ((PyObject*)p->name);
+ p->name = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyMethodDef __pyx_methods_Enum[] = {
+ {0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type___pyx_MemviewEnum = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "fabio.ext.mar345_IO.Enum", /*tp_name*/
+ sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_Enum, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ __pyx_MemviewEnum___repr__, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_Enum, /*tp_traverse*/
+ __pyx_tp_clear_Enum, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_Enum, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ __pyx_MemviewEnum___init__, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_Enum, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
+
+static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_memoryview_obj *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_memoryview_obj *)o);
+ p->__pyx_vtab = __pyx_vtabptr_memoryview;
+ p->obj = Py_None; Py_INCREF(Py_None);
+ p->_size = Py_None; Py_INCREF(Py_None);
+ p->_array_interface = Py_None; Py_INCREF(Py_None);
+ p->view.obj = NULL;
+ if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) {
+ Py_DECREF(o); o = 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_memoryview(PyObject *o) {
+ struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_memoryview___dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ Py_CLEAR(p->obj);
+ Py_CLEAR(p->_size);
+ Py_CLEAR(p->_array_interface);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
+ if (p->obj) {
+ e = (*v)(p->obj, a); if (e) return e;
+ }
+ if (p->_size) {
+ e = (*v)(p->_size, a); if (e) return e;
+ }
+ if (p->_array_interface) {
+ e = (*v)(p->_array_interface, a); if (e) return e;
+ }
+ if (p->view.obj) {
+ e = (*v)(p->view.obj, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_memoryview(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
+ tmp = ((PyObject*)p->obj);
+ p->obj = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_size);
+ p->_size = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_array_interface);
+ p->_array_interface = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ Py_CLEAR(p->view.obj);
+ return 0;
+}
+static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
+ PyObject *r;
+ PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
+ r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
+ Py_DECREF(x);
+ return r;
+}
+
+static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
+ if (v) {
+ return __pyx_memoryview___setitem__(o, i, v);
+ }
+ else {
+ PyErr_Format(PyExc_NotImplementedError,
+ "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
+ return -1;
+ }
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_transpose(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview__get__base(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_shape(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_strides(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_suboffsets(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_ndim(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_itemsize(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_nbytes(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryview_get_size(o);
+}
+
+static PyMethodDef __pyx_methods_memoryview[] = {
+ {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
+ {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
+ {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
+ {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_memoryview[] = {
+ {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
+ {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
+ {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
+ {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
+ {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
+ {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
+ {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
+ {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
+ __pyx_memoryview___len__, /*sq_length*/
+ 0, /*sq_concat*/
+ 0, /*sq_repeat*/
+ __pyx_sq_item_memoryview, /*sq_item*/
+ 0, /*sq_slice*/
+ 0, /*sq_ass_item*/
+ 0, /*sq_ass_slice*/
+ 0, /*sq_contains*/
+ 0, /*sq_inplace_concat*/
+ 0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
+ __pyx_memoryview___len__, /*mp_length*/
+ __pyx_memoryview___getitem__, /*mp_subscript*/
+ __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
+};
+
+static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getreadbuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getwritebuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getsegcount*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getcharbuffer*/
+ #endif
+ __pyx_memoryview_getbuffer, /*bf_getbuffer*/
+ 0, /*bf_releasebuffer*/
+};
+
+static PyTypeObject __pyx_type___pyx_memoryview = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "fabio.ext.mar345_IO.memoryview", /*tp_name*/
+ sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ __pyx_memoryview___repr__, /*tp_repr*/
+ 0, /*tp_as_number*/
+ &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ __pyx_memoryview___str__, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_memoryview, /*tp_traverse*/
+ __pyx_tp_clear_memoryview, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_memoryview, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_memoryview, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_memoryview, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
+
+static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_memoryviewslice_obj *p;
+ PyObject *o = __pyx_tp_new_memoryview(t, a, k);
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_memoryviewslice_obj *)o);
+ p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
+ p->from_object = Py_None; Py_INCREF(Py_None);
+ p->from_slice.memview = NULL;
+ return o;
+}
+
+static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
+ struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
+ #if PY_VERSION_HEX >= 0x030400a1
+ if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_memoryviewslice___dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ Py_CLEAR(p->from_object);
+ PyObject_GC_Track(o);
+ __pyx_tp_dealloc_memoryview(o);
+}
+
+static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
+ e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
+ if (p->from_object) {
+ e = (*v)(p->from_object, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
+ __pyx_tp_clear_memoryview(o);
+ tmp = ((PyObject*)p->from_object);
+ p->from_object = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
+ return 0;
+}
+
+static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_memoryviewslice__get__base(o);
+}
+
+static PyMethodDef __pyx_methods__memoryviewslice[] = {
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
+ {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type___pyx_memoryviewslice = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "fabio.ext.mar345_IO._memoryviewslice", /*tp_name*/
+ sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ #if CYTHON_COMPILING_IN_PYPY
+ __pyx_memoryview___repr__, /*tp_repr*/
+ #else
+ 0, /*tp_repr*/
+ #endif
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ #if CYTHON_COMPILING_IN_PYPY
+ __pyx_memoryview___str__, /*tp_str*/
+ #else
+ 0, /*tp_str*/
+ #endif
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ "Internal class for passing memoryview slices to Python", /*tp_doc*/
+ __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
+ __pyx_tp_clear__memoryviewslice, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods__memoryviewslice, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets__memoryviewslice, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new__memoryviewslice, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+
+static PyMethodDef __pyx_methods[] = {
+ {"precomp", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_5precomp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_9mar345_IO_4precomp},
+ {"postdec", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_7postdec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_9mar345_IO_6postdec},
+ {"pack_nb_val", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_13pack_nb_val, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_9mar345_IO_12pack_nb_val},
+ {"unpack_pck", (PyCFunction)__pyx_pw_5fabio_3ext_9mar345_IO_15unpack_pck, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5fabio_3ext_9mar345_IO_14unpack_pck},
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef __pyx_moduledef = {
+ #if PY_VERSION_HEX < 0x03020000
+ { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
+ #else
+ PyModuleDef_HEAD_INIT,
+ #endif
+ "mar345_IO",
+ __pyx_k_New_Cython_version_of_mar345_IO, /* m_doc */
+ -1, /* m_size */
+ __pyx_methods /* m_methods */,
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_kp_s_2012_2016_European_Synchrotron_R, __pyx_k_2012_2016_European_Synchrotron_R, sizeof(__pyx_k_2012_2016_European_Synchrotron_R), 0, 0, 1, 0},
+ {&__pyx_kp_s_25_07_2017, __pyx_k_25_07_2017, sizeof(__pyx_k_25_07_2017), 0, 0, 1, 0},
+ {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
+ {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
+ {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
+ {&__pyx_kp_b_CCP4_packed_image_V2_X, __pyx_k_CCP4_packed_image_V2_X, sizeof(__pyx_k_CCP4_packed_image_V2_X), 0, 0, 0, 0},
+ {&__pyx_kp_b_CCP4_packed_image_X, __pyx_k_CCP4_packed_image_X, sizeof(__pyx_k_CCP4_packed_image_X), 0, 0, 0, 0},
+ {&__pyx_kp_s_CCP4_packed_image_X_04d_Y_04d, __pyx_k_CCP4_packed_image_X_04d_Y_04d, sizeof(__pyx_k_CCP4_packed_image_X_04d_Y_04d), 0, 0, 1, 0},
+ {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
+ {&__pyx_kp_s_Cannot_determine_the_compression, __pyx_k_Cannot_determine_the_compression, sizeof(__pyx_k_Cannot_determine_the_compression), 0, 0, 1, 0},
+ {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
+ {&__pyx_kp_s_END_OF_HEADER, __pyx_k_END_OF_HEADER, sizeof(__pyx_k_END_OF_HEADER), 0, 0, 1, 0},
+ {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
+ {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
+ {&__pyx_kp_s_Error_while_looking_for_overflow, __pyx_k_Error_while_looking_for_overflow, sizeof(__pyx_k_Error_while_looking_for_overflow), 0, 0, 1, 0},
+ {&__pyx_kp_s_Expected_at_least_d_arguments, __pyx_k_Expected_at_least_d_arguments, sizeof(__pyx_k_Expected_at_least_d_arguments), 0, 0, 1, 0},
+ {&__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_s_Function_call_with_ambiguous_arg, __pyx_k_Function_call_with_ambiguous_arg, sizeof(__pyx_k_Function_call_with_ambiguous_arg), 0, 0, 1, 0},
+ {&__pyx_kp_s_Gael_Goret, __pyx_k_Gael_Goret, sizeof(__pyx_k_Gael_Goret), 0, 0, 1, 0},
+ {&__pyx_n_s_HIGH, __pyx_k_HIGH, sizeof(__pyx_k_HIGH), 0, 0, 1, 1},
+ {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
+ {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
+ {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
+ {&__pyx_kp_s_Input_image_shape_is_2D, __pyx_k_Input_image_shape_is_2D, sizeof(__pyx_k_Input_image_shape_is_2D), 0, 0, 1, 0},
+ {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
+ {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
+ {&__pyx_kp_s_Jerome_Kieffer, __pyx_k_Jerome_Kieffer, sizeof(__pyx_k_Jerome_Kieffer), 0, 0, 1, 0},
+ {&__pyx_n_s_MIT, __pyx_k_MIT, sizeof(__pyx_k_MIT), 0, 0, 1, 1},
+ {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
+ {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
+ {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
+ {&__pyx_kp_s_No_matching_signature_found, __pyx_k_No_matching_signature_found, sizeof(__pyx_k_No_matching_signature_found), 0, 0, 1, 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_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
+ {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
+ {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
+ {&__pyx_kp_s_Thomas_Vincent, __pyx_k_Thomas_Vincent, sizeof(__pyx_k_Thomas_Vincent), 0, 0, 1, 0},
+ {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
+ {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
+ {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
+ {&__pyx_kp_s__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 1, 0},
+ {&__pyx_kp_s__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 0, 1, 0},
+ {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0},
+ {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
+ {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
+ {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
+ {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
+ {&__pyx_n_s_ascontiguousarray, __pyx_k_ascontiguousarray, sizeof(__pyx_k_ascontiguousarray), 0, 0, 1, 1},
+ {&__pyx_n_s_authors, __pyx_k_authors, sizeof(__pyx_k_authors), 0, 0, 1, 1},
+ {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
+ {&__pyx_n_s_block_size, __pyx_k_block_size, sizeof(__pyx_k_block_size), 0, 0, 1, 1},
+ {&__pyx_n_s_byteswap, __pyx_k_byteswap, sizeof(__pyx_k_byteswap), 0, 0, 1, 1},
+ {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
+ {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
+ {&__pyx_n_s_calc_nb_bits, __pyx_k_calc_nb_bits, sizeof(__pyx_k_calc_nb_bits), 0, 0, 1, 1},
+ {&__pyx_n_s_cdimx, __pyx_k_cdimx, sizeof(__pyx_k_cdimx), 0, 0, 1, 1},
+ {&__pyx_n_s_cdimy, __pyx_k_cdimy, sizeof(__pyx_k_cdimy), 0, 0, 1, 1},
+ {&__pyx_n_s_chigh, __pyx_k_chigh, sizeof(__pyx_k_chigh), 0, 0, 1, 1},
+ {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
+ {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
+ {&__pyx_n_s_comp, __pyx_k_comp, sizeof(__pyx_k_comp), 0, 0, 1, 1},
+ {&__pyx_n_s_compress_pck, __pyx_k_compress_pck, sizeof(__pyx_k_compress_pck), 0, 0, 1, 1},
+ {&__pyx_n_s_cont, __pyx_k_cont, sizeof(__pyx_k_cont), 0, 0, 1, 1},
+ {&__pyx_n_s_contact, __pyx_k_contact, sizeof(__pyx_k_contact), 0, 0, 1, 1},
+ {&__pyx_n_s_container, __pyx_k_container, sizeof(__pyx_k_container), 0, 0, 1, 1},
+ {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
+ {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
+ {&__pyx_n_s_copyright, __pyx_k_copyright, sizeof(__pyx_k_copyright), 0, 0, 1, 1},
+ {&__pyx_n_s_current_block_size, __pyx_k_current_block_size, sizeof(__pyx_k_current_block_size), 0, 0, 1, 1},
+ {&__pyx_n_s_cversion, __pyx_k_cversion, sizeof(__pyx_k_cversion), 0, 0, 1, 1},
+ {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
+ {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1},
+ {&__pyx_n_s_defaults, __pyx_k_defaults, sizeof(__pyx_k_defaults), 0, 0, 1, 1},
+ {&__pyx_n_s_dim0, __pyx_k_dim0, sizeof(__pyx_k_dim0), 0, 0, 1, 1},
+ {&__pyx_n_s_dim1, __pyx_k_dim1, sizeof(__pyx_k_dim1), 0, 0, 1, 1},
+ {&__pyx_n_s_dim2, __pyx_k_dim2, sizeof(__pyx_k_dim2), 0, 0, 1, 1},
+ {&__pyx_n_s_do_precomp, __pyx_k_do_precomp, sizeof(__pyx_k_do_precomp), 0, 0, 1, 1},
+ {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
+ {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
+ {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
+ {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
+ {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
+ {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
+ {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
+ {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
+ {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
+ {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
+ {&__pyx_n_s_fabio_ext_mar345_IO, __pyx_k_fabio_ext_mar345_IO, sizeof(__pyx_k_fabio_ext_mar345_IO), 0, 0, 1, 1},
+ {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1},
+ {&__pyx_n_s_find, __pyx_k_find, sizeof(__pyx_k_find), 0, 0, 1, 1},
+ {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
+ {&__pyx_n_s_fname, __pyx_k_fname, sizeof(__pyx_k_fname), 0, 0, 1, 1},
+ {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
+ {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
+ {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
+ {&__pyx_n_s_fromstring, __pyx_k_fromstring, sizeof(__pyx_k_fromstring), 0, 0, 1, 1},
+ {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
+ {&__pyx_n_s_get1d, __pyx_k_get1d, sizeof(__pyx_k_get1d), 0, 0, 1, 1},
+ {&__pyx_n_s_getLogger, __pyx_k_getLogger, sizeof(__pyx_k_getLogger), 0, 0, 1, 1},
+ {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
+ {&__pyx_n_s_hiLine, __pyx_k_hiLine, sizeof(__pyx_k_hiLine), 0, 0, 1, 1},
+ {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
+ {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
+ {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1},
+ {&__pyx_n_s_image, __pyx_k_image, sizeof(__pyx_k_image), 0, 0, 1, 1},
+ {&__pyx_n_s_img, __pyx_k_img, sizeof(__pyx_k_img), 0, 0, 1, 1},
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+ {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
+ {&__pyx_n_s_input_image, __pyx_k_input_image, sizeof(__pyx_k_input_image), 0, 0, 1, 1},
+ {&__pyx_n_s_instream, __pyx_k_instream, sizeof(__pyx_k_instream), 0, 0, 1, 1},
+ {&__pyx_n_s_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 0, 1, 1},
+ {&__pyx_n_s_int16_t, __pyx_k_int16_t, sizeof(__pyx_k_int16_t), 0, 0, 1, 1},
+ {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
+ {&__pyx_n_s_int32_t, __pyx_k_int32_t, sizeof(__pyx_k_int32_t), 0, 0, 1, 1},
+ {&__pyx_n_s_int64_t, __pyx_k_int64_t, sizeof(__pyx_k_int64_t), 0, 0, 1, 1},
+ {&__pyx_n_s_int8_t, __pyx_k_int8_t, sizeof(__pyx_k_int8_t), 0, 0, 1, 1},
+ {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
+ {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
+ {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
+ {&__pyx_kp_s_jerome_kieffer_esrf_eu, __pyx_k_jerome_kieffer_esrf_eu, sizeof(__pyx_k_jerome_kieffer_esrf_eu), 0, 0, 1, 0},
+ {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
+ {&__pyx_n_s_key1, __pyx_k_key1, sizeof(__pyx_k_key1), 0, 0, 1, 1},
+ {&__pyx_n_s_key2, __pyx_k_key2, sizeof(__pyx_k_key2), 0, 0, 1, 1},
+ {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1},
+ {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
+ {&__pyx_n_s_lenkey, __pyx_k_lenkey, sizeof(__pyx_k_lenkey), 0, 0, 1, 1},
+ {&__pyx_n_s_license, __pyx_k_license, sizeof(__pyx_k_license), 0, 0, 1, 1},
+ {&__pyx_n_s_logger, __pyx_k_logger, sizeof(__pyx_k_logger), 0, 0, 1, 1},
+ {&__pyx_n_s_logging, __pyx_k_logging, sizeof(__pyx_k_logging), 0, 0, 1, 1},
+ {&__pyx_n_s_lstrip, __pyx_k_lstrip, sizeof(__pyx_k_lstrip), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
+ {&__pyx_n_s_mkstemp, __pyx_k_mkstemp, sizeof(__pyx_k_mkstemp), 0, 0, 1, 1},
+ {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
+ {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
+ {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
+ {&__pyx_n_s_nb_val, __pyx_k_nb_val, sizeof(__pyx_k_nb_val), 0, 0, 1, 1},
+ {&__pyx_n_s_nb_val_packed, __pyx_k_nb_val_packed, sizeof(__pyx_k_nb_val_packed), 0, 0, 1, 1},
+ {&__pyx_n_s_nb_value, __pyx_k_nb_value, sizeof(__pyx_k_nb_value), 0, 0, 1, 1},
+ {&__pyx_n_s_ncol, __pyx_k_ncol, sizeof(__pyx_k_ncol), 0, 0, 1, 1},
+ {&__pyx_n_s_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 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_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
+ {&__pyx_n_s_next_bock_size, __pyx_k_next_bock_size, sizeof(__pyx_k_next_bock_size), 0, 0, 1, 1},
+ {&__pyx_n_s_normal_offset, __pyx_k_normal_offset, sizeof(__pyx_k_normal_offset), 0, 0, 1, 1},
+ {&__pyx_n_s_normal_start, __pyx_k_normal_start, sizeof(__pyx_k_normal_start), 0, 0, 1, 1},
+ {&__pyx_n_s_nrow, __pyx_k_nrow, sizeof(__pyx_k_nrow), 0, 0, 1, 1},
+ {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+ {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
+ {&__pyx_n_s_odata, __pyx_k_odata, sizeof(__pyx_k_odata), 0, 0, 1, 1},
+ {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
+ {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
+ {&__pyx_n_s_ord, __pyx_k_ord, sizeof(__pyx_k_ord), 0, 0, 1, 1},
+ {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
+ {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1},
+ {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1},
+ {&__pyx_n_s_overflowPix, __pyx_k_overflowPix, sizeof(__pyx_k_overflowPix), 0, 0, 1, 1},
+ {&__pyx_n_s_overflow_data, __pyx_k_overflow_data, sizeof(__pyx_k_overflow_data), 0, 0, 1, 1},
+ {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
+ {&__pyx_n_s_pack_image, __pyx_k_pack_image, sizeof(__pyx_k_pack_image), 0, 0, 1, 1},
+ {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
+ {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_fuse_0calc_nb_bits, __pyx_k_pyx_fuse_0calc_nb_bits, sizeof(__pyx_k_pyx_fuse_0calc_nb_bits), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_fuse_1calc_nb_bits, __pyx_k_pyx_fuse_1calc_nb_bits, sizeof(__pyx_k_pyx_fuse_1calc_nb_bits), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_fuse_2calc_nb_bits, __pyx_k_pyx_fuse_2calc_nb_bits, sizeof(__pyx_k_pyx_fuse_2calc_nb_bits), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_fuse_3calc_nb_bits, __pyx_k_pyx_fuse_3calc_nb_bits, sizeof(__pyx_k_pyx_fuse_3calc_nb_bits), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
+ {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+ {&__pyx_n_s_ravel, __pyx_k_ravel, sizeof(__pyx_k_ravel), 0, 0, 1, 1},
+ {&__pyx_n_s_raw, __pyx_k_raw, sizeof(__pyx_k_raw), 0, 0, 1, 1},
+ {&__pyx_n_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 1},
+ {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
+ {&__pyx_n_s_records, __pyx_k_records, sizeof(__pyx_k_records), 0, 0, 1, 1},
+ {&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1},
+ {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1},
+ {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1},
+ {&__pyx_n_s_set_zero, __pyx_k_set_zero, sizeof(__pyx_k_set_zero), 0, 0, 1, 1},
+ {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
+ {&__pyx_n_s_signatures, __pyx_k_signatures, sizeof(__pyx_k_signatures), 0, 0, 1, 1},
+ {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
+ {&__pyx_n_s_sizes, __pyx_k_sizes, sizeof(__pyx_k_sizes), 0, 0, 1, 1},
+ {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
+ {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
+ {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
+ {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
+ {&__pyx_n_s_stream, __pyx_k_stream, sizeof(__pyx_k_stream), 0, 0, 1, 1},
+ {&__pyx_n_s_stream_size, __pyx_k_stream_size, sizeof(__pyx_k_stream_size), 0, 0, 1, 1},
+ {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
+ {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
+ {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
+ {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
+ {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
+ {&__pyx_n_s_swap_needed, __pyx_k_swap_needed, sizeof(__pyx_k_swap_needed), 0, 0, 1, 1},
+ {&__pyx_n_s_tempfile, __pyx_k_tempfile, sizeof(__pyx_k_tempfile), 0, 0, 1, 1},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__pyx_n_s_tostring, __pyx_k_tostring, sizeof(__pyx_k_tostring), 0, 0, 1, 1},
+ {&__pyx_n_s_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 0, 1, 1},
+ {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
+ {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
+ {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
+ {&__pyx_n_s_uncompress_pck, __pyx_k_uncompress_pck, sizeof(__pyx_k_uncompress_pck), 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_unlink, __pyx_k_unlink, sizeof(__pyx_k_unlink), 0, 0, 1, 1},
+ {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
+ {&__pyx_n_s_unpacked, __pyx_k_unpacked, sizeof(__pyx_k_unpacked), 0, 0, 1, 1},
+ {&__pyx_n_s_use_CCP4, __pyx_k_use_CCP4, sizeof(__pyx_k_use_CCP4), 0, 0, 1, 1},
+ {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
+ {&__pyx_n_s_value_size, __pyx_k_value_size, sizeof(__pyx_k_value_size), 0, 0, 1, 1},
+ {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
+ {&__pyx_n_s_warning, __pyx_k_warning, sizeof(__pyx_k_warning), 0, 0, 1, 1},
+ {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1},
+ {&__pyx_n_s_word, __pyx_k_word, sizeof(__pyx_k_word), 0, 0, 1, 1},
+ {&__pyx_kp_s_workspace_valls_fabio_git_fabio, __pyx_k_workspace_valls_fabio_git_fabio, sizeof(__pyx_k_workspace_valls_fabio_git_fabio), 0, 0, 1, 0},
+ {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
+ {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
+ {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static int __Pyx_InitCachedBuiltins(void) {
+ __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __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 = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __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 = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __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_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if PY_MAJOR_VERSION >= 3
+ __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "fabio/ext/mar345_IO.pyx":102
+ * if use_CCP4:
+ * (fd, fname) = tempfile.mkstemp()
+ * fname = fname.encode("ASCII") # <<<<<<<<<<<<<<
+ * name = <char*> fname
+ * with nogil:
+ */
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple_);
+ __Pyx_GIVEREF(__pyx_tuple_);
+
+ /* "fabio/ext/mar345_IO.pyx":107
+ * pack_wordimage_c(<short int *> &data[0], dim1, dim0, name)
+ * with open(name, "rb") as f:
+ * f.seek(0) # <<<<<<<<<<<<<<
+ * output = f.read()
+ * os.close(fd)
+ */
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__2);
+ __Pyx_GIVEREF(__pyx_tuple__2);
+
+ /* "fabio/ext/mar345_IO.pyx":106
+ * with nogil:
+ * pack_wordimage_c(<short int *> &data[0], dim1, dim0, name)
+ * with open(name, "rb") as f: # <<<<<<<<<<<<<<
+ * f.seek(0)
+ * output = f.read()
+ */
+ __pyx_tuple__3 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__3);
+ __Pyx_GIVEREF(__pyx_tuple__3);
+
+ /* "fabio/ext/mar345_IO.pyx":112
+ * os.unlink(fname)
+ * else:
+ * output = ("\nCCP4 packed image, X: %04d, Y: %04d\n" % (dim1, dim0)).encode("ASCII") # <<<<<<<<<<<<<<
+ * raw = precomp(data, dim1)
+ * cont = pack_image(raw, False)
+ */
+ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__4);
+ __Pyx_GIVEREF(__pyx_tuple__4);
+
+ /* "fabio/ext/mar345_IO.pyx":171
+ * lenkey = len(key2)
+ * if cversion not in [1, 2]:
+ * raise RuntimeError("Cannot determine the compression scheme for PCK compression (either version 1 or 2)") # <<<<<<<<<<<<<<
+ * if (overflowPix is None) and (overflowPix is not False):
+ * end = raw.find("END OF HEADER")
+ */
+ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Cannot_determine_the_compression); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__5);
+ __Pyx_GIVEREF(__pyx_tuple__5);
+
+ /* "fabio/ext/mar345_IO.pyx":173
+ * raise RuntimeError("Cannot determine the compression scheme for PCK compression (either version 1 or 2)")
+ * if (overflowPix is None) and (overflowPix is not False):
+ * end = raw.find("END OF HEADER") # <<<<<<<<<<<<<<
+ * start = raw[:end].find("HIGH")
+ * hiLine = raw[start:end]
+ */
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_END_OF_HEADER); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__6);
+ __Pyx_GIVEREF(__pyx_tuple__6);
+
+ /* "fabio/ext/mar345_IO.pyx":174
+ * if (overflowPix is None) and (overflowPix is not False):
+ * end = raw.find("END OF HEADER")
+ * start = raw[:end].find("HIGH") # <<<<<<<<<<<<<<
+ * hiLine = raw[start:end]
+ * hiLine = hiLine.split("\n")[0]
+ */
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_HIGH); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__7);
+ __Pyx_GIVEREF(__pyx_tuple__7);
+
+ /* "fabio/ext/mar345_IO.pyx":176
+ * start = raw[:end].find("HIGH")
+ * hiLine = raw[start:end]
+ * hiLine = hiLine.split("\n")[0] # <<<<<<<<<<<<<<
+ * word = hiLine.split()
+ * if len(word) > 1:
+ */
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__9);
+ __Pyx_GIVEREF(__pyx_tuple__9);
+
+ /* "fabio/ext/mar345_IO.pyx":213
+ * odata = numpy.fromstring(raw[stop - 64 * records: stop], dtype=numpy.int32)
+ * if swap_needed:
+ * odata.byteswap(True) # <<<<<<<<<<<<<<
+ * overflow_data = odata.reshape((-1, 2))
+ * for i in range(overflow_data.shape[0]):
+ */
+ __pyx_tuple__10 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__10);
+ __Pyx_GIVEREF(__pyx_tuple__10);
+
+ /* "fabio/ext/mar345_IO.pyx":214
+ * if swap_needed:
+ * odata.byteswap(True)
+ * overflow_data = odata.reshape((-1, 2)) # <<<<<<<<<<<<<<
+ * for i in range(overflow_data.shape[0]):
+ * idx = overflow_data[i, 0] - 1 # indexes are even values (-1 because 1 based counting)
+ */
+ __pyx_tuple__11 = PyTuple_Pack(2, __pyx_int_neg_1, __pyx_int_2); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__11);
+ __Pyx_GIVEREF(__pyx_tuple__11);
+ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_tuple__11); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__12);
+ __Pyx_GIVEREF(__pyx_tuple__12);
+
+ /* "fabio/ext/mar345_IO.pyx":348
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef inline int calc_nb_bits(any_int_t[::1] data, cnp.uint32_t start, cnp.uint32_t stop) nogil: # <<<<<<<<<<<<<<
+ * """Calculate the number of bits needed to encode the data
+ *
+ */
+ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s__13); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__14);
+ __Pyx_GIVEREF(__pyx_tuple__14);
+ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s__15); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__16);
+ __Pyx_GIVEREF(__pyx_tuple__16);
+ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__17);
+ __Pyx_GIVEREF(__pyx_tuple__17);
+ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__18);
+ __Pyx_GIVEREF(__pyx_tuple__18);
+
+ /* "../../../usr/lib/python2.7/dist-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_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__19);
+ __Pyx_GIVEREF(__pyx_tuple__19);
+
+ /* "../../../usr/lib/python2.7/dist-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_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__20);
+ __Pyx_GIVEREF(__pyx_tuple__20);
+
+ /* "../../../usr/lib/python2.7/dist-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_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__21);
+ __Pyx_GIVEREF(__pyx_tuple__21);
+
+ /* "../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
+ *
+ * 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_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__22);
+ __Pyx_GIVEREF(__pyx_tuple__22);
+
+ /* "../../../usr/lib/python2.7/dist-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_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__23);
+ __Pyx_GIVEREF(__pyx_tuple__23);
+
+ /* "../../../usr/lib/python2.7/dist-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_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__24);
+ __Pyx_GIVEREF(__pyx_tuple__24);
+
+ /* "View.MemoryView":127
+ *
+ * if not self.ndim:
+ * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if itemsize <= 0:
+ */
+ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__25);
+ __Pyx_GIVEREF(__pyx_tuple__25);
+
+ /* "View.MemoryView":130
+ *
+ * if itemsize <= 0:
+ * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if isinstance(format, unicode):
+ */
+ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__26);
+ __Pyx_GIVEREF(__pyx_tuple__26);
+
+ /* "View.MemoryView":142
+ *
+ * if not self._shape:
+ * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__27);
+ __Pyx_GIVEREF(__pyx_tuple__27);
+
+ /* "View.MemoryView":170
+ * self.data = <char *>malloc(self.len)
+ * if not self.data:
+ * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
+ *
+ * if self.dtype_is_object:
+ */
+ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__28);
+ __Pyx_GIVEREF(__pyx_tuple__28);
+
+ /* "View.MemoryView":186
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
+ * info.buf = self.data
+ * info.len = self.len
+ */
+ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__29);
+ __Pyx_GIVEREF(__pyx_tuple__29);
+
+ /* "View.MemoryView":445
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
+ * else:
+ * if len(self.view.format) == 1:
+ */
+ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__30);
+ __Pyx_GIVEREF(__pyx_tuple__30);
+
+ /* "View.MemoryView":521
+ * if self.view.strides == NULL:
+ *
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ *
+ * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ */
+ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__31);
+ __Pyx_GIVEREF(__pyx_tuple__31);
+
+ /* "View.MemoryView":638
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
+ * seen_ellipsis = True
+ * else:
+ */
+ __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__32)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_slice__32);
+ __Pyx_GIVEREF(__pyx_slice__32);
+
+ /* "View.MemoryView":641
+ * seen_ellipsis = True
+ * else:
+ * result.append(slice(None)) # <<<<<<<<<<<<<<
+ * have_slices = True
+ * else:
+ */
+ __pyx_slice__33 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__33)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_slice__33);
+ __Pyx_GIVEREF(__pyx_slice__33);
+
+ /* "View.MemoryView":652
+ * nslices = ndim - len(result)
+ * if nslices:
+ * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
+ *
+ * return have_slices or nslices, tuple(result)
+ */
+ __pyx_slice__34 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__34)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_slice__34);
+ __Pyx_GIVEREF(__pyx_slice__34);
+
+ /* "View.MemoryView":660
+ * for i in range(ndim):
+ * if suboffsets[i] >= 0:
+ * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__35);
+ __Pyx_GIVEREF(__pyx_tuple__35);
+
+ /* "fabio/ext/mar345_IO.pyx":81
+ *
+ * @cython.boundscheck(False)
+ * def compress_pck(image not None, bint use_CCP4=False): # <<<<<<<<<<<<<<
+ * """
+ * :param image: numpy array as input
+ */
+ __pyx_tuple__36 = PyTuple_Pack(16, __pyx_n_s_image, __pyx_n_s_use_CCP4, __pyx_n_s_size, __pyx_n_s_dim0, __pyx_n_s_dim1, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_fd, __pyx_n_s_ret, __pyx_n_s_name, __pyx_n_s_data, __pyx_n_s_raw, __pyx_n_s_output, __pyx_n_s_fname, __pyx_n_s_f, __pyx_n_s_cont); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__36);
+ __Pyx_GIVEREF(__pyx_tuple__36);
+ __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_workspace_valls_fabio_git_fabio, __pyx_n_s_compress_pck, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/mar345_IO.pyx":121
+ * @cython.boundscheck(False)
+ * @cython.cdivision(True)
+ * def uncompress_pck(bytes raw not None, dim1=None, dim2=None, overflowPix=None, version=None, normal_start=None, swap_needed=None, bint use_CCP4=False): # <<<<<<<<<<<<<<
+ * """
+ * Unpack a mar345 compressed image
+ */
+ __pyx_tuple__38 = PyTuple_Pack(33, __pyx_n_s_raw, __pyx_n_s_dim1, __pyx_n_s_dim2, __pyx_n_s_overflowPix, __pyx_n_s_version, __pyx_n_s_normal_start, __pyx_n_s_swap_needed, __pyx_n_s_use_CCP4, __pyx_n_s_cdimx, __pyx_n_s_cdimy, __pyx_n_s_chigh, __pyx_n_s_cversion, __pyx_n_s_records, __pyx_n_s_normal_offset, __pyx_n_s_lenkey, __pyx_n_s_i, __pyx_n_s_stop, __pyx_n_s_idx, __pyx_n_s_value, __pyx_n_s_data, __pyx_n_s_instream, __pyx_n_s_unpacked, __pyx_n_s_overflow_data, __pyx_n_s_out, __pyx_n_s_end, __pyx_n_s_key1, __pyx_n_s_key2, __pyx_n_s_start, __pyx_n_s_key, __pyx_n_s_sizes, __pyx_n_s_hiLine, __pyx_n_s_word, __pyx_n_s_odata); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__38);
+ __Pyx_GIVEREF(__pyx_tuple__38);
+ __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(8, 0, 33, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_workspace_valls_fabio_git_fabio, __pyx_n_s_uncompress_pck, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/mar345_IO.pyx":348
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef inline int calc_nb_bits(any_int_t[::1] data, cnp.uint32_t start, cnp.uint32_t stop) nogil: # <<<<<<<<<<<<<<
+ * """Calculate the number of bits needed to encode the data
+ *
+ */
+ __pyx_tuple__40 = PyTuple_Pack(3, __pyx_n_s_data, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __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, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_workspace_valls_fabio_git_fabio, __pyx_n_s_pyx_fuse_0calc_nb_bits, 348, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/mar345_IO.pyx":396
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * def pack_image(img, bint do_precomp=True): # <<<<<<<<<<<<<<
+ * """Pack an image into a binary compressed block
+ *
+ */
+ __pyx_tuple__42 = PyTuple_Pack(14, __pyx_n_s_img, __pyx_n_s_do_precomp, __pyx_n_s_nrow, __pyx_n_s_ncol, __pyx_n_s_size, __pyx_n_s_stream_size, __pyx_n_s_input_image, __pyx_n_s_raw, __pyx_n_s_container, __pyx_n_s_i, __pyx_n_s_position, __pyx_n_s_nb_val_packed, __pyx_n_s_current_block_size, __pyx_n_s_next_bock_size); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__42);
+ __Pyx_GIVEREF(__pyx_tuple__42);
+ __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_workspace_valls_fabio_git_fabio, __pyx_n_s_pack_image, 396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "View.MemoryView":276
+ * return self.name
+ *
+ * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>")
+ */
+ __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__44);
+ __Pyx_GIVEREF(__pyx_tuple__44);
+
+ /* "View.MemoryView":277
+ *
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
+ * cdef indirect = Enum("<strided and indirect>")
+ *
+ */
+ __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__45);
+ __Pyx_GIVEREF(__pyx_tuple__45);
+
+ /* "View.MemoryView":278
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__46);
+ __Pyx_GIVEREF(__pyx_tuple__46);
+
+ /* "View.MemoryView":281
+ *
+ *
+ * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>")
+ *
+ */
+ __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__47);
+ __Pyx_GIVEREF(__pyx_tuple__47);
+
+ /* "View.MemoryView":282
+ *
+ * cdef contiguous = Enum("<contiguous and direct>")
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_tuple__48);
+ __Pyx_GIVEREF(__pyx_tuple__48);
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+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_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) {__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;
+}
+
+#if PY_MAJOR_VERSION < 3
+PyMODINIT_FUNC initmar345_IO(void); /*proto*/
+PyMODINIT_FUNC initmar345_IO(void)
+#else
+PyMODINIT_FUNC PyInit_mar345_IO(void); /*proto*/
+PyMODINIT_FUNC PyInit_mar345_IO(void)
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ static __pyx_t_5numpy_uint8_t __pyx_t_6[8];
+ static __pyx_t_5numpy_uint8_t __pyx_t_7[33];
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_REFNANNY
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+ if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+ }
+ #endif
+ __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_mar345_IO(void)", 0);
+ if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #ifdef __Pyx_CyFunction_USED
+ if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
+ /*--- Module creation code ---*/
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("mar345_IO", __pyx_methods, __pyx_k_New_Cython_version_of_mar345_IO, 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_fabio__ext__mar345_IO) {
+ 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;}
+ if (!PyDict_GetItemString(modules, "fabio.ext.mar345_IO")) {
+ if (unlikely(PyDict_SetItemString(modules, "fabio.ext.mar345_IO", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+ /*--- 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 ---*/
+ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Global init code ---*/
+ generic = Py_None; Py_INCREF(Py_None);
+ strided = Py_None; Py_INCREF(Py_None);
+ indirect = Py_None; Py_INCREF(Py_None);
+ contiguous = Py_None; Py_INCREF(Py_None);
+ indirect_contiguous = Py_None; Py_INCREF(Py_None);
+ /*--- Variable export code ---*/
+ /*--- Function export code ---*/
+ /*--- Type init code ---*/
+ __pyx_vtabptr_5fabio_3ext_9mar345_IO_PackContainer = &__pyx_vtable_5fabio_3ext_9mar345_IO_PackContainer;
+ __pyx_vtable_5fabio_3ext_9mar345_IO_PackContainer.append = (PyObject *(*)(struct __pyx_obj_5fabio_3ext_9mar345_IO_PackContainer *, __Pyx_memviewslice, __pyx_t_5numpy_uint32_t, __pyx_t_5numpy_uint32_t, __pyx_t_5numpy_uint32_t, int __pyx_skip_dispatch))__pyx_f_5fabio_3ext_9mar345_IO_13PackContainer_append;
+ if (PyType_Ready(&__pyx_type_5fabio_3ext_9mar345_IO_PackContainer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_5fabio_3ext_9mar345_IO_PackContainer.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type_5fabio_3ext_9mar345_IO_PackContainer.tp_dict, __pyx_vtabptr_5fabio_3ext_9mar345_IO_PackContainer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttrString(__pyx_m, "PackContainer", (PyObject *)&__pyx_type_5fabio_3ext_9mar345_IO_PackContainer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5fabio_3ext_9mar345_IO_PackContainer = &__pyx_type_5fabio_3ext_9mar345_IO_PackContainer;
+ __pyx_vtabptr_5fabio_3ext_9mar345_IO_UnpackContainer = &__pyx_vtable_5fabio_3ext_9mar345_IO_UnpackContainer;
+ __pyx_vtable_5fabio_3ext_9mar345_IO_UnpackContainer.get1d = (__Pyx_memviewslice (*)(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *, int __pyx_skip_dispatch))__pyx_f_5fabio_3ext_9mar345_IO_15UnpackContainer_get1d;
+ __pyx_vtable_5fabio_3ext_9mar345_IO_UnpackContainer.set_zero = (PyObject *(*)(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *, int, int __pyx_skip_dispatch))__pyx_f_5fabio_3ext_9mar345_IO_15UnpackContainer_set_zero;
+ __pyx_vtable_5fabio_3ext_9mar345_IO_UnpackContainer.unpack = (PyObject *(*)(struct __pyx_obj_5fabio_3ext_9mar345_IO_UnpackContainer *, __Pyx_memviewslice, __pyx_t_5numpy_uint32_t, __pyx_t_5numpy_uint32_t, __pyx_t_5numpy_uint32_t, __pyx_t_5numpy_uint32_t, int __pyx_skip_dispatch))__pyx_f_5fabio_3ext_9mar345_IO_15UnpackContainer_unpack;
+ if (PyType_Ready(&__pyx_type_5fabio_3ext_9mar345_IO_UnpackContainer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type_5fabio_3ext_9mar345_IO_UnpackContainer.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type_5fabio_3ext_9mar345_IO_UnpackContainer.tp_dict, __pyx_vtabptr_5fabio_3ext_9mar345_IO_UnpackContainer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttrString(__pyx_m, "UnpackContainer", (PyObject *)&__pyx_type_5fabio_3ext_9mar345_IO_UnpackContainer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5fabio_3ext_9mar345_IO_UnpackContainer = &__pyx_type_5fabio_3ext_9mar345_IO_UnpackContainer;
+ if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type___pyx_array.tp_print = 0;
+ __pyx_array_type = &__pyx_type___pyx_array;
+ if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type___pyx_MemviewEnum.tp_print = 0;
+ __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
+ __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
+ __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
+ __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
+ __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
+ __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
+ __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
+ __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
+ __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
+ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type___pyx_memoryview.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
+ __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
+ __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
+ __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
+ __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
+ __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
+ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_type___pyx_memoryviewslice.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
+ /*--- Type import code ---*/
+ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
+ #if CYTHON_COMPILING_IN_PYPY
+ sizeof(PyTypeObject),
+ #else
+ sizeof(PyHeapTypeObject),
+ #endif
+ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*--- Variable import code ---*/
+ /*--- Function import code ---*/
+ /*--- Execution code ---*/
+
+ /* "fabio/ext/mar345_IO.pyx":42
+ * """
+ *
+ * __authors__ = ["Jerome Kieffer", "Gael Goret", "Thomas Vincent"] # <<<<<<<<<<<<<<
+ * __contact__ = "jerome.kieffer@esrf.eu"
+ * __license__ = "MIT"
+ */
+ __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_kp_s_Jerome_Kieffer);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_Jerome_Kieffer);
+ __Pyx_GIVEREF(__pyx_kp_s_Jerome_Kieffer);
+ __Pyx_INCREF(__pyx_kp_s_Gael_Goret);
+ PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_Gael_Goret);
+ __Pyx_GIVEREF(__pyx_kp_s_Gael_Goret);
+ __Pyx_INCREF(__pyx_kp_s_Thomas_Vincent);
+ PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_s_Thomas_Vincent);
+ __Pyx_GIVEREF(__pyx_kp_s_Thomas_Vincent);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":43
+ *
+ * __authors__ = ["Jerome Kieffer", "Gael Goret", "Thomas Vincent"]
+ * __contact__ = "jerome.kieffer@esrf.eu" # <<<<<<<<<<<<<<
+ * __license__ = "MIT"
+ * __copyright__ = "2012-2016, European Synchrotron Radiation Facility, Grenoble, France"
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_contact, __pyx_kp_s_jerome_kieffer_esrf_eu) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/mar345_IO.pyx":44
+ * __authors__ = ["Jerome Kieffer", "Gael Goret", "Thomas Vincent"]
+ * __contact__ = "jerome.kieffer@esrf.eu"
+ * __license__ = "MIT" # <<<<<<<<<<<<<<
+ * __copyright__ = "2012-2016, European Synchrotron Radiation Facility, Grenoble, France"
+ * __date__ = "25/07/2017"
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/mar345_IO.pyx":45
+ * __contact__ = "jerome.kieffer@esrf.eu"
+ * __license__ = "MIT"
+ * __copyright__ = "2012-2016, European Synchrotron Radiation Facility, Grenoble, France" # <<<<<<<<<<<<<<
+ * __date__ = "25/07/2017"
+ *
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_s_2012_2016_European_Synchrotron_R) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/mar345_IO.pyx":46
+ * __license__ = "MIT"
+ * __copyright__ = "2012-2016, European Synchrotron Radiation Facility, Grenoble, France"
+ * __date__ = "25/07/2017" # <<<<<<<<<<<<<<
+ *
+ * import cython
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_25_07_2017) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "fabio/ext/mar345_IO.pyx":51
+ * cimport numpy as cnp
+ *
+ * import numpy # <<<<<<<<<<<<<<
+ * import os
+ * import tempfile
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":52
+ *
+ * import numpy
+ * import os # <<<<<<<<<<<<<<
+ * import tempfile
+ * import logging
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":53
+ * import numpy
+ * import os
+ * import tempfile # <<<<<<<<<<<<<<
+ * import logging
+ * logger = logging.getLogger(__name__)
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_tempfile, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_tempfile, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":54
+ * import os
+ * import tempfile
+ * import logging # <<<<<<<<<<<<<<
+ * logger = logging.getLogger(__name__)
+ *
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":55
+ * import tempfile
+ * import logging
+ * logger = logging.getLogger(__name__) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (!__pyx_t_4) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ 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+1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __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;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":66
+ * # Few constants:
+ * cdef:
+ * cnp.uint8_t *CCP4_PCK_BIT_COUNT = [0, 4, 5, 6, 7, 8, 16, 32] # <<<<<<<<<<<<<<
+ * cnp.uint8_t *CCP4_BITSIZE = [0, 0, 0, 0, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0,
+ * 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7]
+ */
+ __pyx_t_6[0] = 0;
+ __pyx_t_6[1] = 4;
+ __pyx_t_6[2] = 5;
+ __pyx_t_6[3] = 6;
+ __pyx_t_6[4] = 7;
+ __pyx_t_6[5] = 8;
+ __pyx_t_6[6] = 16;
+ __pyx_t_6[7] = 32;
+ __pyx_v_5fabio_3ext_9mar345_IO_CCP4_PCK_BIT_COUNT = __pyx_t_6;
+
+ /* "fabio/ext/mar345_IO.pyx":67
+ * cdef:
+ * cnp.uint8_t *CCP4_PCK_BIT_COUNT = [0, 4, 5, 6, 7, 8, 16, 32]
+ * cnp.uint8_t *CCP4_BITSIZE = [0, 0, 0, 0, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, # <<<<<<<<<<<<<<
+ * 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7]
+ * int CCP4_PCK_BLOCK_HEADER_LENGTH = 6
+ */
+ __pyx_t_7[0] = 0;
+ __pyx_t_7[1] = 0;
+ __pyx_t_7[2] = 0;
+ __pyx_t_7[3] = 0;
+ __pyx_t_7[4] = 1;
+ __pyx_t_7[5] = 2;
+ __pyx_t_7[6] = 3;
+ __pyx_t_7[7] = 4;
+ __pyx_t_7[8] = 5;
+ __pyx_t_7[9] = 0;
+ __pyx_t_7[10] = 0;
+ __pyx_t_7[11] = 0;
+ __pyx_t_7[12] = 0;
+ __pyx_t_7[13] = 0;
+ __pyx_t_7[14] = 0;
+ __pyx_t_7[15] = 0;
+ __pyx_t_7[16] = 6;
+ __pyx_t_7[17] = 0;
+ __pyx_t_7[18] = 0;
+ __pyx_t_7[19] = 0;
+ __pyx_t_7[20] = 0;
+ __pyx_t_7[21] = 0;
+ __pyx_t_7[22] = 0;
+ __pyx_t_7[23] = 0;
+ __pyx_t_7[24] = 0;
+ __pyx_t_7[25] = 0;
+ __pyx_t_7[26] = 0;
+ __pyx_t_7[27] = 0;
+ __pyx_t_7[28] = 0;
+ __pyx_t_7[29] = 0;
+ __pyx_t_7[30] = 0;
+ __pyx_t_7[31] = 0;
+ __pyx_t_7[32] = 7;
+ __pyx_v_5fabio_3ext_9mar345_IO_CCP4_BITSIZE = __pyx_t_7;
+
+ /* "fabio/ext/mar345_IO.pyx":69
+ * cnp.uint8_t *CCP4_BITSIZE = [0, 0, 0, 0, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0,
+ * 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7]
+ * int CCP4_PCK_BLOCK_HEADER_LENGTH = 6 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_5fabio_3ext_9mar345_IO_CCP4_PCK_BLOCK_HEADER_LENGTH = 6;
+
+ /* "fabio/ext/mar345_IO.pyx":77
+ * void* ccp4_unpack_string (void *, void *, size_t, size_t, size_t) nogil
+ * void* ccp4_unpack_v2_string(void *, void *, size_t, size_t, size_t) nogil
+ * cdef int PACK_SIZE_HIGH = 8 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_5fabio_3ext_9mar345_IO_PACK_SIZE_HIGH = 8;
+
+ /* "fabio/ext/mar345_IO.pyx":81
+ *
+ * @cython.boundscheck(False)
+ * def compress_pck(image not None, bint use_CCP4=False): # <<<<<<<<<<<<<<
+ * """
+ * :param image: numpy array as input
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5fabio_3ext_9mar345_IO_1compress_pck, NULL, __pyx_n_s_fabio_ext_mar345_IO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_compress_pck, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":121
+ * @cython.boundscheck(False)
+ * @cython.cdivision(True)
+ * def uncompress_pck(bytes raw not None, dim1=None, dim2=None, overflowPix=None, version=None, normal_start=None, swap_needed=None, bint use_CCP4=False): # <<<<<<<<<<<<<<
+ * """
+ * Unpack a mar345 compressed image
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5fabio_3ext_9mar345_IO_3uncompress_pck, NULL, __pyx_n_s_fabio_ext_mar345_IO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_uncompress_pck, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":348
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * cpdef inline int calc_nb_bits(any_int_t[::1] data, cnp.uint32_t start, cnp.uint32_t stop) nogil: # <<<<<<<<<<<<<<
+ * """Calculate the number of bits needed to encode the data
+ *
+ */
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_5fabio_3ext_9mar345_IO_17__pyx_fuse_0calc_nb_bits, 0, __pyx_n_s_pyx_fuse_0calc_nb_bits, NULL, __pyx_n_s_fabio_ext_mar345_IO, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int8_t, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_5fabio_3ext_9mar345_IO_19__pyx_fuse_1calc_nb_bits, 0, __pyx_n_s_pyx_fuse_1calc_nb_bits, NULL, __pyx_n_s_fabio_ext_mar345_IO, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int16_t, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_5fabio_3ext_9mar345_IO_21__pyx_fuse_2calc_nb_bits, 0, __pyx_n_s_pyx_fuse_2calc_nb_bits, NULL, __pyx_n_s_fabio_ext_mar345_IO, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int32_t, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_5fabio_3ext_9mar345_IO_23__pyx_fuse_3calc_nb_bits, 0, __pyx_n_s_pyx_fuse_3calc_nb_bits, NULL, __pyx_n_s_fabio_ext_mar345_IO, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int64_t, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_mdef_5fabio_3ext_9mar345_IO_9calc_nb_bits, 0, __pyx_n_s_calc_nb_bits, NULL, __pyx_n_s_fabio_ext_mar345_IO, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_empty_tuple);
+ ((__pyx_FusedFunctionObject *) __pyx_t_3)->__signatures__ = __pyx_t_1;
+ __Pyx_GIVEREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_nb_bits, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":396
+ * @cython.cdivision(True)
+ * @cython.initializedcheck(False)
+ * def pack_image(img, bint do_precomp=True): # <<<<<<<<<<<<<<
+ * """Pack an image into a binary compressed block
+ *
+ */
+ __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_5fabio_3ext_9mar345_IO_11pack_image, NULL, __pyx_n_s_fabio_ext_mar345_IO); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_pack_image, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+ /* "fabio/ext/mar345_IO.pyx":1
+ * # coding: utf-8 # <<<<<<<<<<<<<<
+ * #
+ * # Project: X-ray image reader
+ */
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+ /* "View.MemoryView":203
+ * info.obj = self
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
+ *
+ * def __dealloc__(array self):
+ */
+ __pyx_t_5 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ PyType_Modified(__pyx_array_type);
+
+ /* "View.MemoryView":276
+ * return self.name
+ *
+ * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>")
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_XGOTREF(generic);
+ __Pyx_DECREF_SET(generic, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":277
+ *
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
+ * cdef indirect = Enum("<strided and indirect>")
+ *
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_XGOTREF(strided);
+ __Pyx_DECREF_SET(strided, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":278
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_XGOTREF(indirect);
+ __Pyx_DECREF_SET(indirect, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":281
+ *
+ *
+ * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>")
+ *
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_XGOTREF(contiguous);
+ __Pyx_DECREF_SET(contiguous, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":282
+ *
+ * cdef contiguous = Enum("<contiguous and direct>")
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_XGOTREF(indirect_contiguous);
+ __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":496
+ * info.obj = self
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ PyType_Modified(__pyx_memoryview_type);
+
+ /* "View.MemoryView":953
+ * return self.from_object
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ PyType_Modified(__pyx_memoryviewslice_type);
+
+ /* "__pyxutil":2
+ *
+ * cdef extern from *: # <<<<<<<<<<<<<<
+ * void __pyx_PyErr_Clear "PyErr_Clear" ()
+ * __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int8_t(object)
+ */
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init fabio.ext.mar345_IO", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_DECREF(__pyx_m); __pyx_m = 0;
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init fabio.ext.mar345_IO");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if PY_MAJOR_VERSION < 3
+ return;
+ #else
+ return __pyx_m;
+ #endif
+}
+
+/* Runtime support code */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+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;
+}
+
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AsString(kw_name));
+ #endif
+}
+
+static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ name = first_kw_arg;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ values[name-argnames] = value;
+ continue;
+ }
+ name = first_kw_arg;
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
+ while (*name) {
+ if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**name, key)) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ if ((**argname == key) || (
+ (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**argname, key))) {
+ goto arg_passed_twice;
+ }
+ argname++;
+ }
+ }
+ } else
+ #endif
+ if (likely(PyUnicode_Check(key))) {
+ while (*name) {
+ int cmp = (**name == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**name, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ int cmp = (**argname == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**argname, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) goto arg_passed_twice;
+ argname++;
+ }
+ }
+ } else
+ goto invalid_keyword_type;
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, key);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+bad:
+ return -1;
+}
+
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *more_or_less;
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+ func_name, more_or_less, num_expected,
+ (num_expected == 1) ? "" : "s", num_found);
+}
+
+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 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
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+ PyObject *self, *result;
+ PyCFunction cfunc;
+ cfunc = PyCFunction_GET_FUNCTION(func);
+ self = PyCFunction_GET_SELF(func);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = cfunc(self, arg);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_New(1);
+ if (unlikely(!args)) return NULL;
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(args, 0, arg);
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+ return __Pyx_PyObject_CallMethO(func, arg);
+ }
+ }
+ return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject* args = PyTuple_Pack(1, arg);
+ return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+}
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+#else
+ if (likely(PyCFunction_Check(func))) {
+#endif
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
+ return __Pyx_PyObject_CallMethO(func, NULL);
+ }
+ }
+ return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
+}
+#endif
+
+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 int __Pyx_IterFinish(void) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject* exc_type = tstate->curexc_type;
+ if (unlikely(exc_type)) {
+ if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
+ PyObject *exc_value, *exc_tb;
+ exc_value = tstate->curexc_value;
+ exc_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+ Py_DECREF(exc_type);
+ Py_XDECREF(exc_value);
+ Py_XDECREF(exc_tb);
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+ return 0;
+#else
+ if (unlikely(PyErr_Occurred())) {
+ if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
+ PyErr_Clear();
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+ return 0;
+#endif
+}
+
+static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
+ if (unlikely(retval)) {
+ Py_DECREF(retval);
+ __Pyx_RaiseTooManyValuesError(expected);
+ return -1;
+ } else {
+ return __Pyx_IterFinish();
+ }
+ return 0;
+}
+
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->exc_type;
+ *value = tstate->exc_value;
+ *tb = tstate->exc_traceback;
+ Py_XINCREF(*type);
+ Py_XINCREF(*value);
+ Py_XINCREF(*tb);
+#else
+ PyErr_GetExcInfo(type, value, tb);
+#endif
+}
+static void __Pyx_ExceptionReset(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->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = type;
+ tstate->exc_value = value;
+ tstate->exc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(type, value, tb);
+#endif
+}
+
+static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
+ unsigned int n = 1;
+ return *(unsigned char*)(&n) != 0;
+}
+static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type) {
+ stack[0].field = &ctx->root;
+ stack[0].parent_offset = 0;
+ ctx->root.type = type;
+ ctx->root.name = "buffer dtype";
+ ctx->root.offset = 0;
+ ctx->head = stack;
+ ctx->head->field = &ctx->root;
+ ctx->fmt_offset = 0;
+ ctx->head->parent_offset = 0;
+ ctx->new_packmode = '@';
+ ctx->enc_packmode = '@';
+ ctx->new_count = 1;
+ ctx->enc_count = 0;
+ ctx->enc_type = 0;
+ ctx->is_complex = 0;
+ ctx->is_valid_array = 0;
+ ctx->struct_alignment = 0;
+ while (type->typegroup == 'S') {
+ ++ctx->head;
+ ctx->head->field = type->fields;
+ ctx->head->parent_offset = 0;
+ type = type->fields->type;
+ }
+}
+static int __Pyx_BufFmt_ParseNumber(const char** ts) {
+ int count;
+ const char* t = *ts;
+ if (*t < '0' || *t > '9') {
+ return -1;
+ } else {
+ count = *t++ - '0';
+ while (*t >= '0' && *t < '9') {
+ count *= 10;
+ count += *t++ - '0';
+ }
+ }
+ *ts = t;
+ return count;
+}
+static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
+ int number = __Pyx_BufFmt_ParseNumber(ts);
+ if (number == -1)
+ PyErr_Format(PyExc_ValueError,\
+ "Does not understand character buffer dtype format string ('%c')", **ts);
+ return number;
+}
+static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
+ PyErr_Format(PyExc_ValueError,
+ "Unexpected format string character: '%c'", ch);
+}
+static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
+ switch (ch) {
+ case 'c': return "'char'";
+ case 'b': return "'signed char'";
+ case 'B': return "'unsigned char'";
+ case 'h': return "'short'";
+ case 'H': return "'unsigned short'";
+ case 'i': return "'int'";
+ case 'I': return "'unsigned int'";
+ case 'l': return "'long'";
+ case 'L': return "'unsigned long'";
+ case 'q': return "'long long'";
+ case 'Q': return "'unsigned long long'";
+ case 'f': return (is_complex ? "'complex float'" : "'float'");
+ case 'd': return (is_complex ? "'complex double'" : "'double'");
+ case 'g': return (is_complex ? "'complex long double'" : "'long double'");
+ case 'T': return "a struct";
+ case 'O': return "Python object";
+ case 'P': return "a pointer";
+ case 's': case 'p': return "a string";
+ case 0: return "end";
+ default: return "unparseable format string";
+ }
+}
+static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return 2;
+ case 'i': case 'I': case 'l': case 'L': return 4;
+ case 'q': case 'Q': return 8;
+ case 'f': return (is_complex ? 8 : 4);
+ case 'd': return (is_complex ? 16 : 8);
+ case 'g': {
+ PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
+ return 0;
+ }
+ case 'O': case 'P': return sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
+ switch (ch) {
+ case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(short);
+ case 'i': case 'I': return sizeof(int);
+ case 'l': case 'L': return sizeof(long);
+ #ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(PY_LONG_LONG);
+ #endif
+ case 'f': return sizeof(float) * (is_complex ? 2 : 1);
+ case 'd': return sizeof(double) * (is_complex ? 2 : 1);
+ case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
+ case 'O': case 'P': return sizeof(void*);
+ default: {
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+ }
+}
+typedef struct { char c; short x; } __Pyx_st_short;
+typedef struct { char c; int x; } __Pyx_st_int;
+typedef struct { char c; long x; } __Pyx_st_long;
+typedef struct { char c; float x; } __Pyx_st_float;
+typedef struct { char c; double x; } __Pyx_st_double;
+typedef struct { char c; long double x; } __Pyx_st_longdouble;
+typedef struct { char c; void *x; } __Pyx_st_void_p;
+#ifdef HAVE_LONG_LONG
+typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
+#endif
+static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
+ case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
+ case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
+#ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
+#endif
+ case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
+ case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
+ case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
+ case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+/* These are for computing the padding at the end of the struct to align
+ on the first member of the struct. This will probably the same as above,
+ but we don't have any guarantees.
+ */
+typedef struct { short x; char c; } __Pyx_pad_short;
+typedef struct { int x; char c; } __Pyx_pad_int;
+typedef struct { long x; char c; } __Pyx_pad_long;
+typedef struct { float x; char c; } __Pyx_pad_float;
+typedef struct { double x; char c; } __Pyx_pad_double;
+typedef struct { long double x; char c; } __Pyx_pad_longdouble;
+typedef struct { void *x; char c; } __Pyx_pad_void_p;
+#ifdef HAVE_LONG_LONG
+typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
+#endif
+static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
+ case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
+ case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
+#ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
+#endif
+ case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
+ case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
+ case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
+ case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
+ switch (ch) {
+ case 'c':
+ return 'H';
+ case 'b': case 'h': case 'i':
+ case 'l': case 'q': case 's': case 'p':
+ return 'I';
+ case 'B': case 'H': case 'I': case 'L': case 'Q':
+ return 'U';
+ case 'f': case 'd': case 'g':
+ return (is_complex ? 'C' : 'R');
+ case 'O':
+ return 'O';
+ case 'P':
+ return 'P';
+ default: {
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+ }
+}
+static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
+ if (ctx->head == NULL || ctx->head->field == &ctx->root) {
+ const char* expected;
+ const char* quote;
+ if (ctx->head == NULL) {
+ expected = "end";
+ quote = "";
+ } else {
+ expected = ctx->head->field->type->name;
+ quote = "'";
+ }
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch, expected %s%s%s but got %s",
+ quote, expected, quote,
+ __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
+ } else {
+ __Pyx_StructField* field = ctx->head->field;
+ __Pyx_StructField* parent = (ctx->head - 1)->field;
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
+ field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
+ parent->type->name, field->name);
+ }
+}
+static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
+ char group;
+ size_t size, offset, arraysize = 1;
+ if (ctx->enc_type == 0) return 0;
+ if (ctx->head->field->type->arraysize[0]) {
+ int i, ndim = 0;
+ if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
+ ctx->is_valid_array = ctx->head->field->type->ndim == 1;
+ ndim = 1;
+ if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
+ PyErr_Format(PyExc_ValueError,
+ "Expected a dimension of size %zu, got %zu",
+ ctx->head->field->type->arraysize[0], ctx->enc_count);
+ return -1;
+ }
+ }
+ if (!ctx->is_valid_array) {
+ PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
+ ctx->head->field->type->ndim, ndim);
+ return -1;
+ }
+ for (i = 0; i < ctx->head->field->type->ndim; i++) {
+ arraysize *= ctx->head->field->type->arraysize[i];
+ }
+ ctx->is_valid_array = 0;
+ ctx->enc_count = 1;
+ }
+ group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
+ do {
+ __Pyx_StructField* field = ctx->head->field;
+ __Pyx_TypeInfo* type = field->type;
+ if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
+ size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
+ } else {
+ size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
+ }
+ if (ctx->enc_packmode == '@') {
+ size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
+ size_t align_mod_offset;
+ if (align_at == 0) return -1;
+ align_mod_offset = ctx->fmt_offset % align_at;
+ if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
+ if (ctx->struct_alignment == 0)
+ ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
+ ctx->is_complex);
+ }
+ if (type->size != size || type->typegroup != group) {
+ if (type->typegroup == 'C' && type->fields != NULL) {
+ size_t parent_offset = ctx->head->parent_offset + field->offset;
+ ++ctx->head;
+ ctx->head->field = type->fields;
+ ctx->head->parent_offset = parent_offset;
+ continue;
+ }
+ if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
+ } else {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return -1;
+ }
+ }
+ offset = ctx->head->parent_offset + field->offset;
+ if (ctx->fmt_offset != offset) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
+ (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
+ return -1;
+ }
+ ctx->fmt_offset += size;
+ if (arraysize)
+ ctx->fmt_offset += (arraysize - 1) * size;
+ --ctx->enc_count;
+ while (1) {
+ if (field == &ctx->root) {
+ ctx->head = NULL;
+ if (ctx->enc_count != 0) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return -1;
+ }
+ break;
+ }
+ ctx->head->field = ++field;
+ if (field->type == NULL) {
+ --ctx->head;
+ field = ctx->head->field;
+ continue;
+ } else if (field->type->typegroup == 'S') {
+ size_t parent_offset = ctx->head->parent_offset + field->offset;
+ if (field->type->fields->type == NULL) continue;
+ field = field->type->fields;
+ ++ctx->head;
+ ctx->head->field = field;
+ ctx->head->parent_offset = parent_offset;
+ break;
+ } else {
+ break;
+ }
+ }
+ } while (ctx->enc_count);
+ ctx->enc_type = 0;
+ ctx->is_complex = 0;
+ return 0;
+}
+static CYTHON_INLINE PyObject *
+__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
+{
+ const char *ts = *tsp;
+ int i = 0, number;
+ int ndim = ctx->head->field->type->ndim;
+;
+ ++ts;
+ if (ctx->new_count != 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "Cannot handle repeated arrays in format string");
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ while (*ts && *ts != ')') {
+ 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])
+ return PyErr_Format(PyExc_ValueError,
+ "Expected a dimension of size %zu, got %d",
+ ctx->head->field->type->arraysize[i], number);
+ if (*ts != ',' && *ts != ')')
+ return PyErr_Format(PyExc_ValueError,
+ "Expected a comma in format string, got '%c'", *ts);
+ if (*ts == ',') ts++;
+ i++;
+ }
+ if (i != ndim)
+ return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
+ ctx->head->field->type->ndim, i);
+ if (!*ts) {
+ PyErr_SetString(PyExc_ValueError,
+ "Unexpected end of format string, expected ')'");
+ return NULL;
+ }
+ ctx->is_valid_array = 1;
+ ctx->new_count = 1;
+ *tsp = ++ts;
+ return Py_None;
+}
+static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
+ int got_Z = 0;
+ while (1) {
+ switch(*ts) {
+ case 0:
+ if (ctx->enc_type != 0 && ctx->head == NULL) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ if (ctx->head != NULL) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return NULL;
+ }
+ return ts;
+ case ' ':
+ case '\r':
+ case '\n':
+ ++ts;
+ break;
+ case '<':
+ if (!__Pyx_IsLittleEndian()) {
+ PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
+ return NULL;
+ }
+ ctx->new_packmode = '=';
+ ++ts;
+ break;
+ case '>':
+ case '!':
+ if (__Pyx_IsLittleEndian()) {
+ PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
+ return NULL;
+ }
+ ctx->new_packmode = '=';
+ ++ts;
+ break;
+ case '=':
+ case '@':
+ case '^':
+ ctx->new_packmode = *ts++;
+ break;
+ case 'T':
+ {
+ const char* ts_after_sub;
+ size_t i, struct_count = ctx->new_count;
+ size_t struct_alignment = ctx->struct_alignment;
+ ctx->new_count = 1;
+ ++ts;
+ if (*ts != '{') {
+ PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->enc_type = 0;
+ ctx->enc_count = 0;
+ ctx->struct_alignment = 0;
+ ++ts;
+ ts_after_sub = ts;
+ for (i = 0; i != struct_count; ++i) {
+ ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
+ if (!ts_after_sub) return NULL;
+ }
+ ts = ts_after_sub;
+ if (struct_alignment) ctx->struct_alignment = struct_alignment;
+ }
+ break;
+ case '}':
+ {
+ size_t alignment = ctx->struct_alignment;
+ ++ts;
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->enc_type = 0;
+ if (alignment && ctx->fmt_offset % alignment) {
+ ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
+ }
+ }
+ return ts;
+ case 'x':
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->fmt_offset += ctx->new_count;
+ ctx->new_count = 1;
+ ctx->enc_count = 0;
+ ctx->enc_type = 0;
+ ctx->enc_packmode = ctx->new_packmode;
+ ++ts;
+ break;
+ case 'Z':
+ got_Z = 1;
+ ++ts;
+ if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
+ __Pyx_BufFmt_RaiseUnexpectedChar('Z');
+ return NULL;
+ }
+ 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 'p':
+ if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
+ ctx->enc_packmode == ctx->new_packmode) {
+ ctx->enc_count += ctx->new_count;
+ 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;
+ break;
+ case ':':
+ ++ts;
+ while(*ts != ':') ++ts;
+ ++ts;
+ break;
+ case '(':
+ if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
+ break;
+ default:
+ {
+ int number = __Pyx_BufFmt_ExpectNumber(&ts);
+ if (number == -1) return NULL;
+ ctx->new_count = (size_t)number;
+ }
+ }
+ }
+}
+static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
+ buf->buf = NULL;
+ buf->obj = NULL;
+ buf->strides = __Pyx_zeros;
+ buf->shape = __Pyx_zeros;
+ buf->suboffsets = __Pyx_minusones;
+}
+static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
+ Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
+ int nd, int cast, __Pyx_BufFmt_StackElem* stack)
+{
+ if (obj == Py_None || obj == NULL) {
+ __Pyx_ZeroBuffer(buf);
+ return 0;
+ }
+ buf->buf = NULL;
+ if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
+ if (buf->ndim != nd) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer has wrong number of dimensions (expected %d, got %d)",
+ nd, buf->ndim);
+ goto fail;
+ }
+ if (!cast) {
+ __Pyx_BufFmt_Context ctx;
+ __Pyx_BufFmt_Init(&ctx, stack, dtype);
+ if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
+ }
+ if ((unsigned)buf->itemsize != dtype->size) {
+ PyErr_Format(PyExc_ValueError,
+ "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
+ buf->itemsize, (buf->itemsize > 1) ? "s" : "",
+ dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
+ goto fail;
+ }
+ if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
+ return 0;
+fail:;
+ __Pyx_ZeroBuffer(buf);
+ return -1;
+}
+static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
+ if (info->buf == NULL) return;
+ if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
+ __Pyx_ReleaseBuffer(info);
+}
+
+static int
+__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
+ int ndim,
+ __Pyx_memviewslice *memviewslice,
+ int memview_is_new_reference)
+{
+ __Pyx_RefNannyDeclarations
+ int i, retval=-1;
+ Py_buffer *buf = &memview->view;
+ __Pyx_RefNannySetupContext("init_memviewslice", 0);
+ if (!buf) {
+ PyErr_SetString(PyExc_ValueError,
+ "buf is NULL.");
+ goto fail;
+ } else if (memviewslice->memview || memviewslice->data) {
+ PyErr_SetString(PyExc_ValueError,
+ "memviewslice is already initialized!");
+ goto fail;
+ }
+ if (buf->strides) {
+ for (i = 0; i < ndim; i++) {
+ memviewslice->strides[i] = buf->strides[i];
+ }
+ } else {
+ Py_ssize_t stride = buf->itemsize;
+ for (i = ndim - 1; i >= 0; i--) {
+ memviewslice->strides[i] = stride;
+ stride *= buf->shape[i];
+ }
+ }
+ for (i = 0; i < ndim; i++) {
+ memviewslice->shape[i] = buf->shape[i];
+ if (buf->suboffsets) {
+ memviewslice->suboffsets[i] = buf->suboffsets[i];
+ } else {
+ memviewslice->suboffsets[i] = -1;
+ }
+ }
+ memviewslice->memview = memview;
+ memviewslice->data = (char *)buf->buf;
+ if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
+ Py_INCREF(memview);
+ }
+ retval = 0;
+ goto no_fail;
+fail:
+ memviewslice->memview = 0;
+ memviewslice->data = 0;
+ retval = -1;
+no_fail:
+ __Pyx_RefNannyFinishContext();
+ return retval;
+}
+static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) {
+ va_list vargs;
+ char msg[200];
+ va_start(vargs, fmt);
+#ifdef HAVE_STDARG_PROTOTYPES
+ va_start(vargs, fmt);
+#else
+ va_start(vargs);
+#endif
+ vsnprintf(msg, 200, fmt, vargs);
+ Py_FatalError(msg);
+ va_end(vargs);
+}
+static CYTHON_INLINE int
+__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
+ PyThread_type_lock lock)
+{
+ int result;
+ PyThread_acquire_lock(lock, 1);
+ result = (*acquisition_count)++;
+ PyThread_release_lock(lock);
+ return result;
+}
+static CYTHON_INLINE int
+__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
+ PyThread_type_lock lock)
+{
+ int result;
+ PyThread_acquire_lock(lock, 1);
+ result = (*acquisition_count)--;
+ PyThread_release_lock(lock);
+ return result;
+}
+static CYTHON_INLINE void
+__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
+{
+ int first_time;
+ struct __pyx_memoryview_obj *memview = memslice->memview;
+ if (!memview || (PyObject *) memview == Py_None)
+ return;
+ if (__pyx_get_slice_count(memview) < 0)
+ __pyx_fatalerror("Acquisition count is %d (line %d)",
+ __pyx_get_slice_count(memview), lineno);
+ first_time = __pyx_add_acquisition_count(memview) == 0;
+ if (first_time) {
+ if (have_gil) {
+ Py_INCREF((PyObject *) memview);
+ } else {
+ PyGILState_STATE _gilstate = PyGILState_Ensure();
+ Py_INCREF((PyObject *) memview);
+ PyGILState_Release(_gilstate);
+ }
+ }
+}
+static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
+ int have_gil, int lineno) {
+ int last_time;
+ struct __pyx_memoryview_obj *memview = memslice->memview;
+ if (!memview ) {
+ return;
+ } else if ((PyObject *) memview == Py_None) {
+ memslice->memview = NULL;
+ return;
+ }
+ if (__pyx_get_slice_count(memview) <= 0)
+ __pyx_fatalerror("Acquisition count is %d (line %d)",
+ __pyx_get_slice_count(memview), lineno);
+ last_time = __pyx_sub_acquisition_count(memview) == 1;
+ memslice->data = NULL;
+ if (last_time) {
+ if (have_gil) {
+ Py_CLEAR(memslice->memview);
+ } else {
+ PyGILState_STATE _gilstate = PyGILState_Ensure();
+ Py_CLEAR(memslice->memview);
+ PyGILState_Release(_gilstate);
+ }
+ } else {
+ memslice->memview = NULL;
+ }
+}
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *local_type, *local_value, *local_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ local_type = tstate->curexc_type;
+ local_value = tstate->curexc_value;
+ local_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(&local_type, &local_value, &local_tb);
+#endif
+ PyErr_NormalizeException(&local_type, &local_value, &local_tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(tstate->curexc_type))
+#else
+ if (unlikely(PyErr_Occurred()))
+#endif
+ goto bad;
+ #if PY_MAJOR_VERSION >= 3
+ if (local_tb) {
+ if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+ goto bad;
+ }
+ #endif
+ Py_XINCREF(local_tb);
+ Py_XINCREF(local_type);
+ Py_XINCREF(local_value);
+ *type = local_type;
+ *value = local_value;
+ *tb = local_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = local_type;
+ tstate->exc_value = local_value;
+ tstate->exc_traceback = local_tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
+#endif
+ return 0;
+bad:
+ *type = 0;
+ *value = 0;
+ *tb = 0;
+ Py_XDECREF(local_type);
+ Py_XDECREF(local_value);
+ Py_XDECREF(local_tb);
+ return -1;
+}
+
+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;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_Restore(type, value, tb);
+#endif
+}
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(type, value, tb);
+#endif
+}
+
+static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
+ PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
+}
+
+static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+ PyErr_Format(PyExc_TypeError,
+ "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
+ name, type->tp_name, Py_TYPE(obj)->tp_name);
+}
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+ const char *name, int exact)
+{
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ if (none_allowed && obj == Py_None) return 1;
+ else if (exact) {
+ if (likely(Py_TYPE(obj) == type)) return 1;
+ #if PY_MAJOR_VERSION == 2
+ else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
+ #endif
+ }
+ else {
+ if (likely(PyObject_TypeCheck(obj, type))) return 1;
+ }
+ __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
+ return 0;
+}
+
+#if PY_MAJOR_VERSION < 3
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
+ CYTHON_UNUSED PyObject *cause) {
+ Py_XINCREF(type);
+ if (!value || value == Py_None)
+ value = NULL;
+ else
+ Py_INCREF(value);
+ if (!tb || tb == Py_None)
+ tb = NULL;
+ else {
+ Py_INCREF(tb);
+ if (!PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto raise_error;
+ }
+ }
+ if (PyType_Check(type)) {
+#if CYTHON_COMPILING_IN_PYPY
+ if (!value) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#endif
+ PyErr_NormalizeException(&type, &value, &tb);
+ } else {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto raise_error;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(type);
+ Py_INCREF(type);
+ if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto raise_error;
+ }
+ }
+ __Pyx_ErrRestore(type, value, tb);
+ return;
+raise_error:
+ Py_XDECREF(value);
+ Py_XDECREF(type);
+ Py_XDECREF(tb);
+ return;
+}
+#else
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
+ PyObject* owned_instance = NULL;
+ if (tb == Py_None) {
+ tb = 0;
+ } else if (tb && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto bad;
+ }
+ if (value == Py_None)
+ value = 0;
+ if (PyExceptionInstance_Check(type)) {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto bad;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(value);
+ } else if (PyExceptionClass_Check(type)) {
+ PyObject *instance_class = NULL;
+ if (value && PyExceptionInstance_Check(value)) {
+ instance_class = (PyObject*) Py_TYPE(value);
+ if (instance_class != type) {
+ if (PyObject_IsSubclass(instance_class, type)) {
+ type = instance_class;
+ } else {
+ instance_class = NULL;
+ }
+ }
+ }
+ if (!instance_class) {
+ PyObject *args;
+ if (!value)
+ args = PyTuple_New(0);
+ else if (PyTuple_Check(value)) {
+ Py_INCREF(value);
+ args = value;
+ } else
+ args = PyTuple_Pack(1, value);
+ if (!args)
+ goto bad;
+ owned_instance = PyObject_Call(type, args, NULL);
+ Py_DECREF(args);
+ if (!owned_instance)
+ goto bad;
+ value = owned_instance;
+ if (!PyExceptionInstance_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "calling %R should have returned an instance of "
+ "BaseException, not %R",
+ type, Py_TYPE(value));
+ goto bad;
+ }
+ }
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto bad;
+ }
+#if PY_VERSION_HEX >= 0x03030000
+ if (cause) {
+#else
+ if (cause && cause != Py_None) {
+#endif
+ PyObject *fixed_cause;
+ if (cause == Py_None) {
+ fixed_cause = NULL;
+ } else if (PyExceptionClass_Check(cause)) {
+ fixed_cause = PyObject_CallObject(cause, NULL);
+ if (fixed_cause == NULL)
+ goto bad;
+ } else if (PyExceptionInstance_Check(cause)) {
+ fixed_cause = cause;
+ Py_INCREF(fixed_cause);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "exception causes must derive from "
+ "BaseException");
+ goto bad;
+ }
+ PyException_SetCause(value, fixed_cause);
+ }
+ PyErr_SetObject(type, value);
+ if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
+ Py_INCREF(tb);
+ PyErr_Restore(tmp_type, tmp_value, tb);
+ Py_XDECREF(tmp_tb);
+#else
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject* tmp_tb = tstate->curexc_traceback;
+ if (tb != tmp_tb) {
+ Py_INCREF(tb);
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_tb);
+ }
+#endif
+ }
+bad:
+ Py_XDECREF(owned_instance);
+ return;
+}
+#endif
+
+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 PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
+ PyObject *method, *result = NULL;
+ method = __Pyx_PyObject_GetAttrStr(obj, method_name);
+ if (unlikely(!method)) goto bad;
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (likely(PyMethod_Check(method))) {
+ PyObject *self = PyMethod_GET_SELF(method);
+ if (likely(self)) {
+ PyObject *function = PyMethod_GET_FUNCTION(method);
+ result = __Pyx_PyObject_CallOneArg(function, self);
+ Py_DECREF(method);
+ return result;
+ }
+ }
+#endif
+ result = __Pyx_PyObject_CallNoArg(method);
+ Py_DECREF(method);
+bad:
+ return result;
+}
+
+static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+}
+
+static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
+ if (t == Py_None) {
+ __Pyx_RaiseNoneNotIterableError();
+ } else if (PyTuple_GET_SIZE(t) < index) {
+ __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
+ } else {
+ __Pyx_RaiseTooManyValuesError(index);
+ }
+}
+
+static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
+ int is_tuple, int has_known_size, int decref_tuple) {
+ Py_ssize_t index;
+ PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
+ if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
+ iternextfunc iternext;
+ iter = PyObject_GetIter(tuple);
+ if (unlikely(!iter)) goto bad;
+ if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
+ iternext = Py_TYPE(iter)->tp_iternext;
+ value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
+ value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
+ if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
+ Py_DECREF(iter);
+ } else {
+ if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
+ __Pyx_UnpackTupleError(tuple, 2);
+ goto bad;
+ }
+#if CYTHON_COMPILING_IN_PYPY
+ value1 = PySequence_ITEM(tuple, 0);
+ if (unlikely(!value1)) goto bad;
+ value2 = PySequence_ITEM(tuple, 1);
+ if (unlikely(!value2)) goto bad;
+#else
+ value1 = PyTuple_GET_ITEM(tuple, 0);
+ value2 = PyTuple_GET_ITEM(tuple, 1);
+ Py_INCREF(value1);
+ Py_INCREF(value2);
+#endif
+ if (decref_tuple) { Py_DECREF(tuple); }
+ }
+ *pvalue1 = value1;
+ *pvalue2 = value2;
+ return 0;
+unpacking_failed:
+ if (!has_known_size && __Pyx_IterFinish() == 0)
+ __Pyx_RaiseNeedMoreValuesError(index);
+bad:
+ Py_XDECREF(iter);
+ Py_XDECREF(value1);
+ Py_XDECREF(value2);
+ if (decref_tuple) { Py_XDECREF(tuple); }
+ return -1;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
+ Py_ssize_t* p_orig_length, int* p_source_is_dict) {
+ is_dict = is_dict || likely(PyDict_CheckExact(iterable));
+ *p_source_is_dict = is_dict;
+#if !CYTHON_COMPILING_IN_PYPY
+ if (is_dict) {
+ *p_orig_length = PyDict_Size(iterable);
+ Py_INCREF(iterable);
+ return iterable;
+ }
+#endif
+ *p_orig_length = 0;
+ if (method_name) {
+ PyObject* iter;
+ iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
+ if (!iterable)
+ return NULL;
+#if !CYTHON_COMPILING_IN_PYPY
+ if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
+ return iterable;
+#endif
+ iter = PyObject_GetIter(iterable);
+ Py_DECREF(iterable);
+ return iter;
+ }
+ return PyObject_GetIter(iterable);
+}
+static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos,
+ PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
+ PyObject* next_item;
+#if !CYTHON_COMPILING_IN_PYPY
+ if (source_is_dict) {
+ PyObject *key, *value;
+ if (unlikely(orig_length != PyDict_Size(iter_obj))) {
+ PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
+ return -1;
+ }
+ if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
+ return 0;
+ }
+ if (pitem) {
+ PyObject* tuple = PyTuple_New(2);
+ if (unlikely(!tuple)) {
+ return -1;
+ }
+ Py_INCREF(key);
+ Py_INCREF(value);
+ PyTuple_SET_ITEM(tuple, 0, key);
+ PyTuple_SET_ITEM(tuple, 1, value);
+ *pitem = tuple;
+ } else {
+ if (pkey) {
+ Py_INCREF(key);
+ *pkey = key;
+ }
+ if (pvalue) {
+ Py_INCREF(value);
+ *pvalue = value;
+ }
+ }
+ return 1;
+ } else if (PyTuple_CheckExact(iter_obj)) {
+ Py_ssize_t pos = *ppos;
+ if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
+ *ppos = pos + 1;
+ next_item = PyTuple_GET_ITEM(iter_obj, pos);
+ Py_INCREF(next_item);
+ } else if (PyList_CheckExact(iter_obj)) {
+ Py_ssize_t pos = *ppos;
+ if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
+ *ppos = pos + 1;
+ next_item = PyList_GET_ITEM(iter_obj, pos);
+ Py_INCREF(next_item);
+ } else
+#endif
+ {
+ next_item = PyIter_Next(iter_obj);
+ if (unlikely(!next_item)) {
+ return __Pyx_IterFinish();
+ }
+ }
+ if (pitem) {
+ *pitem = next_item;
+ } else if (pkey && pvalue) {
+ if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
+ return -1;
+ } else if (pkey) {
+ *pkey = next_item;
+ } else {
+ *pvalue = next_item;
+ }
+ return 1;
+}
+
+static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+ CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
+ int full_traceback) {
+ PyObject *old_exc, *old_val, *old_tb;
+ PyObject *ctx;
+ __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
+ if (full_traceback) {
+ Py_XINCREF(old_exc);
+ Py_XINCREF(old_val);
+ Py_XINCREF(old_tb);
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ PyErr_PrintEx(1);
+ }
+ #if PY_MAJOR_VERSION < 3
+ ctx = PyString_FromString(name);
+ #else
+ ctx = PyUnicode_FromString(name);
+ #endif
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ if (!ctx) {
+ PyErr_WriteUnraisable(Py_None);
+ } else {
+ PyErr_WriteUnraisable(ctx);
+ Py_DECREF(ctx);
+ }
+}
+
+static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
+ PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
+ PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
+ int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyMappingMethods* mp;
+#if PY_MAJOR_VERSION < 3
+ PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
+ if (likely(ms && ms->sq_ass_slice)) {
+ if (!has_cstart) {
+ if (_py_start && (*_py_start != Py_None)) {
+ cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
+ if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
+ } else
+ cstart = 0;
+ }
+ if (!has_cstop) {
+ if (_py_stop && (*_py_stop != Py_None)) {
+ cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
+ if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
+ } else
+ cstop = PY_SSIZE_T_MAX;
+ }
+ if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
+ Py_ssize_t l = ms->sq_length(obj);
+ if (likely(l >= 0)) {
+ if (cstop < 0) {
+ cstop += l;
+ if (cstop < 0) cstop = 0;
+ }
+ if (cstart < 0) {
+ cstart += l;
+ if (cstart < 0) cstart = 0;
+ }
+ } else {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError))
+ PyErr_Clear();
+ else
+ goto bad;
+ }
+ }
+ return ms->sq_ass_slice(obj, cstart, cstop, value);
+ }
+#endif
+ mp = Py_TYPE(obj)->tp_as_mapping;
+ if (likely(mp && mp->mp_ass_subscript))
+#endif
+ {
+ int result;
+ PyObject *py_slice, *py_start, *py_stop;
+ if (_py_slice) {
+ py_slice = *_py_slice;
+ } else {
+ PyObject* owned_start = NULL;
+ PyObject* owned_stop = NULL;
+ if (_py_start) {
+ py_start = *_py_start;
+ } else {
+ if (has_cstart) {
+ owned_start = py_start = PyInt_FromSsize_t(cstart);
+ if (unlikely(!py_start)) goto bad;
+ } else
+ py_start = Py_None;
+ }
+ if (_py_stop) {
+ py_stop = *_py_stop;
+ } else {
+ if (has_cstop) {
+ owned_stop = py_stop = PyInt_FromSsize_t(cstop);
+ if (unlikely(!py_stop)) {
+ Py_XDECREF(owned_start);
+ goto bad;
+ }
+ } else
+ py_stop = Py_None;
+ }
+ py_slice = PySlice_New(py_start, py_stop, Py_None);
+ Py_XDECREF(owned_start);
+ Py_XDECREF(owned_stop);
+ if (unlikely(!py_slice)) goto bad;
+ }
+#if CYTHON_COMPILING_IN_CPYTHON
+ result = mp->mp_ass_subscript(obj, py_slice, value);
+#else
+ result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
+#endif
+ if (!_py_slice) {
+ Py_DECREF(py_slice);
+ }
+ return result;
+ }
+ PyErr_Format(PyExc_TypeError,
+ "'%.200s' object does not support slice %.10s",
+ Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
+bad:
+ return -1;
+}
+
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ if (likely(PyObject_TypeCheck(obj, type)))
+ return 1;
+ PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
+ Py_TYPE(obj)->tp_name, type->tp_name);
+ return 0;
+}
+
+static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+#if CYTHON_COMPILING_IN_PYPY
+ return PyObject_RichCompareBool(s1, s2, equals);
+#else
+ if (s1 == s2) {
+ return (equals == Py_EQ);
+ } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
+ const char *ps1, *ps2;
+ Py_ssize_t length = PyBytes_GET_SIZE(s1);
+ if (length != PyBytes_GET_SIZE(s2))
+ return (equals == Py_NE);
+ ps1 = PyBytes_AS_STRING(s1);
+ ps2 = PyBytes_AS_STRING(s2);
+ if (ps1[0] != ps2[0]) {
+ return (equals == Py_NE);
+ } else if (length == 1) {
+ return (equals == Py_EQ);
+ } else {
+ int result = memcmp(ps1, ps2, (size_t)length);
+ return (equals == Py_EQ) ? (result == 0) : (result != 0);
+ }
+ } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
+ return (equals == Py_NE);
+ } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
+ return (equals == Py_NE);
+ } else {
+ int result;
+ PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
+ if (!py_result)
+ return -1;
+ result = __Pyx_PyObject_IsTrue(py_result);
+ Py_DECREF(py_result);
+ return result;
+ }
+#endif
+}
+
+static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+#if CYTHON_COMPILING_IN_PYPY
+ return PyObject_RichCompareBool(s1, s2, equals);
+#else
+#if PY_MAJOR_VERSION < 3
+ PyObject* owned_ref = NULL;
+#endif
+ int s1_is_unicode, s2_is_unicode;
+ if (s1 == s2) {
+ goto return_eq;
+ }
+ s1_is_unicode = PyUnicode_CheckExact(s1);
+ s2_is_unicode = PyUnicode_CheckExact(s2);
+#if PY_MAJOR_VERSION < 3
+ if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
+ owned_ref = PyUnicode_FromObject(s2);
+ if (unlikely(!owned_ref))
+ return -1;
+ s2 = owned_ref;
+ s2_is_unicode = 1;
+ } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
+ owned_ref = PyUnicode_FromObject(s1);
+ if (unlikely(!owned_ref))
+ return -1;
+ s1 = owned_ref;
+ s1_is_unicode = 1;
+ } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
+ return __Pyx_PyBytes_Equals(s1, s2, equals);
+ }
+#endif
+ if (s1_is_unicode & s2_is_unicode) {
+ Py_ssize_t length;
+ int kind;
+ void *data1, *data2;
+ if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
+ return -1;
+ length = __Pyx_PyUnicode_GET_LENGTH(s1);
+ if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
+ goto return_ne;
+ }
+ kind = __Pyx_PyUnicode_KIND(s1);
+ if (kind != __Pyx_PyUnicode_KIND(s2)) {
+ goto return_ne;
+ }
+ data1 = __Pyx_PyUnicode_DATA(s1);
+ data2 = __Pyx_PyUnicode_DATA(s2);
+ if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
+ goto return_ne;
+ } else if (length == 1) {
+ goto return_eq;
+ } else {
+ int result = memcmp(data1, data2, (size_t)(length * kind));
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_EQ) ? (result == 0) : (result != 0);
+ }
+ } else if ((s1 == Py_None) & s2_is_unicode) {
+ goto return_ne;
+ } else if ((s2 == Py_None) & s1_is_unicode) {
+ goto return_ne;
+ } else {
+ int result;
+ PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
+ if (!py_result)
+ return -1;
+ result = __Pyx_PyObject_IsTrue(py_result);
+ Py_DECREF(py_result);
+ return result;
+ }
+return_eq:
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_EQ);
+return_ne:
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_NE);
+#endif
+}
+
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
+ Py_ssize_t q = a / b;
+ Py_ssize_t r = a - q*b;
+ q -= ((r != 0) & ((r ^ b) < 0));
+ return q;
+}
+
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
+#if CYTHON_COMPILING_IN_CPYTHON
+#if PY_MAJOR_VERSION >= 3
+ if (likely(PyUnicode_Check(n)))
+#else
+ if (likely(PyString_Check(n)))
+#endif
+ return __Pyx_PyObject_GetAttrStr(o, n);
+#endif
+ return PyObject_GetAttr(o, n);
+}
+
+static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+ const char* cstring, Py_ssize_t start, Py_ssize_t stop,
+ const char* encoding, const char* errors,
+ PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
+ Py_ssize_t length;
+ if (unlikely((start < 0) | (stop < 0))) {
+ length = strlen(cstring);
+ if (start < 0) {
+ start += length;
+ if (start < 0)
+ start = 0;
+ }
+ if (stop < 0)
+ stop += length;
+ }
+ length = stop - start;
+ if (unlikely(length <= 0))
+ return PyUnicode_FromUnicode(NULL, 0);
+ cstring += start;
+ if (decode_func) {
+ return decode_func(cstring, length, errors);
+ } else {
+ return PyUnicode_Decode(cstring, length, encoding, errors);
+ }
+}
+
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyThreadState *tstate = PyThreadState_GET();
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = *type;
+ tstate->exc_value = *value;
+ tstate->exc_traceback = *tb;
+#else
+ PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
+ PyErr_SetExcInfo(*type, *value, *tb);
+#endif
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
+
+static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
+ long q = a / b;
+ long r = a - q*b;
+ q -= ((r != 0) & ((r ^ b) < 0));
+ return q;
+}
+
+static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+#if PY_VERSION_HEX >= 0x02070000
+ PyObject *ob = PyCapsule_New(vtable, 0, 0);
+#else
+ PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
+#endif
+ if (!ob)
+ goto bad;
+ if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
+ goto bad;
+ Py_DECREF(ob);
+ return 0;
+bad:
+ Py_XDECREF(ob);
+ return -1;
+}
+
+static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
+ PyObject* fake_module;
+ PyTypeObject* cached_type = NULL;
+ fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
+ if (!fake_module) return NULL;
+ Py_INCREF(fake_module);
+ cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
+ if (cached_type) {
+ if (!PyType_Check((PyObject*)cached_type)) {
+ PyErr_Format(PyExc_TypeError,
+ "Shared Cython type %.200s is not a type object",
+ type->tp_name);
+ goto bad;
+ }
+ if (cached_type->tp_basicsize != type->tp_basicsize) {
+ PyErr_Format(PyExc_TypeError,
+ "Shared Cython type %.200s has the wrong size, try recompiling",
+ type->tp_name);
+ goto bad;
+ }
+ } else {
+ if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
+ PyErr_Clear();
+ if (PyType_Ready(type) < 0) goto bad;
+ if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
+ goto bad;
+ Py_INCREF(type);
+ cached_type = type;
+ }
+done:
+ Py_DECREF(fake_module);
+ return cached_type;
+bad:
+ Py_XDECREF(cached_type);
+ cached_type = NULL;
+ goto done;
+}
+
+static PyObject *
+__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
+{
+ if (unlikely(op->func_doc == NULL)) {
+ if (op->func.m_ml->ml_doc) {
+#if PY_MAJOR_VERSION >= 3
+ op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
+#else
+ op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
+#endif
+ if (unlikely(op->func_doc == NULL))
+ return NULL;
+ } else {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+ }
+ Py_INCREF(op->func_doc);
+ return op->func_doc;
+}
+static int
+__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
+{
+ PyObject *tmp = op->func_doc;
+ if (value == NULL) {
+ value = Py_None;
+ }
+ Py_INCREF(value);
+ op->func_doc = value;
+ Py_XDECREF(tmp);
+ return 0;
+}
+static PyObject *
+__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
+{
+ if (unlikely(op->func_name == NULL)) {
+#if PY_MAJOR_VERSION >= 3
+ op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
+#else
+ op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
+#endif
+ if (unlikely(op->func_name == NULL))
+ return NULL;
+ }
+ Py_INCREF(op->func_name);
+ return op->func_name;
+}
+static int
+__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
+{
+ PyObject *tmp;
+#if PY_MAJOR_VERSION >= 3
+ if (unlikely(value == NULL || !PyUnicode_Check(value))) {
+#else
+ if (unlikely(value == NULL || !PyString_Check(value))) {
+#endif
+ PyErr_SetString(PyExc_TypeError,
+ "__name__ must be set to a string object");
+ return -1;
+ }
+ tmp = op->func_name;
+ Py_INCREF(value);
+ op->func_name = value;
+ Py_XDECREF(tmp);
+ return 0;
+}
+static PyObject *
+__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
+{
+ Py_INCREF(op->func_qualname);
+ return op->func_qualname;
+}
+static int
+__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
+{
+ PyObject *tmp;
+#if PY_MAJOR_VERSION >= 3
+ if (unlikely(value == NULL || !PyUnicode_Check(value))) {
+#else
+ if (unlikely(value == NULL || !PyString_Check(value))) {
+#endif
+ PyErr_SetString(PyExc_TypeError,
+ "__qualname__ must be set to a string object");
+ return -1;
+ }
+ tmp = op->func_qualname;
+ Py_INCREF(value);
+ op->func_qualname = value;
+ Py_XDECREF(tmp);
+ return 0;
+}
+static PyObject *
+__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
+{
+ PyObject *self;
+ self = m->func_closure;
+ if (self == NULL)
+ self = Py_None;
+ Py_INCREF(self);
+ return self;
+}
+static PyObject *
+__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
+{
+ if (unlikely(op->func_dict == NULL)) {
+ op->func_dict = PyDict_New();
+ if (unlikely(op->func_dict == NULL))
+ return NULL;
+ }
+ Py_INCREF(op->func_dict);
+ return op->func_dict;
+}
+static int
+__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
+{
+ PyObject *tmp;
+ if (unlikely(value == NULL)) {
+ PyErr_SetString(PyExc_TypeError,
+ "function's dictionary may not be deleted");
+ return -1;
+ }
+ if (unlikely(!PyDict_Check(value))) {
+ PyErr_SetString(PyExc_TypeError,
+ "setting function's dictionary to a non-dict");
+ return -1;
+ }
+ tmp = op->func_dict;
+ Py_INCREF(value);
+ op->func_dict = value;
+ Py_XDECREF(tmp);
+ return 0;
+}
+static PyObject *
+__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
+{
+ Py_INCREF(op->func_globals);
+ return op->func_globals;
+}
+static PyObject *
+__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
+{
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+static PyObject *
+__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
+{
+ PyObject* result = (op->func_code) ? op->func_code : Py_None;
+ Py_INCREF(result);
+ return result;
+}
+static int
+__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
+ PyObject *res = op->defaults_getter((PyObject *) op);
+ if (unlikely(!res))
+ return -1;
+ op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
+ Py_INCREF(op->defaults_tuple);
+ op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
+ Py_INCREF(op->defaults_kwdict);
+ Py_DECREF(res);
+ return 0;
+}
+static int
+__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
+ PyObject* tmp;
+ if (!value) {
+ value = Py_None;
+ } else if (value != Py_None && !PyTuple_Check(value)) {
+ PyErr_SetString(PyExc_TypeError,
+ "__defaults__ must be set to a tuple object");
+ return -1;
+ }
+ Py_INCREF(value);
+ tmp = op->defaults_tuple;
+ op->defaults_tuple = value;
+ Py_XDECREF(tmp);
+ return 0;
+}
+static PyObject *
+__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
+ PyObject* result = op->defaults_tuple;
+ if (unlikely(!result)) {
+ if (op->defaults_getter) {
+ if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
+ result = op->defaults_tuple;
+ } else {
+ result = Py_None;
+ }
+ }
+ Py_INCREF(result);
+ return result;
+}
+static int
+__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
+ PyObject* tmp;
+ if (!value) {
+ value = Py_None;
+ } else if (value != Py_None && !PyDict_Check(value)) {
+ PyErr_SetString(PyExc_TypeError,
+ "__kwdefaults__ must be set to a dict object");
+ return -1;
+ }
+ Py_INCREF(value);
+ tmp = op->defaults_kwdict;
+ op->defaults_kwdict = value;
+ Py_XDECREF(tmp);
+ return 0;
+}
+static PyObject *
+__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
+ PyObject* result = op->defaults_kwdict;
+ if (unlikely(!result)) {
+ if (op->defaults_getter) {
+ if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
+ result = op->defaults_kwdict;
+ } else {
+ result = Py_None;
+ }
+ }
+ Py_INCREF(result);
+ return result;
+}
+static int
+__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
+ PyObject* tmp;
+ if (!value || value == Py_None) {
+ value = NULL;
+ } else if (!PyDict_Check(value)) {
+ PyErr_SetString(PyExc_TypeError,
+ "__annotations__ must be set to a dict object");
+ return -1;
+ }
+ Py_XINCREF(value);
+ tmp = op->func_annotations;
+ op->func_annotations = value;
+ Py_XDECREF(tmp);
+ return 0;
+}
+static PyObject *
+__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
+ PyObject* result = op->func_annotations;
+ if (unlikely(!result)) {
+ result = PyDict_New();
+ if (unlikely(!result)) return NULL;
+ op->func_annotations = result;
+ }
+ Py_INCREF(result);
+ return result;
+}
+static PyGetSetDef __pyx_CyFunction_getsets[] = {
+ {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
+ {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
+ {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
+ {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
+ {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
+ {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
+ {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
+ {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
+ {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
+ {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
+ {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
+ {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
+ {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
+ {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
+ {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
+ {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
+ {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
+ {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
+ {0, 0, 0, 0, 0}
+};
+#ifndef PY_WRITE_RESTRICTED
+#define PY_WRITE_RESTRICTED WRITE_RESTRICTED
+#endif
+static PyMemberDef __pyx_CyFunction_members[] = {
+ {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
+ {0, 0, 0, 0, 0}
+};
+static PyObject *
+__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
+{
+#if PY_MAJOR_VERSION >= 3
+ return PyUnicode_FromString(m->func.m_ml->ml_name);
+#else
+ return PyString_FromString(m->func.m_ml->ml_name);
+#endif
+}
+static PyMethodDef __pyx_CyFunction_methods[] = {
+ {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
+ {0, 0, 0, 0}
+};
+#if PY_VERSION_HEX < 0x030500A0
+#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
+#else
+#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
+#endif
+static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
+ PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
+ __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
+ if (op == NULL)
+ return NULL;
+ op->flags = flags;
+ __Pyx_CyFunction_weakreflist(op) = NULL;
+ op->func.m_ml = ml;
+ op->func.m_self = (PyObject *) op;
+ Py_XINCREF(closure);
+ op->func_closure = closure;
+ Py_XINCREF(module);
+ op->func.m_module = module;
+ op->func_dict = NULL;
+ op->func_name = NULL;
+ Py_INCREF(qualname);
+ op->func_qualname = qualname;
+ op->func_doc = NULL;
+ op->func_classobj = NULL;
+ op->func_globals = globals;
+ Py_INCREF(op->func_globals);
+ Py_XINCREF(code);
+ op->func_code = code;
+ op->defaults_pyobjects = 0;
+ op->defaults = NULL;
+ op->defaults_tuple = NULL;
+ op->defaults_kwdict = NULL;
+ op->defaults_getter = NULL;
+ op->func_annotations = NULL;
+ PyObject_GC_Track(op);
+ return (PyObject *) op;
+}
+static int
+__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
+{
+ Py_CLEAR(m->func_closure);
+ Py_CLEAR(m->func.m_module);
+ Py_CLEAR(m->func_dict);
+ Py_CLEAR(m->func_name);
+ Py_CLEAR(m->func_qualname);
+ Py_CLEAR(m->func_doc);
+ Py_CLEAR(m->func_globals);
+ Py_CLEAR(m->func_code);
+ Py_CLEAR(m->func_classobj);
+ Py_CLEAR(m->defaults_tuple);
+ Py_CLEAR(m->defaults_kwdict);
+ Py_CLEAR(m->func_annotations);
+ if (m->defaults) {
+ PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
+ int i;
+ for (i = 0; i < m->defaults_pyobjects; i++)
+ Py_XDECREF(pydefaults[i]);
+ PyMem_Free(m->defaults);
+ m->defaults = NULL;
+ }
+ return 0;
+}
+static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
+{
+ PyObject_GC_UnTrack(m);
+ if (__Pyx_CyFunction_weakreflist(m) != NULL)
+ PyObject_ClearWeakRefs((PyObject *) m);
+ __Pyx_CyFunction_clear(m);
+ PyObject_GC_Del(m);
+}
+static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
+{
+ Py_VISIT(m->func_closure);
+ Py_VISIT(m->func.m_module);
+ Py_VISIT(m->func_dict);
+ Py_VISIT(m->func_name);
+ Py_VISIT(m->func_qualname);
+ Py_VISIT(m->func_doc);
+ Py_VISIT(m->func_globals);
+ Py_VISIT(m->func_code);
+ Py_VISIT(m->func_classobj);
+ Py_VISIT(m->defaults_tuple);
+ Py_VISIT(m->defaults_kwdict);
+ if (m->defaults) {
+ PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
+ int i;
+ for (i = 0; i < m->defaults_pyobjects; i++)
+ Py_VISIT(pydefaults[i]);
+ }
+ return 0;
+}
+static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
+{
+ __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
+ if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
+ Py_INCREF(func);
+ return func;
+ }
+ if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
+ if (type == NULL)
+ type = (PyObject *)(Py_TYPE(obj));
+ return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
+ }
+ if (obj == Py_None)
+ obj = NULL;
+ return __Pyx_PyMethod_New(func, obj, type);
+}
+static PyObject*
+__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
+{
+#if PY_MAJOR_VERSION >= 3
+ return PyUnicode_FromFormat("<cyfunction %U at %p>",
+ op->func_qualname, (void *)op);
+#else
+ return PyString_FromFormat("<cyfunction %s at %p>",
+ PyString_AsString(op->func_qualname), (void *)op);
+#endif
+}
+#if CYTHON_COMPILING_IN_PYPY
+static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ PyCFunctionObject* f = (PyCFunctionObject*)func;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ Py_ssize_t size;
+ switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
+ case METH_VARARGS:
+ if (likely(kw == NULL) || PyDict_Size(kw) == 0)
+ return (*meth)(self, arg);
+ break;
+ case METH_VARARGS | METH_KEYWORDS:
+ return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
+ case METH_NOARGS:
+ if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
+ size = PyTuple_GET_SIZE(arg);
+ if (size == 0)
+ return (*meth)(self, NULL);
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes no arguments (%zd given)",
+ f->m_ml->ml_name, size);
+ return NULL;
+ }
+ break;
+ case METH_O:
+ if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
+ size = PyTuple_GET_SIZE(arg);
+ if (size == 1)
+ return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes exactly one argument (%zd given)",
+ f->m_ml->ml_name, size);
+ return NULL;
+ }
+ break;
+ default:
+ PyErr_SetString(PyExc_SystemError, "Bad call flags in "
+ "__Pyx_CyFunction_Call. METH_OLDARGS is no "
+ "longer supported!");
+ return NULL;
+ }
+ PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
+ f->m_ml->ml_name);
+ return NULL;
+}
+#else
+static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ return PyCFunction_Call(func, arg, kw);
+}
+#endif
+static PyTypeObject __pyx_CyFunctionType_type = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "cython_function_or_method",
+ sizeof(__pyx_CyFunctionObject),
+ 0,
+ (destructor) __Pyx_CyFunction_dealloc,
+ 0,
+ 0,
+ 0,
+#if PY_MAJOR_VERSION < 3
+ 0,
+#else
+ 0,
+#endif
+ (reprfunc) __Pyx_CyFunction_repr,
+ 0,
+ 0,
+ 0,
+ 0,
+ __Pyx_CyFunction_Call,
+ 0,
+ 0,
+ 0,
+ 0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
+ 0,
+ (traverseproc) __Pyx_CyFunction_traverse,
+ (inquiry) __Pyx_CyFunction_clear,
+ 0,
+#if PY_VERSION_HEX < 0x030500A0
+ offsetof(__pyx_CyFunctionObject, func_weakreflist),
+#else
+ offsetof(PyCFunctionObject, m_weakreflist),
+#endif
+ 0,
+ 0,
+ __pyx_CyFunction_methods,
+ __pyx_CyFunction_members,
+ __pyx_CyFunction_getsets,
+ 0,
+ 0,
+ __Pyx_CyFunction_descr_get,
+ 0,
+ offsetof(__pyx_CyFunctionObject, func_dict),
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+#if PY_VERSION_HEX >= 0x030400a1
+ 0,
+#endif
+};
+static int __Pyx_CyFunction_init(void) {
+#if !CYTHON_COMPILING_IN_PYPY
+ __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
+#endif
+ __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
+ if (__pyx_CyFunctionType == NULL) {
+ return -1;
+ }
+ return 0;
+}
+static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
+ __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
+ m->defaults = PyMem_Malloc(size);
+ if (!m->defaults)
+ return PyErr_NoMemory();
+ memset(m->defaults, 0, size);
+ m->defaults_pyobjects = pyobjects;
+ return m->defaults;
+}
+static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
+ __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
+ m->defaults_tuple = tuple;
+ Py_INCREF(tuple);
+}
+static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
+ __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
+ m->defaults_kwdict = dict;
+ Py_INCREF(dict);
+}
+static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
+ __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
+ m->func_annotations = dict;
+ Py_INCREF(dict);
+}
+
+static PyObject *
+__pyx_FusedFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags,
+ PyObject *qualname, PyObject *self,
+ PyObject *module, PyObject *globals,
+ PyObject *code)
+{
+ __pyx_FusedFunctionObject *fusedfunc =
+ (__pyx_FusedFunctionObject *) __Pyx_CyFunction_New(type, ml, flags, qualname,
+ self, module, globals, code);
+ if (!fusedfunc)
+ return NULL;
+ fusedfunc->__signatures__ = NULL;
+ fusedfunc->type = NULL;
+ fusedfunc->self = NULL;
+ return (PyObject *) fusedfunc;
+}
+static void __pyx_FusedFunction_dealloc(__pyx_FusedFunctionObject *self) {
+ __pyx_FusedFunction_clear(self);
+ __pyx_FusedFunctionType->tp_free((PyObject *) self);
+}
+static int
+__pyx_FusedFunction_traverse(__pyx_FusedFunctionObject *self,
+ visitproc visit,
+ void *arg)
+{
+ Py_VISIT(self->self);
+ Py_VISIT(self->type);
+ Py_VISIT(self->__signatures__);
+ return __Pyx_CyFunction_traverse((__pyx_CyFunctionObject *) self, visit, arg);
+}
+static int
+__pyx_FusedFunction_clear(__pyx_FusedFunctionObject *self)
+{
+ Py_CLEAR(self->self);
+ Py_CLEAR(self->type);
+ Py_CLEAR(self->__signatures__);
+ return __Pyx_CyFunction_clear((__pyx_CyFunctionObject *) self);
+}
+static PyObject *
+__pyx_FusedFunction_descr_get(PyObject *self, PyObject *obj, PyObject *type)
+{
+ __pyx_FusedFunctionObject *func, *meth;
+ func = (__pyx_FusedFunctionObject *) self;
+ if (func->self || func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD) {
+ Py_INCREF(self);
+ return self;
+ }
+ if (obj == Py_None)
+ obj = NULL;
+ meth = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_NewEx(
+ ((PyCFunctionObject *) func)->m_ml,
+ ((__pyx_CyFunctionObject *) func)->flags,
+ ((__pyx_CyFunctionObject *) func)->func_qualname,
+ ((__pyx_CyFunctionObject *) func)->func_closure,
+ ((PyCFunctionObject *) func)->m_module,
+ ((__pyx_CyFunctionObject *) func)->func_globals,
+ ((__pyx_CyFunctionObject *) func)->func_code);
+ if (!meth)
+ return NULL;
+ Py_XINCREF(func->func.func_classobj);
+ meth->func.func_classobj = func->func.func_classobj;
+ Py_XINCREF(func->__signatures__);
+ meth->__signatures__ = func->__signatures__;
+ Py_XINCREF(type);
+ meth->type = type;
+ Py_XINCREF(func->func.defaults_tuple);
+ meth->func.defaults_tuple = func->func.defaults_tuple;
+ if (func->func.flags & __Pyx_CYFUNCTION_CLASSMETHOD)
+ obj = type;
+ Py_XINCREF(obj);
+ meth->self = obj;
+ return (PyObject *) meth;
+}
+static PyObject *
+_obj_to_str(PyObject *obj)
+{
+ if (PyType_Check(obj))
+ return PyObject_GetAttr(obj, __pyx_n_s_name_2);
+ else
+ return PyObject_Str(obj);
+}
+static PyObject *
+__pyx_FusedFunction_getitem(__pyx_FusedFunctionObject *self, PyObject *idx)
+{
+ PyObject *signature = NULL;
+ PyObject *unbound_result_func;
+ PyObject *result_func = NULL;
+ if (self->__signatures__ == NULL) {
+ PyErr_SetString(PyExc_TypeError, "Function is not fused");
+ return NULL;
+ }
+ if (PyTuple_Check(idx)) {
+ PyObject *list = PyList_New(0);
+ Py_ssize_t n = PyTuple_GET_SIZE(idx);
+ PyObject *string = NULL;
+ PyObject *sep = NULL;
+ int i;
+ if (!list)
+ return NULL;
+ for (i = 0; i < n; i++) {
+ PyObject *item = PyTuple_GET_ITEM(idx, i);
+ string = _obj_to_str(item);
+ if (!string || PyList_Append(list, string) < 0)
+ goto __pyx_err;
+ Py_DECREF(string);
+ }
+ sep = PyUnicode_FromString("|");
+ if (sep)
+ signature = PyUnicode_Join(sep, list);
+__pyx_err:
+;
+ Py_DECREF(list);
+ Py_XDECREF(sep);
+ } else {
+ signature = _obj_to_str(idx);
+ }
+ if (!signature)
+ return NULL;
+ unbound_result_func = PyObject_GetItem(self->__signatures__, signature);
+ if (unbound_result_func) {
+ if (self->self || self->type) {
+ __pyx_FusedFunctionObject *unbound = (__pyx_FusedFunctionObject *) unbound_result_func;
+ Py_CLEAR(unbound->func.func_classobj);
+ Py_XINCREF(self->func.func_classobj);
+ unbound->func.func_classobj = self->func.func_classobj;
+ result_func = __pyx_FusedFunction_descr_get(unbound_result_func,
+ self->self, self->type);
+ } else {
+ result_func = unbound_result_func;
+ Py_INCREF(result_func);
+ }
+ }
+ Py_DECREF(signature);
+ Py_XDECREF(unbound_result_func);
+ return result_func;
+}
+static PyObject *
+__pyx_FusedFunction_callfunction(PyObject *func, PyObject *args, PyObject *kw)
+{
+ __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
+ PyObject *result;
+ int static_specialized = (cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD &&
+ !((__pyx_FusedFunctionObject *) func)->__signatures__);
+ if (cyfunc->flags & __Pyx_CYFUNCTION_CCLASS && !static_specialized) {
+ Py_ssize_t argc;
+ PyObject *new_args;
+ PyObject *self;
+ PyObject *m_self;
+ argc = PyTuple_GET_SIZE(args);
+ new_args = PyTuple_GetSlice(args, 1, argc);
+ if (!new_args)
+ return NULL;
+ self = PyTuple_GetItem(args, 0);
+ if (!self)
+ return NULL;
+ m_self = cyfunc->func.m_self;
+ cyfunc->func.m_self = self;
+ result = __Pyx_CyFunction_Call(func, new_args, kw);
+ cyfunc->func.m_self = m_self;
+ Py_DECREF(new_args);
+ } else {
+ result = __Pyx_CyFunction_Call(func, args, kw);
+ }
+ return result;
+}
+static PyObject *
+__pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
+{
+ __pyx_FusedFunctionObject *binding_func = (__pyx_FusedFunctionObject *) func;
+ Py_ssize_t argc = PyTuple_GET_SIZE(args);
+ PyObject *new_args = NULL;
+ __pyx_FusedFunctionObject *new_func = NULL;
+ PyObject *result = NULL;
+ PyObject *self = NULL;
+ int is_staticmethod = binding_func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD;
+ int is_classmethod = binding_func->func.flags & __Pyx_CYFUNCTION_CLASSMETHOD;
+ if (binding_func->self) {
+ Py_ssize_t i;
+ new_args = PyTuple_New(argc + 1);
+ if (!new_args)
+ return NULL;
+ self = binding_func->self;
+ Py_INCREF(self);
+ PyTuple_SET_ITEM(new_args, 0, self);
+ for (i = 0; i < argc; i++) {
+ PyObject *item = PyTuple_GET_ITEM(args, i);
+ Py_INCREF(item);
+ PyTuple_SET_ITEM(new_args, i + 1, item);
+ }
+ args = new_args;
+ } else if (binding_func->type) {
+ if (argc < 1) {
+ PyErr_SetString(PyExc_TypeError, "Need at least one argument, 0 given.");
+ return NULL;
+ }
+ self = PyTuple_GET_ITEM(args, 0);
+ }
+ if (self && !is_classmethod && !is_staticmethod &&
+ !PyObject_IsInstance(self, binding_func->type)) {
+ PyErr_Format(PyExc_TypeError,
+ "First argument should be of type %.200s, got %.200s.",
+ ((PyTypeObject *) binding_func->type)->tp_name,
+ self->ob_type->tp_name);
+ goto __pyx_err;
+ }
+ if (binding_func->__signatures__) {
+ PyObject *tup = PyTuple_Pack(4, binding_func->__signatures__, args,
+ kw == NULL ? Py_None : kw,
+ binding_func->func.defaults_tuple);
+ if (!tup)
+ goto __pyx_err;
+ new_func = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_callfunction(func, tup, NULL);
+ Py_DECREF(tup);
+ if (!new_func)
+ goto __pyx_err;
+ Py_XINCREF(binding_func->func.func_classobj);
+ Py_CLEAR(new_func->func.func_classobj);
+ new_func->func.func_classobj = binding_func->func.func_classobj;
+ func = (PyObject *) new_func;
+ }
+ result = __pyx_FusedFunction_callfunction(func, args, kw);
+__pyx_err:
+ Py_XDECREF(new_args);
+ Py_XDECREF((PyObject *) new_func);
+ return result;
+}
+static PyMemberDef __pyx_FusedFunction_members[] = {
+ {(char *) "__signatures__",
+ T_OBJECT,
+ offsetof(__pyx_FusedFunctionObject, __signatures__),
+ READONLY,
+ 0},
+ {0, 0, 0, 0, 0},
+};
+static PyMappingMethods __pyx_FusedFunction_mapping_methods = {
+ 0,
+ (binaryfunc) __pyx_FusedFunction_getitem,
+ 0,
+};
+static PyTypeObject __pyx_FusedFunctionType_type = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "fused_cython_function",
+ sizeof(__pyx_FusedFunctionObject),
+ 0,
+ (destructor) __pyx_FusedFunction_dealloc,
+ 0,
+ 0,
+ 0,
+#if PY_MAJOR_VERSION < 3
+ 0,
+#else
+ 0,
+#endif
+ 0,
+ 0,
+ 0,
+ &__pyx_FusedFunction_mapping_methods,
+ 0,
+ (ternaryfunc) __pyx_FusedFunction_call,
+ 0,
+ 0,
+ 0,
+ 0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
+ 0,
+ (traverseproc) __pyx_FusedFunction_traverse,
+ (inquiry) __pyx_FusedFunction_clear,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ __pyx_FusedFunction_members,
+ __pyx_CyFunction_getsets,
+ &__pyx_CyFunctionType_type,
+ 0,
+ __pyx_FusedFunction_descr_get,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+#if PY_VERSION_HEX >= 0x030400a1
+ 0,
+#endif
+};
+static int __pyx_FusedFunction_init(void) {
+ __pyx_FusedFunctionType = __Pyx_FetchCommonType(&__pyx_FusedFunctionType_type);
+ if (__pyx_FusedFunctionType == NULL) {
+ return -1;
+ }
+ 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 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);
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint32(npy_uint32 value) {
+ const npy_uint32 neg_one = (npy_uint32) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(npy_uint32) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(npy_uint32) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(npy_uint32) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(npy_uint32) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(npy_uint32) <= 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(npy_uint32),
+ little, !is_unsigned);
+ }
+}
+
+static int
+__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
+{
+ int i;
+ if (!a || !b)
+ return 0;
+ if (a == b)
+ return 1;
+ if (a->size != b->size || a->typegroup != b->typegroup ||
+ a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
+ if (a->typegroup == 'H' || b->typegroup == 'H') {
+ return a->size == b->size;
+ } else {
+ return 0;
+ }
+ }
+ if (a->ndim) {
+ for (i = 0; i < a->ndim; i++)
+ if (a->arraysize[i] != b->arraysize[i])
+ return 0;
+ }
+ if (a->typegroup == 'S') {
+ if (a->flags != b->flags)
+ return 0;
+ if (a->fields || b->fields) {
+ if (!(a->fields && b->fields))
+ return 0;
+ for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
+ __Pyx_StructField *field_a = a->fields + i;
+ __Pyx_StructField *field_b = b->fields + i;
+ if (field_a->offset != field_b->offset ||
+ !__pyx_typeinfo_cmp(field_a->type, field_b->type))
+ return 0;
+ }
+ return !a->fields[i].type && !b->fields[i].type;
+ }
+ }
+ return 1;
+}
+
+static int
+__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
+{
+ if (buf->shape[dim] <= 1)
+ return 1;
+ if (buf->strides) {
+ if (spec & __Pyx_MEMVIEW_CONTIG) {
+ if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
+ if (buf->strides[dim] != sizeof(void *)) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer is not indirectly contiguous "
+ "in dimension %d.", dim);
+ goto fail;
+ }
+ } else if (buf->strides[dim] != buf->itemsize) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer and memoryview are not contiguous "
+ "in the same dimension.");
+ goto fail;
+ }
+ }
+ if (spec & __Pyx_MEMVIEW_FOLLOW) {
+ Py_ssize_t stride = buf->strides[dim];
+ if (stride < 0)
+ stride = -stride;
+ if (stride < buf->itemsize) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer and memoryview are not contiguous "
+ "in the same dimension.");
+ goto fail;
+ }
+ }
+ } else {
+ if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
+ PyErr_Format(PyExc_ValueError,
+ "C-contiguous buffer is not contiguous in "
+ "dimension %d", dim);
+ goto fail;
+ } else if (spec & (__Pyx_MEMVIEW_PTR)) {
+ PyErr_Format(PyExc_ValueError,
+ "C-contiguous buffer is not indirect in "
+ "dimension %d", dim);
+ goto fail;
+ } else if (buf->suboffsets) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer exposes suboffsets but no strides");
+ goto fail;
+ }
+ }
+ return 1;
+fail:
+ return 0;
+}
+static int
+__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
+{
+ if (spec & __Pyx_MEMVIEW_DIRECT) {
+ if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer not compatible with direct access "
+ "in dimension %d.", dim);
+ goto fail;
+ }
+ }
+ if (spec & __Pyx_MEMVIEW_PTR) {
+ if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer is not indirectly accessible "
+ "in dimension %d.", dim);
+ goto fail;
+ }
+ }
+ return 1;
+fail:
+ return 0;
+}
+static int
+__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
+{
+ int i;
+ if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
+ Py_ssize_t stride = 1;
+ for (i = 0; i < ndim; i++) {
+ if (stride * buf->itemsize != buf->strides[i] &&
+ buf->shape[i] > 1)
+ {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer not fortran contiguous.");
+ goto fail;
+ }
+ stride = stride * buf->shape[i];
+ }
+ } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
+ Py_ssize_t stride = 1;
+ for (i = ndim - 1; i >- 1; i--) {
+ if (stride * buf->itemsize != buf->strides[i] &&
+ buf->shape[i] > 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer not C contiguous.");
+ goto fail;
+ }
+ stride = stride * buf->shape[i];
+ }
+ }
+ return 1;
+fail:
+ return 0;
+}
+static int __Pyx_ValidateAndInit_memviewslice(
+ int *axes_specs,
+ int c_or_f_flag,
+ int buf_flags,
+ int ndim,
+ __Pyx_TypeInfo *dtype,
+ __Pyx_BufFmt_StackElem stack[],
+ __Pyx_memviewslice *memviewslice,
+ PyObject *original_obj)
+{
+ struct __pyx_memoryview_obj *memview, *new_memview;
+ __Pyx_RefNannyDeclarations
+ Py_buffer *buf;
+ int i, spec = 0, retval = -1;
+ __Pyx_BufFmt_Context ctx;
+ int from_memoryview = __pyx_memoryview_check(original_obj);
+ __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
+ if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
+ original_obj)->typeinfo)) {
+ memview = (struct __pyx_memoryview_obj *) original_obj;
+ new_memview = NULL;
+ } else {
+ memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
+ original_obj, buf_flags, 0, dtype);
+ new_memview = memview;
+ if (unlikely(!memview))
+ goto fail;
+ }
+ buf = &memview->view;
+ if (buf->ndim != ndim) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer has wrong number of dimensions (expected %d, got %d)",
+ ndim, buf->ndim);
+ goto fail;
+ }
+ if (new_memview) {
+ __Pyx_BufFmt_Init(&ctx, stack, dtype);
+ if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
+ }
+ if ((unsigned) buf->itemsize != dtype->size) {
+ PyErr_Format(PyExc_ValueError,
+ "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
+ "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
+ buf->itemsize,
+ (buf->itemsize > 1) ? "s" : "",
+ dtype->name,
+ dtype->size,
+ (dtype->size > 1) ? "s" : "");
+ goto fail;
+ }
+ for (i = 0; i < ndim; i++) {
+ spec = axes_specs[i];
+ if (!__pyx_check_strides(buf, i, ndim, spec))
+ goto fail;
+ if (!__pyx_check_suboffsets(buf, i, ndim, spec))
+ goto fail;
+ }
+ if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
+ goto fail;
+ if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
+ new_memview != NULL) == -1)) {
+ goto fail;
+ }
+ retval = 0;
+ goto no_fail;
+fail:
+ Py_XDECREF(new_memview);
+ retval = -1;
+no_fail:
+ __Pyx_RefNannyFinishContext();
+ return retval;
+}
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int8_t(PyObject *obj) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
+ (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 1,
+ &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int16_t(PyObject *obj) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
+ (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 1,
+ &__Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(PyObject *obj) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
+ (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 1,
+ &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(PyObject *obj) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
+ (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 1,
+ &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+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;
+}
+
+#if PY_MAJOR_VERSION < 3
+static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
+ if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
+ if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
+ if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
+ if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
+ 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;
+ if (!obj) return;
+ if (PyObject_CheckBuffer(obj)) {
+ PyBuffer_Release(view);
+ return;
+ }
+ if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
+ Py_DECREF(obj);
+ view->obj = NULL;
+}
+#endif
+
+
+ #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 npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *x) {
+ const npy_uint32 neg_one = (npy_uint32) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(npy_uint32) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (npy_uint32) 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(npy_uint32, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(npy_uint32) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(npy_uint32) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(npy_uint32, 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(npy_uint32, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(npy_uint32, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(npy_uint32) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyLong_AsLong(x))
+ } else if (sizeof(npy_uint32) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(npy_uint32, 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
+ npy_uint32 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 (npy_uint32) -1;
+ }
+ } else {
+ npy_uint32 val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (npy_uint32) -1;
+ val = __Pyx_PyInt_As_npy_uint32(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to npy_uint32");
+ return (npy_uint32) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to npy_uint32");
+ return (npy_uint32) -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;
+}
+
+static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) {
+ const npy_uint8 neg_one = (npy_uint8) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(npy_uint8) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (npy_uint8) 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(npy_uint8, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(npy_uint8) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(npy_uint8) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(npy_uint8, 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(npy_uint8, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(npy_uint8, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(npy_uint8) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyLong_AsLong(x))
+ } else if (sizeof(npy_uint8) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(npy_uint8, 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
+ npy_uint8 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 (npy_uint8) -1;
+ }
+ } else {
+ npy_uint8 val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (npy_uint8) -1;
+ val = __Pyx_PyInt_As_npy_uint8(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to npy_uint8");
+ return (npy_uint8) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to npy_uint8");
+ return (npy_uint8) -1;
+}
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(PyObject *obj) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
+ (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 1,
+ &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+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);
+ }
+}
+
+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 PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
+ const npy_int32 neg_one = (npy_int32) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(npy_int32) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(npy_int32) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(npy_int32) <= 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(npy_int32),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
+ const npy_int32 neg_one = (npy_int32) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(npy_int32) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (npy_int32) 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(npy_int32, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(npy_int32) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(npy_int32) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, 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(npy_int32, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(npy_int32) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, long, PyLong_AsLong(x))
+ } else if (sizeof(npy_int32) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, 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
+ npy_int32 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 (npy_int32) -1;
+ }
+ } else {
+ npy_int32 val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (npy_int32) -1;
+ val = __Pyx_PyInt_As_npy_int32(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to npy_int32");
+ return (npy_int32) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to npy_int32");
+ return (npy_int32) -1;
+}
+
+static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int32_t(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_npy_int32(*(__pyx_t_5numpy_int32_t *) itemp);
+}
+static int __pyx_memview_set_nn___pyx_t_5numpy_int32_t(const char *itemp, PyObject *obj) {
+ __pyx_t_5numpy_int32_t value = __Pyx_PyInt_As_npy_int32(obj);
+ if ((value == (npy_int32)-1) && PyErr_Occurred())
+ return 0;
+ *(__pyx_t_5numpy_int32_t *) itemp = value;
+ return 1;
+}
+
+static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint32_t(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_npy_uint32(*(__pyx_t_5numpy_uint32_t *) itemp);
+}
+static int __pyx_memview_set_nn___pyx_t_5numpy_uint32_t(const char *itemp, PyObject *obj) {
+ __pyx_t_5numpy_uint32_t value = __Pyx_PyInt_As_npy_uint32(obj);
+ if ((value == (npy_uint32)-1) && PyErr_Occurred())
+ return 0;
+ *(__pyx_t_5numpy_uint32_t *) itemp = value;
+ return 1;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int16(npy_int16 value) {
+ const npy_int16 neg_one = (npy_int16) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(npy_int16) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(npy_int16) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(npy_int16) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(npy_int16) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(npy_int16) <= 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(npy_int16),
+ little, !is_unsigned);
+ }
+}
+
+static CYTHON_INLINE npy_int16 __Pyx_PyInt_As_npy_int16(PyObject *x) {
+ const npy_int16 neg_one = (npy_int16) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(npy_int16) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int16, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (npy_int16) 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(npy_int16, digit, ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+ if (sizeof(npy_int16) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int16, unsigned long, PyLong_AsUnsignedLong(x))
+ } else if (sizeof(npy_int16) <= sizeof(unsigned long long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int16, 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(npy_int16, digit, +(((PyLongObject*)x)->ob_digit[0]));
+ case -1: __PYX_VERIFY_RETURN_INT(npy_int16, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ }
+ #endif
+#endif
+ if (sizeof(npy_int16) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int16, long, PyLong_AsLong(x))
+ } else if (sizeof(npy_int16) <= sizeof(long long)) {
+ __PYX_VERIFY_RETURN_INT(npy_int16, 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
+ npy_int16 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 (npy_int16) -1;
+ }
+ } else {
+ npy_int16 val;
+ PyObject *tmp = __Pyx_PyNumber_Int(x);
+ if (!tmp) return (npy_int16) -1;
+ val = __Pyx_PyInt_As_npy_int16(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to npy_int16");
+ return (npy_int16) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to npy_int16");
+ return (npy_int16) -1;
+}
+
+static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int16_t(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_npy_int16(*(__pyx_t_5numpy_int16_t *) itemp);
+}
+static int __pyx_memview_set_nn___pyx_t_5numpy_int16_t(const char *itemp, PyObject *obj) {
+ __pyx_t_5numpy_int16_t value = __Pyx_PyInt_As_npy_int16(obj);
+ if ((value == (npy_int16)-1) && PyErr_Occurred())
+ return 0;
+ *(__pyx_t_5numpy_int16_t *) itemp = value;
+ return 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;
+}
+
+static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character) {
+ const Py_ssize_t length = PyBytes_GET_SIZE(bytes);
+ char* char_start = PyBytes_AS_STRING(bytes);
+ char* pos;
+ for (pos=char_start; pos < char_start+length; pos++) {
+ if (character == pos[0]) return 1;
+ }
+ return 0;
+}
+
+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_npy_uint8(npy_uint8 value) {
+ const npy_uint8 neg_one = (npy_uint8) -1, const_zero = 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(npy_uint8) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(npy_uint8) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+ } else if (sizeof(npy_uint8) <= sizeof(unsigned long long)) {
+ return PyLong_FromUnsignedLongLong((unsigned long long) value);
+ }
+ } else {
+ if (sizeof(npy_uint8) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(npy_uint8) <= 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(npy_uint8),
+ little, !is_unsigned);
+ }
+}
+
+static PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_npy_uint8(*(__pyx_t_5numpy_uint8_t *) itemp);
+}
+static int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj) {
+ __pyx_t_5numpy_uint8_t value = __Pyx_PyInt_As_npy_uint8(obj);
+ if ((value == (npy_uint8)-1) && PyErr_Occurred())
+ return 0;
+ *(__pyx_t_5numpy_uint8_t *) itemp = value;
+ return 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;
+ }
+#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;
+ z.real = a.real + b.real;
+ z.imag = a.imag + b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ z.real = a.real - b.real;
+ z.imag = a.imag - b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ z.real = a.real * b.real - a.imag * b.imag;
+ z.imag = a.real * b.imag + a.imag * b.real;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ float denom = b.real * b.real + b.imag * b.imag;
+ z.real = (a.real * b.real + a.imag * b.imag) / denom;
+ z.imag = (a.imag * b.real - a.real * b.imag) / denom;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
+ __pyx_t_float_complex z;
+ z.real = -a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
+ return (a.real == 0) && (a.imag == 0);
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
+ __pyx_t_float_complex z;
+ z.real = a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ #if 1
+ static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
+ #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
+ return sqrtf(z.real*z.real + z.imag*z.imag);
+ #else
+ return hypotf(z.real, z.imag);
+ #endif
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ float r, lnr, theta, z_r, z_theta;
+ if (b.imag == 0 && b.real == (int)b.real) {
+ if (b.real < 0) {
+ float denom = a.real * a.real + a.imag * a.imag;
+ a.real = a.real / denom;
+ a.imag = -a.imag / denom;
+ b.real = -b.real;
+ }
+ switch ((int)b.real) {
+ case 0:
+ z.real = 1;
+ z.imag = 0;
+ return z;
+ case 1:
+ return a;
+ case 2:
+ z = __Pyx_c_prodf(a, a);
+ return __Pyx_c_prodf(a, a);
+ case 3:
+ z = __Pyx_c_prodf(a, a);
+ return __Pyx_c_prodf(z, a);
+ case 4:
+ z = __Pyx_c_prodf(a, a);
+ return __Pyx_c_prodf(z, z);
+ }
+ }
+ if (a.imag == 0) {
+ if (a.real == 0) {
+ return a;
+ }
+ r = a.real;
+ theta = 0;
+ } else {
+ r = __Pyx_c_absf(a);
+ theta = atan2f(a.imag, a.real);
+ }
+ lnr = logf(r);
+ z_r = expf(lnr * b.real - theta * b.imag);
+ z_theta = theta * b.real + lnr * b.imag;
+ z.real = z_r * cosf(z_theta);
+ z.imag = z_r * sinf(z_theta);
+ return z;
+ }
+ #endif
+#endif
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ return ::std::complex< double >(x, y);
+ }
+ #else
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ return x + y*(__pyx_t_double_complex)_Complex_I;
+ }
+ #endif
+#else
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ __pyx_t_double_complex z;
+ z.real = x;
+ z.imag = y;
+ return z;
+ }
+#endif
+
+#if CYTHON_CCOMPLEX
+#else
+ static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ return (a.real == b.real) && (a.imag == b.imag);
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real + b.real;
+ z.imag = a.imag + b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real - b.real;
+ z.imag = a.imag - b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real * b.real - a.imag * b.imag;
+ z.imag = a.real * b.imag + a.imag * b.real;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ double denom = b.real * b.real + b.imag * b.imag;
+ z.real = (a.real * b.real + a.imag * b.imag) / denom;
+ z.imag = (a.imag * b.real - a.real * b.imag) / denom;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
+ __pyx_t_double_complex z;
+ z.real = -a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
+ return (a.real == 0) && (a.imag == 0);
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
+ __pyx_t_double_complex z;
+ z.real = a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ #if 1
+ static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
+ #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
+ return sqrt(z.real*z.real + z.imag*z.imag);
+ #else
+ return hypot(z.real, z.imag);
+ #endif
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ double r, lnr, theta, z_r, z_theta;
+ if (b.imag == 0 && b.real == (int)b.real) {
+ if (b.real < 0) {
+ double denom = a.real * a.real + a.imag * a.imag;
+ a.real = a.real / denom;
+ a.imag = -a.imag / denom;
+ b.real = -b.real;
+ }
+ switch ((int)b.real) {
+ case 0:
+ z.real = 1;
+ z.imag = 0;
+ return z;
+ case 1:
+ 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 int
+__pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
+ char order, int ndim)
+{
+ int i, index, step, start;
+ Py_ssize_t itemsize = mvs->memview->view.itemsize;
+ if (order == 'F') {
+ step = 1;
+ start = 0;
+ } else {
+ step = -1;
+ start = ndim - 1;
+ }
+ for (i = 0; i < ndim; i++) {
+ index = start + step * i;
+ if (mvs->suboffsets[index] >= 0 || mvs->strides[index] != itemsize)
+ return 0;
+ itemsize *= mvs->shape[index];
+ }
+ return 1;
+}
+
+static void
+__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
+ void **out_start, void **out_end,
+ int ndim, size_t itemsize)
+{
+ char *start, *end;
+ int i;
+ start = end = slice->data;
+ for (i = 0; i < ndim; i++) {
+ Py_ssize_t stride = slice->strides[i];
+ Py_ssize_t extent = slice->shape[i];
+ if (extent == 0) {
+ *out_start = *out_end = start;
+ return;
+ } else {
+ if (stride > 0)
+ end += stride * (extent - 1);
+ else
+ start += stride * (extent - 1);
+ }
+ }
+ *out_start = start;
+ *out_end = end + itemsize;
+}
+static int
+__pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize)
+{
+ void *start1, *end1, *start2, *end2;
+ __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
+ __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
+ return (start1 < end2) && (start2 < end1);
+}
+
+static __Pyx_memviewslice
+__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
+ const char *mode, int ndim,
+ size_t sizeof_dtype, int contig_flag,
+ int dtype_is_object)
+{
+ __Pyx_RefNannyDeclarations
+ int i;
+ __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
+ struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
+ Py_buffer *buf = &from_memview->view;
+ PyObject *shape_tuple = NULL;
+ PyObject *temp_int = NULL;
+ struct __pyx_array_obj *array_obj = NULL;
+ struct __pyx_memoryview_obj *memview_obj = NULL;
+ __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
+ for (i = 0; i < ndim; i++) {
+ if (from_mvs->suboffsets[i] >= 0) {
+ PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
+ "indirect dimensions (axis %d)", i);
+ goto fail;
+ }
+ }
+ shape_tuple = PyTuple_New(ndim);
+ if (unlikely(!shape_tuple)) {
+ goto fail;
+ }
+ __Pyx_GOTREF(shape_tuple);
+ for(i = 0; i < ndim; i++) {
+ temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
+ if(unlikely(!temp_int)) {
+ goto fail;
+ } else {
+ PyTuple_SET_ITEM(shape_tuple, i, temp_int);
+ temp_int = NULL;
+ }
+ }
+ array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
+ if (unlikely(!array_obj)) {
+ goto fail;
+ }
+ __Pyx_GOTREF(array_obj);
+ memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
+ (PyObject *) array_obj, contig_flag,
+ dtype_is_object,
+ from_mvs->memview->typeinfo);
+ if (unlikely(!memview_obj))
+ goto fail;
+ if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
+ goto fail;
+ if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
+ dtype_is_object) < 0))
+ goto fail;
+ goto no_fail;
+fail:
+ __Pyx_XDECREF(new_mvs.memview);
+ new_mvs.memview = NULL;
+ new_mvs.data = NULL;
+no_fail:
+ __Pyx_XDECREF(shape_tuple);
+ __Pyx_XDECREF(temp_int);
+ __Pyx_XDECREF(array_obj);
+ __Pyx_RefNannyFinishContext();
+ return new_mvs;
+}
+
+static CYTHON_INLINE PyObject *
+__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
+{
+ PyObject *cobj;
+#if PY_VERSION_HEX >= 0x02070000
+ cobj = PyCapsule_New(p, sig, NULL);
+#else
+ cobj = PyCObject_FromVoidPtr(p, NULL);
+#endif
+ return cobj;
+}
+
+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
+ 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
+ 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;
+}
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_uint32_t(PyObject *obj) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
+ (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 2,
+ &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint32_t, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int32_t(PyObject *obj) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
+ (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 2,
+ &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint32_t(PyObject *obj) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
+ (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 1,
+ &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint32_t, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+static int __Pyx_check_binary_version(void) {
+ char ctversion[4], rtversion[4];
+ PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
+ if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
+ char message[200];
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+#ifndef __PYX_HAVE_RT_ImportModule
+#define __PYX_HAVE_RT_ImportModule
+static PyObject *__Pyx_ImportModule(const char *name) {
+ PyObject *py_name = 0;
+ PyObject *py_module = 0;
+ py_name = __Pyx_PyIdentifier_FromString(name);
+ if (!py_name)
+ goto bad;
+ py_module = PyImport_Import(py_name);
+ Py_DECREF(py_name);
+ return py_module;
+bad:
+ Py_XDECREF(py_name);
+ return 0;
+}
+#endif
+
+#ifndef __PYX_HAVE_RT_ImportType
+#define __PYX_HAVE_RT_ImportType
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
+ size_t size, int strict)
+{
+ PyObject *py_module = 0;
+ PyObject *result = 0;
+ PyObject *py_name = 0;
+ char warning[200];
+ Py_ssize_t basicsize;
+#ifdef Py_LIMITED_API
+ PyObject *py_basicsize;
+#endif
+ py_module = __Pyx_ImportModule(module_name);
+ if (!py_module)
+ goto bad;
+ py_name = __Pyx_PyIdentifier_FromString(class_name);
+ if (!py_name)
+ goto bad;
+ result = PyObject_GetAttr(py_module, py_name);
+ Py_DECREF(py_name);
+ py_name = 0;
+ Py_DECREF(py_module);
+ py_module = 0;
+ if (!result)
+ goto bad;
+ if (!PyType_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.%.200s is not a type object",
+ module_name, class_name);
+ goto bad;
+ }
+#ifndef Py_LIMITED_API
+ basicsize = ((PyTypeObject *)result)->tp_basicsize;
+#else
+ py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
+ if (!py_basicsize)
+ goto bad;
+ basicsize = PyLong_AsSsize_t(py_basicsize);
+ Py_DECREF(py_basicsize);
+ py_basicsize = 0;
+ if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
+ goto bad;
+#endif
+ if (!strict && (size_t)basicsize > size) {
+ PyOS_snprintf(warning, sizeof(warning),
+ "%s.%s size changed, may indicate binary incompatibility",
+ module_name, class_name);
+ if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
+ }
+ else if ((size_t)basicsize != size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s has the wrong size, try recompiling",
+ module_name, class_name);
+ goto bad;
+ }
+ return (PyTypeObject *)result;
+bad:
+ Py_XDECREF(py_module);
+ Py_XDECREF(result);
+ return NULL;
+}
+#endif
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __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;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+ PyNumberMethods *m;
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (PyInt_Check(x) || PyLong_Check(x))
+#else
+ if (PyLong_Check(x))
+#endif
+ return Py_INCREF(x), x;
+ m = Py_TYPE(x)->tp_as_number;
+#if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = PyNumber_Long(x);
+ }
+#else
+ if (m && m->nb_int) {
+ name = "int";
+ res = PyNumber_Long(x);
+ }
+#endif
+ if (res) {
+#if PY_MAJOR_VERSION < 3
+ if (!PyInt_Check(res) && !PyLong_Check(res)) {
+#else
+ if (!PyLong_Check(res)) {
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ name, name, Py_TYPE(res)->tp_name);
+ Py_DECREF(res);
+ return NULL;
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b)))
+ 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) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/fabio/ext/mar345_IO.pyx b/fabio/ext/mar345_IO.pyx
new file mode 100644
index 0000000..c060da2
--- /dev/null
+++ b/fabio/ext/mar345_IO.pyx
@@ -0,0 +1,715 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/kif/fabio
+#
+# Copyright (C) 2015 European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+"""
+New Cython version of mar345_IO for preparing the migration to Python3
+
+Compressor & decompressor for "pack" algorithm by JPA, binding to CCP4 libraries
+those libraries are re-implemented in Cython.
+
+Known bugs:
+-----------
+
+The precomp/postdec part need to be performed operation in int16 and exports
+uint16. Some calculation are overflowing, this is needed to reproduce the
+original implementation which is buggy
+
+"""
+
+__authors__ = ["Jerome Kieffer", "Gael Goret", "Thomas Vincent"]
+__contact__ = "jerome.kieffer@esrf.eu"
+__license__ = "MIT"
+__copyright__ = "2012-2016, European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "11/08/2017"
+
+import cython
+cimport numpy as cnp
+
+import numpy
+import os
+import tempfile
+import logging
+logger = logging.getLogger(__name__)
+
+
+ctypedef fused any_int_t:
+ cnp.int8_t
+ cnp.int16_t
+ cnp.int32_t
+ cnp.int64_t
+
+# Few constants:
+cdef:
+ cnp.uint8_t *CCP4_PCK_BIT_COUNT = [0, 4, 5, 6, 7, 8, 16, 32]
+ cnp.uint8_t *CCP4_BITSIZE = [0, 0, 0, 0, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0,
+ 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7]
+ int CCP4_PCK_BLOCK_HEADER_LENGTH = 6
+
+
+cdef extern from "ccp4_pack.h":
+ void* mar345_read_data_string(char *instream, int ocount, int dim1, int dim2) nogil
+ void pack_wordimage_c(short int*, int , int , char*) nogil
+ void* ccp4_unpack_string (void *, void *, size_t, size_t, size_t) nogil
+ void* ccp4_unpack_v2_string(void *, void *, size_t, size_t, size_t) nogil
+cdef int PACK_SIZE_HIGH = 8
+
+
+@cython.boundscheck(False)
+def compress_pck(image not None, bint use_CCP4=False):
+ """
+ :param image: numpy array as input
+ :param use_CCP4: use the former LGPL implementation provided by CCP4
+ :return: binary stream
+ """
+ cdef:
+ cnp.uint32_t size, dim0, dim1, i, j
+ int fd, ret
+ char* name
+ cnp.int16_t[::1] data
+ cnp.int32_t[::1] raw
+ bytes output
+
+ assert image.ndim == 2, "Input image shape is 2D"
+ size = image.size
+ dim0 = image.shape[0]
+ dim1 = image.shape[1]
+ data = numpy.ascontiguousarray(image.ravel(), dtype=numpy.int16)
+ if use_CCP4:
+ (fd, fname) = tempfile.mkstemp()
+ fname = fname.encode("ASCII")
+ name = <char*> fname
+ with nogil:
+ pack_wordimage_c(<short int *> &data[0], dim1, dim0, name)
+ with open(name, "rb") as f:
+ f.seek(0)
+ output = f.read()
+ os.close(fd)
+ os.unlink(fname)
+ else:
+ output = ("\nCCP4 packed image, X: %04d, Y: %04d\n" % (dim1, dim0)).encode("ASCII")
+ raw = precomp(data, dim1)
+ cont = pack_image(raw, False)
+ output += cont.get().tostring()
+ return output
+
+
+@cython.boundscheck(False)
+@cython.cdivision(True)
+def uncompress_pck(bytes raw not None, dim1=None, dim2=None, overflowPix=None, version=None, normal_start=None, swap_needed=None, bint use_CCP4=False):
+ """
+ Unpack a mar345 compressed image
+
+ :param raw: input string (bytes in python3)
+ :param dim1,dim2: optional parameters size
+ :param overflowPix: optional parameters: number of overflowed pixels
+ :param version: PCK version 1 or 2
+ :param normal_start: position of the normal value section (can be auto-guessed)
+ :param swap_needed: set to True when reading data from a foreign endianness (little on big or big on little)
+ :return: ndarray of 2D with the right size
+ """
+ cdef:
+ int cdimx, cdimy, chigh, cversion, records, normal_offset, lenkey, i, stop, idx, value
+ cnp.uint32_t[:, ::1] data
+ cnp.uint8_t[::1] instream
+ cnp.int32_t[::1] unpacked
+ cnp.int32_t[:, ::1] overflow_data # handles overflows
+ void* out
+ end = None
+ key1 = b"CCP4 packed image, X: "
+ key2 = b"CCP4 packed image V2, X: "
+
+ if (dim1 is None) or (dim2 is None) or \
+ (version not in [1, 2]) or \
+ (version is None) or \
+ (normal_start is None):
+ start = raw.find(key2)
+ key = key2
+ cversion = 2
+ if start == -1:
+ start = raw.find(key1)
+ key = key1
+ cversion = 1
+ lenkey = len(key)
+ start = raw.index(key) + lenkey
+ sizes = raw[start:start + 13]
+ cdimx = < int > int(sizes[:4])
+ cdimy = < int > int(sizes[-4:])
+ normal_offset = start + 13
+ else:
+ cdimx = < int > dim1
+ cdimy = < int > dim2
+ cversion = <int> version
+ normal_offset = <int> normal_start
+ if cversion == 1:
+ lenkey = len(key1)
+ else:
+ lenkey = len(key2)
+ if cversion not in [1, 2]:
+ raise RuntimeError("Cannot determine the compression scheme for PCK compression (either version 1 or 2)")
+ if (overflowPix is None) and (overflowPix is not False):
+ end = raw.find("END OF HEADER")
+ start = raw[:end].find("HIGH")
+ hiLine = raw[start:end]
+ hiLine = hiLine.split("\n")[0]
+ word = hiLine.split()
+ if len(word) > 1:
+ chigh = int(word[1])
+ else:
+ logger.warning("Error while looking for overflowed pixels in line %s", hiLine.strip())
+ chigh = 0
+ else:
+ chigh = < int > overflowPix
+
+ instream = numpy.fromstring(raw[normal_offset:].lstrip(), dtype=numpy.uint8)
+
+ if use_CCP4:
+ data = numpy.empty((cdimy, cdimx), dtype=numpy.uint32)
+ with nogil:
+ ################################################################################
+ # rely to whichever version of ccp4_unpack is appropriate
+ ################################################################################
+ if cversion == 1:
+ ccp4_unpack_string(&data[0, 0], &instream[0], cdimx, cdimy, 0)
+ else:
+ # cversion == 2:
+ ccp4_unpack_v2_string(&data[0, 0], &instream[0], cdimx, cdimy, 0)
+ else:
+ # There is a bug in the mar345 implementation which performs arithmetics
+ # of post-decompression in 16bits integers and overflows with large values
+ unpacked = unpack_pck(instream, cdimx, cdimy).get1d()
+ data = numpy.ascontiguousarray(postdec(unpacked, cdimx), numpy.uint32).reshape((cdimy, cdimx))
+
+ if chigh > 0:
+ ################################################################################
+ # handle overflows: Each record is 8 overflow of 2x32bits integers
+ ################################################################################
+ records = (chigh + PACK_SIZE_HIGH - 1) // PACK_SIZE_HIGH
+ stop = normal_offset - lenkey - 14
+ odata = numpy.fromstring(raw[stop - 64 * records: stop], dtype=numpy.int32)
+ if swap_needed:
+ odata.byteswap(True)
+ overflow_data = odata.reshape((-1, 2))
+ for i in range(overflow_data.shape[0]):
+ idx = overflow_data[i, 0] - 1 # indexes are even values (-1 because 1 based counting)
+ value = overflow_data[i, 1] # values are odd values
+ if (idx >= 0) and (idx < cdimx * cdimy):
+ data[idx // cdimx, idx % cdimx] = <cnp.uint32_t> value
+ return numpy.asarray(data)
+
+
+################################################################################
+# Re-Implementation of the pck compression/decompression
+################################################################################
+
+@cython.boundscheck(False)
+@cython.wraparound(False)
+@cython.cdivision(True)
+@cython.initializedcheck(False)
+cpdef inline cnp.int32_t[::1] precomp(cnp.int16_t[::1] img, cnp.uint32_t width):
+ """Pre-compression by subtracting the average value of the four neighbours
+
+ Actually it looks a bit more complicated:
+
+ * there comes the +2 from ?
+ * the first element remains untouched
+ * elements of the first line (+ first of second) use only former element
+
+
+ JPA, the original author wrote:
+ Compression is achieved by first calculating the differences between every
+ pixel and the truncated value of four of its neighbours. For example:
+ the difference for a pixel at img[x, y] is:
+
+ comp[y, x] = img[y, x] - (img[y-1, x-1] + img[y-1, x] + img[y-1, x+1] + img[y, x-1]) / 4
+
+ This part implements overlows of int16 as the reference implementation is buggy
+ """
+ cdef:
+ cnp.uint32_t size, i
+ cnp.int32_t[::1] comp
+ cnp.int16_t last, cur, im0, im1, im2
+ size = img.size
+ comp = numpy.zeros(size, dtype=numpy.int32)
+
+ with nogil:
+ # First pixel
+ comp[0] = last = im0 = img[0]
+ im1 = img[1]
+ im2 = img[2]
+
+ # First line (+ 1 pixel)
+ for i in range(1, width + 1):
+ cur = img[i]
+ comp[i] = cur - last
+ last = cur
+
+ # Rest of the image
+ for i in range(width + 1, size):
+ cur = img[i]
+ comp[i] = <cnp.int16_t> (cur - (last + im0 + im1 + im2 + 2) // 4)
+ last = cur
+ im0 = im1
+ im1 = im2
+ im2 = img[i - width + 2]
+
+ return comp
+
+
+@cython.boundscheck(False)
+@cython.wraparound(False)
+@cython.cdivision(True)
+@cython.initializedcheck(False)
+cpdef inline cnp.uint32_t[::1] postdec(cnp.int32_t[::1] comp, int width):
+ """Post decompression by adding the average value of the four neighbours
+
+ Actually it looks a bit more complicated:
+
+ * there comes the +2 from ?
+ * the first element remains untouched
+ * elements of the first line (+ fist of second) use only former element
+
+ JPA, the original author wrote:
+ Compression is achieved by first calculating the differences between every
+ pixel and the truncated value of four of its neighbours. For example:
+ the difference for a pixel at img[x, y] is:
+
+ comp[y, x] = img[y, x] - (img[y-1, x-1] + img[y-1, x] + img[y-1, x+1] + img[y, x-1]) / 4
+
+ This part implementes overlows of int16 as the reference implementation is bugged
+ """
+ cdef:
+ cnp.uint32_t size, i
+ cnp.uint32_t[::1] img
+ cnp.int16_t last, cur, fl0, fl1, fl2
+ size = comp.size
+
+ img = numpy.zeros(size, dtype=numpy.uint32)
+
+ with nogil:
+
+ # First pixel
+ last = comp[0]
+ img[0] = last
+
+ # First line (+ 1 pixel)
+ for i in range(1, width + 1):
+ img[i] = cur = comp[i] + last
+ last = cur
+
+ # Rest of the image: not parallel in this case
+ fl0 = img[0]
+ fl1 = img[1]
+ fl2 = img[2]
+ for i in range(width + 1, size):
+ # overflow expected here.
+ cur = comp[i] + (last + fl0 + fl1 + fl2 + 2) // 4
+ # ensures the data is cropped at 16 bits!
+ img[i] = <cnp.uint16_t> cur
+ last = cur
+ fl0 = fl1
+ fl1 = fl2
+ fl2 = img[i - width + 2]
+
+ return img
+
+
+################################################################################
+# Re-Implementation of the pck compression stuff
+################################################################################
+
+
+@cython.boundscheck(False)
+@cython.wraparound(False)
+@cython.cdivision(True)
+@cython.initializedcheck(False)
+cpdef inline int calc_nb_bits(any_int_t[::1] data, cnp.uint32_t start, cnp.uint32_t stop) nogil:
+ """Calculate the number of bits needed to encode the data
+
+ :param data: input data, probably slices of a larger array
+ :param start: start position
+ :param stop: stop position
+ :return: the needed number of bits to store the values
+
+ Comment from JPA:
+ .................
+
+ Returns the number of bits necessary to encode the longword-array 'chunk'
+ of size 'n' The size in bits of one encoded element can be 0, 4, 5, 6, 7,
+ 8, 16 or 32.
+ """
+ cdef:
+ cnp.uint32_t size, maxsize, i, abs_data
+ any_int_t read_data
+
+ size = stop - start
+ maxsize = 0
+ for i in range(start, stop):
+ read_data = data[i]
+ abs_data = - read_data if read_data < 0 else read_data
+ if abs_data > maxsize:
+ maxsize = abs_data
+ if maxsize == 0:
+ return 0
+ elif maxsize < 8:
+ return size * 4
+ elif maxsize < 16:
+ return size * 5
+ elif maxsize < 32:
+ return size * 6
+ elif maxsize < 64:
+ return size * 7
+ elif maxsize < 128:
+ return size * 8
+ elif maxsize < 32768:
+ return size * 16
+ else:
+ return size * 32
+
+
+@cython.boundscheck(False)
+@cython.wraparound(False)
+@cython.cdivision(True)
+@cython.initializedcheck(False)
+def pack_image(img, bint do_precomp=True):
+ """Pack an image into a binary compressed block
+
+ :param img: input image as numpy.int16
+ :param do_precomp: perform the subtraction to the 4 neighbours's average. False is for testing the packing only
+ :return: 1D array of numpy.int8
+
+ JPA wrote:
+ ..........
+ Pack image 'img', containing 'x * y' WORD-sized pixels into byte-stream
+ """
+ cdef:
+ cnp.uint32_t nrow, ncol, size, stream_size
+ cnp.int16_t[::1] input_image
+ cnp.int32_t[::1] raw
+ PackContainer container
+ cnp.uint32_t i, position
+ cnp.uint32_t nb_val_packed
+ cnp.uint32_t current_block_size, next_bock_size
+
+ if do_precomp:
+ assert len(img.shape) == 2
+ nrow = img.shape[0]
+ ncol = img.shape[1]
+ input_image = numpy.ascontiguousarray(img, dtype=numpy.int16).ravel()
+ # pre compression: subtract the average of the 4 neighbours
+ raw = precomp(input_image, ncol)
+ size = nrow * ncol
+ else:
+ raw = numpy.ascontiguousarray(img, dtype=numpy.int32).ravel()
+ size = raw.size
+
+ # allocation of the output buffer
+ container = PackContainer(size)
+
+ position = 0
+ while position < size:
+ nb_val_packed = 1
+ current_block_size = calc_nb_bits(raw, position, position + nb_val_packed)
+ while ((position + nb_val_packed) < size) and (nb_val_packed < 128):
+ if (position + 2 * nb_val_packed) < size:
+ next_bock_size = calc_nb_bits(raw, position + nb_val_packed, position + 2 * nb_val_packed)
+ else:
+ break
+ if 2 * max(current_block_size, next_bock_size) < (current_block_size + next_bock_size + CCP4_PCK_BLOCK_HEADER_LENGTH):
+ nb_val_packed *= 2
+ current_block_size = 2 * max(current_block_size, next_bock_size)
+ else:
+ break
+ container.append(raw, position, nb_val_packed, current_block_size)
+ position += nb_val_packed
+
+ return container
+
+
+cdef class PackContainer:
+ cdef:
+ readonly cnp.uint32_t position, offset, allocated
+ cnp.uint8_t[::1] data
+
+ def __cinit__(self, cnp.uint32_t size=4096):
+ """Constructor of the class
+
+ :param size: start size of the array
+ """
+ self.position = 0
+ self.offset = 0
+ self.allocated = size
+ self.data = numpy.zeros(self.allocated, dtype=numpy.uint8)
+
+ def __dealloc__(self):
+ self.data = None
+
+ def get(self):
+ """retrieve the populated array"""
+ if self.offset:
+ end = self.position + 1
+ else:
+ end = self.position
+ return numpy.asarray(self.data[:end])
+
+ @cython.boundscheck(False)
+ @cython.wraparound(False)
+ @cython.cdivision(True)
+ @cython.initializedcheck(False)
+ cpdef append(self, cnp.int32_t[::1] data, cnp.uint32_t position, cnp.uint32_t nb_val, cnp.uint32_t block_size):
+ """Append a block of data[position: position+nb_val] to the compressed
+ stream. Only the most significant bits are takes.
+
+ :param data: input uncompressed image as 1D array
+ :param position: start position of reading of the image
+ :param nb_val: number of value from data to pack in the block
+ :param block_size: number of bits for the whole block
+
+ The 6 bits header is managed here as well as the stream resizing.
+ """
+ cdef:
+ cnp.uint32_t offset, index, i, bit_per_val, nb_bytes
+ cnp.uint64_t tmp, tostore, mask
+ cnp.int64_t topack
+
+ bit_per_val = block_size // nb_val
+
+ # realloc memory if needed
+ nb_bytes = (CCP4_PCK_BLOCK_HEADER_LENGTH + block_size + 7) // 8
+ if self.position + nb_bytes >= self.allocated:
+ self.allocated *= 2
+ new_stream = numpy.zeros(self.allocated, dtype=numpy.uint8)
+ if self.offset:
+ new_stream[:self.position + 1] = self.data[:self.position + 1]
+ else:
+ new_stream[:self.position] = self.data[:self.position]
+ self.data = new_stream
+
+ with nogil:
+ if self.offset == 0:
+ tmp = 0
+ else:
+ tmp = self.data[self.position]
+
+ # append 6 bits of header
+ tmp |= pack_nb_val(nb_val, bit_per_val) << self.offset
+ self.offset += CCP4_PCK_BLOCK_HEADER_LENGTH
+ self.data[self.position] = tmp & (255)
+ if self.offset >= 8:
+ self.position += 1
+ self.offset -= 8
+ self.data[self.position] = (tmp >> 8) & (255)
+
+ # now pack every value in input stream"
+ for i in range(nb_val):
+ topack = data[position + i]
+
+ mask = ((1 << (bit_per_val - 1)) - 1)
+ tmp = (topack & mask)
+ if topack < 0:
+ # handle the sign
+ tmp |= 1 << (bit_per_val - 1)
+
+ # read last position
+ if self.offset == 0:
+ tostore = 0
+ else:
+ tostore = self.data[self.position]
+
+ tostore |= tmp << self.offset
+ self.offset += bit_per_val
+
+ # Update the array
+ self.data[self.position] = tostore & (255)
+ while self.offset >= 8:
+ tostore = tostore >> 8
+ self.offset -= 8
+ self.position += 1
+ self.data[self.position] = tostore & (255)
+
+
+cpdef inline cnp.uint8_t pack_nb_val(cnp.uint8_t nb_val, cnp.uint8_t value_size) nogil:
+ """Calculate the header to be stored in 6 bits
+
+ :param nb_val: number of values to be stored: must be a power of 2 <=128
+ :param value_size: can be 0, 4, 5, 6, 7, 8, 16 or 32, the number of bits per value
+ :return: the header as an unsigned char
+ """
+ cdef:
+ cnp.uint32_t value, i
+
+ value = 0
+ for i in range(8):
+ if (nb_val >> i) == 1:
+ value |= i
+ break
+ value |= (CCP4_BITSIZE[value_size]) << (CCP4_PCK_BLOCK_HEADER_LENGTH >> 1)
+ # should be 6/2 = 3
+ return value
+
+
+################################################################################
+# Re-Implementation of the pck uncompression stuff
+################################################################################
+@cython.boundscheck(False)
+@cython.wraparound(False)
+@cython.cdivision(True)
+@cython.initializedcheck(False)
+cpdef UnpackContainer unpack_pck(cnp.uint8_t[::1] stream, int ncol, int nrow):
+ """Unpack the raw stream and return the image
+ V1 only for now, V2 may be added later
+
+ :param stream: raw input stream
+ :param ncol: number of columns in the image (i.e width)
+ :param nrow: number if rows in the image (i.e. height)
+ :return: Container with decompressed image
+ """
+ cdef:
+ cnp.uint32_t offset # Number of bit to offset in the current byte
+ cnp.uint32_t pos, end_pos # current position and last position of block in byte stream
+ cnp.uint32_t size # size of the input stream
+ cnp.int32_t value, next # integer values
+ cnp.uint32_t nb_val_packed, nb_bit_per_val, nb_bit_in_block
+ UnpackContainer cont # Container with unpacked data
+
+ cont = UnpackContainer(ncol, nrow)
+ size = stream.size
+
+ # Luckily we start at byte boundary
+ offset = 0
+ pos = 0
+
+ while pos < (size) and cont.position < (cont.size):
+ value = stream[pos]
+ if offset > (8 - CCP4_PCK_BLOCK_HEADER_LENGTH):
+ # wrap around
+ pos += 1
+ next = stream[pos]
+ value |= next << 8
+ value = value >> offset
+ offset += CCP4_PCK_BLOCK_HEADER_LENGTH - 8
+ elif offset == (8 - CCP4_PCK_BLOCK_HEADER_LENGTH):
+ # Exactly on the boundary
+ value = value >> offset
+ pos += 1
+ offset = 0
+ else:
+ # stay in same byte
+ value = value >> offset
+ offset += CCP4_PCK_BLOCK_HEADER_LENGTH
+
+ # we use 7 as mask: decimal value of 111
+
+ # move from offset, read 3 lsb, take the power of 2
+ nb_val_packed = 1 << (value & 7)
+ # read 3 next bits, search in LUT for the size of each element in block
+ nb_bit_per_val = CCP4_PCK_BIT_COUNT[(value >> 3) & 7]
+
+ if nb_bit_per_val == 0:
+ cont.set_zero(nb_val_packed)
+ else:
+ nb_bit_in_block = nb_bit_per_val * nb_val_packed
+ cont.unpack(stream, pos, offset, nb_val_packed, nb_bit_per_val)
+ offset += nb_bit_in_block
+ pos += offset // 8
+ offset %= 8
+ return cont
+
+
+cdef class UnpackContainer:
+ cdef:
+ readonly cnp.uint32_t nrow, ncol, position, size
+ readonly cnp.int32_t[::1] data
+ # readonly list debug
+
+ def __cinit__(self, int ncol, int nrow):
+ self.nrow = nrow
+ self.ncol = ncol
+ self.size = nrow * ncol
+ self.data = numpy.zeros(self.size, dtype=numpy.int32)
+ self.position = 0
+
+ def __dealloc__(self):
+ self.data = None
+
+ def get(self):
+ """retrieve the populated array"""
+ return numpy.asarray(self.data).reshape((self.nrow, self.ncol))
+
+ cpdef cnp.int32_t[::1] get1d(self):
+ """retrieve the populated array"""
+ return self.data
+
+ cpdef set_zero(self, int number):
+ "set so many zeros"
+ self.position += number
+
+ @cython.boundscheck(False)
+ @cython.wraparound(False)
+ @cython.cdivision(True)
+ @cython.initializedcheck(False)
+ cpdef unpack(self, cnp.uint8_t[::1] stream, cnp.uint32_t pos, cnp.uint32_t offset, cnp.uint32_t nb_value, cnp.uint32_t value_size):
+ """unpack a block on data, all the same size
+
+ :param stream: input stream, already sliced
+ :param offset: number of bits of offset, at the begining of the stream
+ :param nb_value: number of values to unpack
+ :param value_size: number of bits of each value
+ """
+ cdef:
+ cnp.uint32_t i, j # simple counters
+ cnp.uint32_t new_offset # position after read
+ cnp.int64_t cur, tmp2 # value to be stored
+ cnp.uint64_t tmp # under contruction: needs to be unsigned
+ int to_read # number of bytes to read
+
+ with nogil:
+ cur = 0
+ for i in range(nb_value):
+
+ # read as many bytes as needed and unpack them to tmp variable
+
+ tmp = stream[pos] >> offset
+
+ new_offset = value_size + offset
+ to_read = (new_offset + 7) // 8
+
+ for j in range(1, to_read):
+ tmp |= (stream[pos + j]) << (8 * j - offset)
+
+ # Remove the msb of tmp to keep only the interesting values
+ cur = tmp & ((1 << (value_size)) - 1)
+
+ # change sign if most significant bit is 1
+ if cur >> (value_size - 1):
+ cur |= (-1) << (value_size - 1)
+
+ # Update the storage
+ self.data[self.position] = cur
+ self.position += 1
+
+ # Update the position in the array
+ pos = pos + new_offset // 8
+ offset = new_offset % 8
diff --git a/fabio/ext/setup.py b/fabio/ext/setup.py
new file mode 100644
index 0000000..5c1a183
--- /dev/null
+++ b/fabio/ext/setup.py
@@ -0,0 +1,66 @@
+# coding: utf-8
+# /*##########################################################################
+# Copyright (C) 2016 European Synchrotron Radiation Facility
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+# ############################################################################*/
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "01/08/2017"
+
+import os
+import numpy
+from numpy.distutils.misc_util import Configuration
+
+
+def configuration(parent_package='', top_path=None):
+ config = Configuration('ext', parent_package, top_path)
+
+ config.add_extension(
+ name="cf_io",
+ sources=["cf_io.pyx", os.path.join("src", "columnfile.c")],
+ include_dirs=["include", numpy.get_include()],
+ language='c')
+
+ config.add_extension(
+ name="byte_offset",
+ sources=["byte_offset.pyx"],
+ include_dirs=[numpy.get_include()],
+ language='c')
+
+ config.add_extension(
+ name="mar345_IO",
+ sources=["mar345_IO.pyx", os.path.join("src", "ccp4_pack.c")],
+ include_dirs=["include", numpy.get_include()],
+ language='c')
+
+ config.add_extension(
+ name="_cif",
+ sources=["_cif.pyx"],
+ include_dirs=[numpy.get_include()],
+ language='c')
+
+ return config
+
+
+if __name__ == "__main__":
+ from numpy.distutils.core import setup
+ setup(configuration=configuration)
diff --git a/fabio/ext/src/ccp4_pack.c b/fabio/ext/src/ccp4_pack.c
new file mode 100644
index 0000000..579e3e1
--- /dev/null
+++ b/fabio/ext/src/ccp4_pack.c
@@ -0,0 +1,888 @@
+/* Fabio Mar345 ccp4_pack decompressor
+ Copyright (C) 2007-2009 Henning O. Sorensen & Erik Knudsen
+ 2012 ESRF
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General
+ Public License along with this library; if not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301 USA */
+
+/* part of this code is freely adaped from pack_c.c from CCP4 distribution
+ * (which is also LGPL). The original author is Jan Pieter Abrahams
+ *
+ jpa@mrc-lmb.cam.ac.uk
+
+ This file contains functions capable of compressing and decompressing
+ images. It is especially suited for X-ray diffraction patterns, or other
+ image formats in which orthogonal pixels contain "grey-levels" and
+ vary smoothly accross the image. Clean images measured by a MAR-research
+ image plate scanner containing two bytes per pixel can be compressed by
+ a factor of 3.5 to 4.5 .
+
+ Since the images are encoded in a byte-stream, there should be no problem
+ concerning big- or little ended machines: both will produce an identical
+ packed image.
+
+ Compression is achieved by first calculating the differences between every
+ pixel and the truncated value of four of its neighbours. For example:
+ the difference for a pixel at img[x, y] is:
+
+ img[x, y] - (int) (img[x-1, y-1] +
+ img[x-1, y] +
+ img[x-1, y+1] +
+ img[x, y-1]) / 4
+
+ After calculating the differences, they are encoded in a packed array. A
+ packed array consists of consequitive chunks which have the following format:
+ - Three bits containing the logarithm base 2 of the number of pixels encoded
+ in the chunk.
+ - Three bits defining the number of bits used to encode one element of the
+ chunk. The value of these three bits is used as index in a lookup table
+ to get the actual number of bits of the elements of the chunk.
+ Note: in version 2, there are four bits in this position!! This allows
+ more efficient packing of synchrotron data! The routines in this
+ sourcefile are backwards compatible.
+ JPA, 26 June 1995
+ - The truncated pixel differences.
+
+ To compress an image, call pack_wordimage_c() or pack_longimage_c(). These
+ will append the packed image to any header information already written to
+ disk (take care that the file containing this information is closed before
+ calling). To decompress an image, call readpack_word_c() or
+ readpack_long_c(). These functions will find the start of the packed image
+ themselves, irrespective of the header format.
+
+ Jan Pieter Abrahams, 6 Jan 1993 */
+
+#include <ccp4_pack.h>
+#include "string.h"
+#include "assert.h"
+
+/*array translating the number of errors per block*/
+static unsigned int CCP4_PCK_ERR_COUNT[] = {1,2,4,8,16,32,64,128};
+/*array translating the number of bits per error*/
+static unsigned int CCP4_PCK_BIT_COUNT[]= {0,4,5,6,7,8,16,32};
+/*array translating the number of errors per block - can use shifts as well actually*/
+static unsigned int CCP4_PCK_ERR_COUNT_V2[] = {1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768};
+/*array translating the number of bits per error*/
+static unsigned int CCP4_PCK_BIT_COUNT_V2[]= {0,4,5,6,7,8,9,10,11,12,13,14,15,16,32};
+
+static const unsigned char CCP4_PCK_MASK[]={0x00,
+ 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF};
+
+static const unsigned int CCP4_PCK_MASK_16[]={0x00,
+ 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF,
+ 0x1FF, 0x3FF, 0x7FF, 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF};
+
+static const unsigned long CCP4_PCK_MASK_32[]={0x00,
+ 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF,
+ 0x1FF, 0x3FF, 0x7FF, 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF,
+ 0x1FFFF, 0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF, 0x7FFFFF, 0xFFFFFF,
+ 0x1FFFFFF, 0x3FFFFFF, 0x7FFFFFF, 0xFFFFFFF, 0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF, 0xFFFFFFFF};
+
+
+
+void *mar345_read_data_string(char *instring, int ocount, int dim1, int dim2){
+ // first process overflow bytes - for now we just ignore them
+ // * these are stored in 64 byte records
+ int orecords=(int)(ocount/8.0+0.875);
+ int *odata,x,y,version=0;
+ char *c,cbuffer[64]="";
+ char *t_;
+ unsigned int *unpacked_array;
+
+ odata=(int*)malloc(64*8*orecords);
+ if (!odata)
+ return NULL;
+ memcpy(odata, instring, 64*orecords);
+ t_ = instring + (64*orecords);
+ // there is no stdout in a gui, sorry
+
+ // now after they have been read find the CCP4.....string and compare to dim1
+ c=cbuffer;
+ while((*c)!=EOF){
+
+ if (c==cbuffer+63){
+ c=cbuffer;
+ }
+
+ *c = (char) *t_;
+ t_++;
+
+ // set the next character to a \0 so the string is always terminated
+ *(c+1)='\0';
+
+ if (*c=='\n'){
+ // check for the CCP- string
+ x=y=0;
+ sscanf(cbuffer,"CCP4 packed image, X: %04d, Y: %04d", &x,&y);
+ if (x==dim1 || y ==dim2){
+ version=1;
+ break;
+ }
+ x=y=0;
+ sscanf(cbuffer,"CCP4 packed image V2, X: %04d, Y: %04d", &x,&y);
+ if (x==dim1 || y ==dim2){
+ version=2;
+ break;
+ }
+ c=cbuffer;
+ } else
+ c++;
+ }
+ // allocate memory for the arrays
+ unpacked_array=(unsigned int*) malloc(sizeof(unsigned int)*dim1*dim2);
+ if (!unpacked_array)
+ return NULL;
+ // relay to whichever version of ccp4_unpack is appropriate
+
+ switch(version){
+ case 1:
+ ccp4_unpack_string(unpacked_array,(void*)t_,dim1,dim2,0);
+ break;
+ case 2:
+ ccp4_unpack_v2_string(unpacked_array,(void*)t_,dim1,dim2,0);
+ break;
+ default:
+ return NULL;
+ }
+
+ // handle overflows
+ while (ocount>0){
+ unsigned int adress,value;
+ adress=odata[2*ocount-2];
+ if (adress){
+ value=odata[2*ocount-1];
+ // adresses start at 1
+ unpacked_array[adress-1]=value;
+ }
+ ocount--;
+ }
+ return unpacked_array;
+}
+
+// Henri start modif
+// void* mar345_read_data_2(const char* pFilePath, int ocount, int dim1, int dim2){
+// FILE* f = fopen(pFilePath, "r");
+// assert(f);
+// if(!f){
+// printf("can't find file %s. Unable to read mar345 data\n", pFilePath);
+// return NULL;
+// }
+
+// void* res = mar345_read_data(f, ocount, dim1, dim2);
+// fclose(f);
+// return res;
+// }
+// Henri end modif
+
+// *unpack a new style mar345 image a'la what is done in CBFlib
+// * assumes the file is already positioned after the ascii header
+// * Perhaps the positioning should be done here as well.
+
+void * mar345_read_data(FILE *file, int ocount, int dim1, int dim2){
+ // first process overflow bytes - for now we just ignore them
+ // these are stored in 64 byte records
+ int orecords=(int)(ocount/8.0+0.875);
+ int *odata,x,y,version=0;
+ char *c,cbuffer[64]="";
+ unsigned int *unpacked_array;
+
+ odata=(int*)malloc(64*8*orecords);
+ if (!odata)
+ return NULL;
+ pfail_nonzero (orecords-fread(odata,64,orecords,file));
+ // there is no stdout in a gui, sorry
+
+ // now after they have been read find the CCP4.....string and compare to dim1
+ c=cbuffer;
+ while((*c)!=EOF){
+
+ if (c==cbuffer+63){
+ c=cbuffer;
+ }
+
+ *c=(char)getc(file);
+ // set the next character to a \0 so the string is always terminated
+ *(c+1)='\0';
+
+ if (*c=='\n'){
+ // check for the CCP- string
+ x=y=0;
+ sscanf(cbuffer,"CCP4 packed image, X: %04d, Y: %04d", &x,&y);
+ if (x==dim1 || y ==dim2){
+ version=1;
+ break;
+ }
+ x=y=0;
+ sscanf(cbuffer,"CCP4 packed image V2, X: %04d, Y: %04d", &x,&y);
+ if (x==dim1 || y ==dim2){
+ version=2;
+ break;
+ }
+ c=cbuffer;
+ } else
+ c++;
+ }
+ // allocate memory for the arrays
+ unpacked_array=(unsigned int*) malloc(sizeof(unsigned int)*dim1*dim2);
+ if (!unpacked_array)
+ return NULL;
+ // relay to whichever version of ccp4_unpack is appropriate
+ switch(version){
+ case 1:
+ ccp4_unpack(unpacked_array,(void*)file,dim1,dim2,0);
+ break;
+ case 2:
+ ccp4_unpack_v2(unpacked_array,(void*)file,dim1,dim2,0);
+ break;
+ default:
+ return NULL;
+ }
+
+ // handle overflows
+ while (ocount>0){
+ unsigned int adress,value;
+ adress=odata[2*ocount-2];
+ if (adress){
+ value=odata[2*ocount-1];
+ // adresses start at 1
+ unpacked_array[adress-1]=value;
+ }
+ ocount--;
+ }
+ return unpacked_array;
+}
+
+// *unpack a ccp4-style packed array into the memory location pointed to by unpacked_array
+// * if this is null allocate memory and return a pointer to it
+// * \return NULL if unsuccessful
+// * TODO change this to read directly from the FILE to not waste memory
+void * ccp4_unpack(
+ void *unpacked_array,
+ void *packed,
+ size_t dim1,size_t dim2,
+ size_t max_num_int
+ ){
+
+ uint8_t t_,t2,_conv;
+ int err_val,bit_offset,num_error=0,num_bits=0,read_bits;
+ int i;
+ int x4,x3,x2,x1;
+ unsigned int *int_arr=(unsigned int *) unpacked_array;
+ FILE *instream=(FILE *)packed;
+ // if no maximum integers are give read the whole nine yards
+ if (max_num_int==0){
+ max_num_int=dim1*dim2;
+ }
+ // if a NULL pointer is passed allocate some new memory
+ if (unpacked_array==NULL){
+ if ( (unpacked_array=malloc(sizeof(unsigned int)*max_num_int))==NULL){
+ errno=ENOMEM;
+ return NULL;
+ }
+ }
+ // packed bits always start at byte boundary after header
+ bit_offset=0;
+ // read the first byte of the current_block
+ t_=(unsigned char)fgetc(instream);
+
+ // while less than num ints have been unpacked
+ i=0;
+ while(i<max_num_int){
+ if (num_error==0){
+ // at the beginning of block - read the 6 block header bits
+ if (bit_offset>=(8-CCP4_PCK_BLOCK_HEADER_LENGTH)){
+ // we'll be reading past the next byte boundary
+ t2=(unsigned char ) fgetc(instream);
+ t_=(t_>>bit_offset) + ((unsigned char)t2 <<(8-bit_offset) );
+ num_error=CCP4_PCK_ERR_COUNT[t_ & CCP4_PCK_MASK[3]];
+ num_bits=CCP4_PCK_BIT_COUNT[(t_>>3) & CCP4_PCK_MASK[3]];
+ bit_offset=CCP4_PCK_BLOCK_HEADER_LENGTH+bit_offset-8;
+ t_=t2;
+ }else{
+ num_error=CCP4_PCK_ERR_COUNT[(t_>>bit_offset) & CCP4_PCK_MASK[3]];
+ num_bits=CCP4_PCK_BIT_COUNT[(t_>>(3+bit_offset)) & CCP4_PCK_MASK[3]];
+ bit_offset+=CCP4_PCK_BLOCK_HEADER_LENGTH;
+ }
+ } else {
+ // reading the data in the block
+ while(num_error>0){
+ err_val=0;
+ read_bits=0;
+ while(read_bits<num_bits){
+ if (bit_offset+(num_bits-read_bits)>=8) {
+ // read to next full byte boundary and convert
+ _conv= (t_>>bit_offset) & CCP4_PCK_MASK[8-bit_offset];
+ err_val|= (unsigned int) _conv << read_bits;
+ read_bits+=(8-bit_offset);
+ // have read to byte boundary - set offset to 0 and read next byte
+ bit_offset=0;
+ t_=(unsigned char) fgetc(instream);
+ }
+ else {
+ // must stop before next byte boundary - also this means that these are the last bits in the error
+ _conv= (t_ >>bit_offset) & CCP4_PCK_MASK[num_bits-read_bits];
+ err_val|= _conv<<read_bits;
+ bit_offset+= (num_bits-read_bits);
+ read_bits=num_bits;
+ }
+
+ }
+ // if the msb is set, the error is negative -
+ // * fill up with 1s to get a 2's compl representation
+ if (err_val & (1 << (num_bits-1)) )
+ {
+ err_val|= -1<<(num_bits-1);
+ }
+ // store the current value in the unpacked array
+ if (i>dim1){
+ // the current pixel is not in the first row - averaging is possible
+ // n.b. the averaging calculation is performed in the 2's complement domain
+ x4=(int16_t) int_arr[i-1];
+ x3=(int16_t) int_arr[i-dim1+1];
+ x2=(int16_t) int_arr[i-dim1];
+ x1=(int16_t) int_arr[i-dim1-1];
+ int_arr[i]=(uint16_t) (err_val + (x4 + x3 + x2 + x1 +2) /4 );
+ i=i;
+ } else if (i!=0){
+ // current pixel is in the 1st row but is not first pixel
+ int_arr[i]=(uint16_t) (err_val + int_arr[i-1]);
+ } else {
+ int_arr[i]=(uint16_t) err_val;
+ }
+ i++;
+ num_error--;
+ }
+ }// else
+ }
+ return (void *) unpacked_array;
+}
+
+
+void * ccp4_unpack_string(
+ void *unpacked_array,
+ void *packed,
+ size_t dim1,size_t dim2,
+ size_t max_num_int
+ ){
+
+ uint8_t t_,t2,_conv;
+ int err_val,bit_offset,num_error=0,num_bits=0,read_bits;
+ int i;
+ int x4,x3,x2,x1;
+ unsigned int *int_arr;
+ char *instream = (char *)packed;
+
+ // if no maximum integers are give read the whole nine yards
+ if (max_num_int==0){
+ max_num_int=dim1*dim2;
+ }
+ // if a NULL pointer is passed allocate some new memory
+ if (unpacked_array==NULL){
+ if ( (unpacked_array=malloc(sizeof(unsigned int)*max_num_int))==NULL){
+ errno=ENOMEM;
+ return NULL;
+ }
+ }
+ int_arr = (unsigned int *) unpacked_array;
+
+ // packed bits always start at byte boundary after header
+ bit_offset=0;
+ // read the first byte of the current_block
+ t_=(unsigned char)*instream;
+ instream++;
+ // printf("%02X \n",t_);
+ // while less than num ints have been unpacked
+ i=0;
+ while(i<max_num_int){
+ if (num_error==0){
+ // at the beginning of block - read the 6 block header bits
+ if (bit_offset>=(8-CCP4_PCK_BLOCK_HEADER_LENGTH)){
+ // we'll be reading past the next byte boundary
+ t2=(unsigned char ) *instream;
+ instream++;
+ t_=(t_>>bit_offset) + ((unsigned char)t2 <<(8-bit_offset) );
+ num_error=CCP4_PCK_ERR_COUNT[t_ & CCP4_PCK_MASK[3]];
+ num_bits=CCP4_PCK_BIT_COUNT[(t_>>3) & CCP4_PCK_MASK[3]];
+ bit_offset=CCP4_PCK_BLOCK_HEADER_LENGTH+bit_offset-8;
+ t_=t2;
+ }else{
+ num_error=CCP4_PCK_ERR_COUNT[(t_>>bit_offset) & CCP4_PCK_MASK[3]];
+ num_bits=CCP4_PCK_BIT_COUNT[(t_>>(3+bit_offset)) & CCP4_PCK_MASK[3]];
+ bit_offset+=CCP4_PCK_BLOCK_HEADER_LENGTH;
+ }
+ } else {
+ // reading the data in the block
+ while(num_error>0){
+ err_val=0;
+ read_bits=0;
+ while(read_bits<num_bits){
+ if (bit_offset+(num_bits-read_bits)>=8) {
+ // read to next full byte boundary and convert
+ _conv= (t_>>bit_offset) & CCP4_PCK_MASK[8-bit_offset];
+ err_val|= (unsigned int) _conv << read_bits;
+ read_bits+=(8-bit_offset);
+ // have read to byte boundary - set offset to 0 and read next byte
+ bit_offset=0;
+ t_=(unsigned char) *instream;
+ instream++;
+ }
+ else {
+ // must stop before next byte boundary - also this means that these are the last bits in the error
+ _conv= (t_ >>bit_offset) & CCP4_PCK_MASK[num_bits-read_bits];
+ err_val|= _conv<<read_bits;
+ bit_offset+= (num_bits-read_bits);
+ read_bits=num_bits;
+ }
+
+ }
+ // if the msb is set, the error is negative -
+ // fill up with 1s to get a 2's compl representation
+ if (err_val & (1 << (num_bits-1)) )
+ {
+ err_val|= -1<<(num_bits-1);
+ }
+ // store the current value in the unpacked array
+ if (i>dim1){
+ // the current pixel is not in the first row - averaging is possible
+ // n.b. the averaging calculation is performed in the 2's complement domain
+ x4=(int16_t) int_arr[i-1];
+ x3=(int16_t) int_arr[i-dim1+1];
+ x2=(int16_t) int_arr[i-dim1];
+ x1=(int16_t) int_arr[i-dim1-1];
+ int_arr[i]=(uint16_t) (err_val + (x4 + x3 + x2 + x1 +2) /4 );
+ i=i;
+ } else if (i!=0){
+ // current pixel is in the 1st row but is not first pixel
+ int_arr[i]=(uint16_t) (err_val + int_arr[i-1]);
+ } else {
+ int_arr[i]=(uint16_t) err_val;
+ }
+ i++;
+ num_error--;
+ }
+ } //else
+ }
+ return (void *) unpacked_array;
+}
+
+
+void * ccp4_unpack_v2(
+ void *unpacked_array,
+ void *packed,
+ size_t dim1,size_t dim2,
+ size_t max_num_int){
+
+ uint8_t t_,t2,_conv;
+ int err_val,bit_offset,num_error=0,num_bits=0,read_bits;
+ int i;
+ unsigned int x4=0,x3=0,x2=0,x1=0;
+ unsigned int *int_arr=(unsigned int *) unpacked_array;
+ FILE *instream=(FILE *)packed;
+
+ // if no maximum integers are give read the whole nine yards
+ if (max_num_int==0){
+ max_num_int=dim1*dim2;
+ }
+ // if a NULL pointer is passed allocate some new memory
+ if (unpacked_array==NULL){
+ if ( (unpacked_array=malloc(sizeof(unsigned int)*max_num_int))==NULL){
+ errno=ENOMEM;
+ return NULL;
+ }
+ }
+ // packed bits always start at byte boundary after header
+ bit_offset=0;
+ // read the first byte of the current_block
+ t_=(unsigned char)fgetc(instream);
+ // while less than num ints have been unpacked
+ i=0;
+ while(i<max_num_int){
+ if (num_error==0){
+ // at the beginning of block - read the 6 block header bits
+ if (bit_offset>=(8-CCP4_PCK_BLOCK_HEADER_LENGTH_V2)){
+ // we'll be reading past the next byte boundary
+ t2=(unsigned char ) fgetc(instream);
+ t_=(t_>>bit_offset) + ((unsigned char)t2 <<(8-bit_offset) );
+ num_error=CCP4_PCK_ERR_COUNT_V2[t_ & CCP4_PCK_MASK[4]];
+ num_bits=CCP4_PCK_BIT_COUNT_V2[(t_>>4) & CCP4_PCK_MASK[4]];
+ bit_offset=CCP4_PCK_BLOCK_HEADER_LENGTH_V2+bit_offset-8;
+ t_=t2;
+ }else{
+ num_error=CCP4_PCK_ERR_COUNT_V2[ (t_>>bit_offset) & CCP4_PCK_MASK[4] ];
+ num_bits=CCP4_PCK_BIT_COUNT_V2[ (t_>>(4+bit_offset)) & CCP4_PCK_MASK[4] ];
+ bit_offset+=CCP4_PCK_BLOCK_HEADER_LENGTH_V2;
+ }
+ } else {
+ // reading the data in the block
+ while(num_error>0){
+ err_val=0;
+ read_bits=0;
+ while(read_bits<num_bits){
+ if (bit_offset+(num_bits-read_bits)>=8) {
+ // read to next full byte boundary and convert
+ _conv= (t_>>bit_offset) & CCP4_PCK_MASK[8-bit_offset];
+ err_val|= (unsigned int) _conv << read_bits;
+ read_bits+=(8-bit_offset);
+ // have read to byte boundary - set offset to 0 and read next byte
+ bit_offset=0;
+ t_=(unsigned char) fgetc(instream);
+ }
+ else {
+ // must stop before next byte boundary - also this means that these are the last bits in the error
+ _conv= (t_ >>bit_offset) & CCP4_PCK_MASK[num_bits-read_bits];
+ err_val|= _conv<<read_bits;
+ bit_offset+= (num_bits-read_bits);
+ read_bits=num_bits;
+ }
+
+ }
+ // if the msb is set, the error is negative -
+ // fill up with 1s to get a 2's compl representation
+ if (err_val & (1 << (num_bits-1)) )
+ {
+ err_val|= -1<<(num_bits-1);
+ }
+ // store the current value in the unpacked array
+ if (i>dim1){
+ // the current pixel is not in the first row - averaging is possible
+ // n.b. the averaging calculation is performed in the 2's complement domain
+ x4=(int16_t) int_arr[i-1];
+ x3=(int16_t) int_arr[i-dim1+1];
+ x2=(int16_t) int_arr[i-dim1];
+ x1=(int16_t) int_arr[i-dim1-1];
+ int_arr[i]=(uint16_t) (err_val + (x4 + x3 + x2 + x1 +2) /4 );
+ i=i;
+ } else if (i!=0){
+ // current pixel is in the 1st row but is not first pixel
+ int_arr[i]=(uint16_t) (err_val + int_arr[i-1]);
+ } else {
+ int_arr[i]=(uint16_t) err_val;
+ }
+ i++;
+ num_error--;
+ }
+ } // else
+ }
+ return (void *) unpacked_array;
+}
+void * ccp4_unpack_v2_string(
+ void *unpacked_array,
+ void *packed,
+ size_t dim1,size_t dim2,
+ size_t max_num_int){
+
+ uint8_t t_,t2,_conv;
+ int err_val,bit_offset,num_error=0,num_bits=0,read_bits;
+ int i;
+ unsigned int x4=0,x3=0,x2=0,x1=0;
+ unsigned int *int_arr=(unsigned int *) unpacked_array;
+ char *instream=(char *)packed;
+
+ // if no maximum integers are give read the whole nine yards
+ if (max_num_int==0){
+ max_num_int=dim1*dim2;
+ }
+ // if a NULL pointer is passed allocate some new memory
+ if (unpacked_array==NULL){
+ if ( (unpacked_array=malloc(sizeof(unsigned int)*max_num_int))==NULL){
+ errno=ENOMEM;
+ return NULL;
+ }
+ }
+ // packed bits always start at byte boundary after header
+ bit_offset=0;
+ // read the first byte of the current_block
+ t_=(unsigned char)*instream;
+ instream++;
+ // while less than num ints have been unpacked
+ i=0;
+ while(i<max_num_int){
+ if (num_error==0){
+ // at the beginning of block - read the 6 block header bits
+ if (bit_offset>=(8-CCP4_PCK_BLOCK_HEADER_LENGTH_V2)){
+ // we'll be reading past the next byte boundary
+ t2=(unsigned char ) *instream;
+ instream++;
+ t_=(t_>>bit_offset) + ((unsigned char)t2 <<(8-bit_offset) );
+ num_error=CCP4_PCK_ERR_COUNT_V2[t_ & CCP4_PCK_MASK[4]];
+ num_bits=CCP4_PCK_BIT_COUNT_V2[(t_>>4) & CCP4_PCK_MASK[4]];
+ bit_offset=CCP4_PCK_BLOCK_HEADER_LENGTH_V2+bit_offset-8;
+ t_=t2;
+ }else{
+ num_error=CCP4_PCK_ERR_COUNT_V2[ (t_>>bit_offset) & CCP4_PCK_MASK[4] ];
+ num_bits=CCP4_PCK_BIT_COUNT_V2[ (t_>>(4+bit_offset)) & CCP4_PCK_MASK[4] ];
+ bit_offset+=CCP4_PCK_BLOCK_HEADER_LENGTH_V2;
+ }
+ } else {
+ // reading the data in the block
+ while(num_error>0){
+ err_val=0;
+ read_bits=0;
+ while(read_bits<num_bits){
+ if (bit_offset+(num_bits-read_bits)>=8) {
+ // read to next full byte boundary and convert
+ _conv= (t_>>bit_offset) & CCP4_PCK_MASK[8-bit_offset];
+ err_val|= (unsigned int) _conv << read_bits;
+ read_bits+=(8-bit_offset);
+ // have read to byte boundary - set offset to 0 and read next byte
+ bit_offset=0;
+ t_=(unsigned char) *instream;
+ instream++;
+ }
+ else {
+ // must stop before next byte boundary - also this means that these are the last bits in the error
+ _conv= (t_ >>bit_offset) & CCP4_PCK_MASK[num_bits-read_bits];
+ err_val|= _conv<<read_bits;
+ bit_offset+= (num_bits-read_bits);
+ read_bits=num_bits;
+ }
+
+ }
+ // if the msb is set, the error is negative -
+ // fill up with 1s to get a 2's compl representation
+ if (err_val & (1 << (num_bits-1)) )
+ {
+ err_val|= -1<<(num_bits-1);
+ }
+ // store the current value in the unpacked array
+ if (i>dim1){
+ // the current pixel is not in the first row - averaging is possible
+ // n.b. the averaging calculation is performed in the 2's complement domain
+ x4=(int16_t) int_arr[i-1];
+ x3=(int16_t) int_arr[i-dim1+1];
+ x2=(int16_t) int_arr[i-dim1];
+ x1=(int16_t) int_arr[i-dim1-1];
+ int_arr[i]=(uint16_t) (err_val + (x4 + x3 + x2 + x1 +2) /4 );
+ i=i;
+ } else if (i!=0){
+ // current pixel is in the 1st row but is not first pixel
+ int_arr[i]=(uint16_t) (err_val + int_arr[i-1]);
+ } else {
+ int_arr[i]=(uint16_t) err_val;
+ }
+ i++;
+ num_error--;
+ }
+ } // else
+ }
+ return (void *) unpacked_array;
+}
+
+
+// #############################################################################
+// ################### Everything to write Mar345 ##############################
+// #############################################################################
+
+
+// Returns the number of bits neccesary to encode the longword-array 'chunk'
+// of size 'n' The size in bits of one encoded element can be 0, 4, 5, 6, 7,
+// 8, 16 or 32.
+int bits( int32_t *chunk, int n){
+ int size, maxsize, i;
+
+ for (i = 1, maxsize = abs(chunk[0]); i < n; ++i)
+ maxsize = max(maxsize, abs(chunk[i]));
+ if (maxsize == 0)
+ size = 0;
+ else if (maxsize < 8)
+ size = 4 * n;
+ else if (maxsize < 16)
+ size = 5 * n;
+ else if (maxsize < 32)
+ size = 6 * n;
+ else if (maxsize < 64)
+ size = 7 * n;
+ else if (maxsize < 128)
+ size = 8 * n;
+ else if (maxsize < 32768)
+ size = 16 * n;
+ else
+ size = 32 * n;
+ return(size);
+}
+
+// Calculates the difference of WORD-sized pixels of an image with the
+// truncated mean value of four of its neighbours. 'x' is the number of fast
+// coordinates of the image 'img', 'y' is the number of slow coordinates,
+// 'diffs' will contain the differences, 'done' defines the index of the pixel
+// where calculating the differences should start. A pointer to the last
+// difference is returned. Maximally DIFFBUFSIZ differences are returned in
+// 'diffs'.
+int *diff_words(
+ short int *word,
+ int x,
+ int y,
+ int *diffs,
+ int done){
+ int i = 0;
+ int tot = x * y;
+
+ if (done == 0)
+ { *diffs = word[0];
+ ++diffs;
+ ++done;
+ ++i;}
+ while ((done <= x) && (i < DIFFBUFSIZ))
+ { *diffs = word[done] - word[done - 1];
+ ++diffs;
+ ++done;
+ ++i;}
+ while ((done < tot) && (i < DIFFBUFSIZ))
+ { *diffs = word[done] - (word[done - 1] + word[done - x + 1] +
+ word[done - x] + word[done - x - 1] + 2) / 4;
+ ++diffs;
+ ++done;
+ ++i;}
+ return(--diffs);
+}
+
+// Pack 'n' WORDS, starting with 'lng[0]' into the packed array 'target'. The
+// elements of such a packed array do not obey BYTE-boundaries, but are put one
+// behind the other without any spacing. Only the 'bitsiz' number of least
+// significant bits are used. The starting bit of 'target' is 'bit' (bits range
+// from 0 to 7). After completion of 'pack_words()', both '**target' and '*bit'
+// are updated and define the next position in 'target' from which packing
+// could continue.
+void pack_longs(int32_t *lng,
+ int n,
+ char **target,
+ int *bit,
+ int size){
+ int32_t mask, window;
+ int valids, i, temp;
+ int temp_bit = *bit;
+ char *temp_target = *target;
+
+ if (size > 0)
+ { mask = CCP4_PCK_MASK_32[size];
+ for (i = 0; i < n; ++i)
+ { window = lng[i] & mask;
+ valids = size;
+ if (temp_bit == 0)
+ *temp_target = (char) window;
+ else
+ { temp = shift_left(window, temp_bit);
+ *temp_target |= temp;}
+ window = shift_right(window, 8 - temp_bit);
+ valids = valids - (8 - temp_bit);
+ if (valids < 0)
+ temp_bit += size;
+ else
+ { while (valids > 0)
+ { *++temp_target = (char) window;
+ window = shift_right(window, 8);
+ valids -= 8;}
+ temp_bit = 8 + valids;}
+ if (valids == 0)
+ { temp_bit = 0;
+ ++temp_target;}}
+ *target = temp_target;
+ *bit = (*bit + (size * n)) % 8;}
+}
+
+
+// Packs 'nmbr' LONGs starting at 'lng[0]' into a packed array of 'bitsize'
+// sized elements. If the internal buffer in which the array is packed is full,
+// it is flushed to 'file', making room for more of the packed array. If
+// ('lng == NULL'), the buffer is flushed a swell.
+void pack_chunk(int32_t *lng,
+ int nmbr,
+ int bitsize,
+ FILE *packfile){
+ static int32_t bitsize_encode[33] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 0, 0,
+ 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7};
+ int32_t descriptor[2], i, j;
+ static char *buffer = NULL;
+ static char *buffree = NULL;
+ static int bitmark;
+
+ if (buffer == NULL)
+ { buffree = buffer = (char *) malloc(PACKBUFSIZ);
+ bitmark = 0;}
+ if (lng != NULL)
+ { for (i = nmbr, j = 0; i > 1; i /= 2, ++j);
+ descriptor[0] = j;
+ descriptor[1] = bitsize_encode[bitsize];
+ if ((buffree - buffer) > (PACKBUFSIZ - (130 * 4)))
+ { fwrite(buffer, sizeof(char), buffree - buffer, packfile);
+ buffer[0] = buffree[0];
+ buffree = buffer;}
+ pack_longs(descriptor, 2, &buffree, &bitmark, 3);
+ pack_longs(lng, nmbr, &buffree, &bitmark, bitsize);}
+ else
+ { int len=buffree-buffer;
+ if (bitmark!=0) len++;
+ fwrite(buffer, sizeof(char), len, packfile);
+ free((void *) buffer);
+ buffer = NULL;}}
+
+
+// Pack image 'img', containing 'x * y' WORD-sized pixels into 'filename'.
+void pack_wordimage_copen(short int *img,
+ int x,
+ int y,
+ FILE *packfile){
+ int chunksiz, packsiz, nbits, next_nbits, tot_nbits;
+ int32_t buffer[DIFFBUFSIZ];
+ int32_t *diffs = buffer;
+ int32_t *end = diffs - 1;
+ int32_t done = 0;
+
+ fprintf(packfile, PACKIDENTIFIER, x, y);
+ while (done < (x * y))
+ { end = diff_words(img, x, y, buffer, done);
+ done += (end - buffer) + 1;
+ diffs = buffer;
+ while (diffs <= end)
+ { packsiz = 0;
+ chunksiz = 1;
+ nbits = bits(diffs, 1);
+ while (packsiz == 0)
+ { if (end <= (diffs + chunksiz * 2))
+ packsiz = chunksiz;
+ else
+ { next_nbits = bits(diffs + chunksiz, chunksiz);
+ tot_nbits = 2 * max(nbits, next_nbits);
+ if (tot_nbits >= (nbits + next_nbits + 6))
+ packsiz = chunksiz;
+ else
+ { nbits = tot_nbits;
+ if (chunksiz == 64)
+ packsiz = 128;
+ else
+ chunksiz *= 2;}}}
+ pack_chunk(diffs, packsiz, nbits / packsiz, packfile);
+ diffs += packsiz;}}
+ pack_chunk(NULL, 0, 0, packfile);
+}
+
+
+
+void pack_wordimage_c(
+ short int *img,
+ int x, int y,
+ char *filename){
+ FILE *packfile = fopen(filename, "ab");
+ if (packfile == NULL) {
+ fprintf(stderr,"The file %s cannot be created!\n ...giving up...\n",
+ filename);
+ exit(1);
+ } else {
+ pack_wordimage_copen(img, x, y, packfile);
+ fclose(packfile);
+ }
+}
+
diff --git a/fabio/ext/src/cf_iomodule.c b/fabio/ext/src/cf_iomodule.c
new file mode 100644
index 0000000..e7dc5b2
--- /dev/null
+++ b/fabio/ext/src/cf_iomodule.c
@@ -0,0 +1,79 @@
+#include <Python.h>
+#include <numpy/arrayobject.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "columnfile.h"
+
+static PyObject *cf_read(PyObject *self, PyObject *args, PyObject *keywds){
+ cf_data *cf__;
+ PyArrayObject *py_data;
+ PyStringObject *str;
+ PyListObject *clabels;
+
+ static char *kwlist[]={"file","mode",NULL};
+ const char mode[]="a ";
+ unsigned int flags=0;
+
+ /* perhaps not const */
+ int dim1,dim2,ocount;
+ int dims[2];
+ int i;
+ FILE *file;
+
+ PyObject *py_file;
+ if (!PyArg_ParseTupleAndKeywords(args,keywds,"O|s",kwlist,&py_file,&mode))
+ return NULL;
+ file=PyFile_AsFile(py_file);
+
+ if (strchr(mode,'z')){
+ flags|=CF_GZ_COMP;
+ }
+ if(strchr(mode,'b')){
+ cf__=(cf_data *) cf_read_bin(file,NULL,flags);
+ }else if (strchr(mode,'a')) {
+ cf__=(cf_data *) cf_read_ascii(file,NULL,flags);
+ }else{
+ fprintf(stderr,"unrecognized mode for columnfile %s (assuming ascii)\n",mode);
+ cf__= (cf_data *)cf_read_ascii(file,NULL,flags);
+ }
+ /*check for failure to read*/
+ if (cf__==NULL){
+ return Py_BuildValue("OO",Py_None,Py_None);
+ }
+ dims[0]=cf__->nrows;dims[1]=cf__->ncols;
+ /*since data may be non-contigous we can't simply create a numpy-array from cf__->data, as Numpy's memory model prohibits it*/
+ /*i.e. py_data=(PyArrayObject*)PyArray_SimpleNewFromData(2, dims, NPY_DOUBLE, (void*)(&(cf__->data[0][0])));
+ * won't work*/
+ py_data=(PyArrayObject *)PyArray_SimpleNew(2,dims,NPY_DOUBLE);
+ for (i=0;i<cf__->nrows;i++){
+ memcpy((double *)PyArray_GETPTR2(py_data,i,0),cf__->data[i],cf__->ncols*sizeof(double));
+ }
+ clabels=(PyListObject *)PyList_New(0);
+ for (i=0;i<cf__->ncols;i++){
+ str = (PyStringObject*)PyString_FromString(cf__->clabels[i]);
+ if (PyList_Append((PyObject*)clabels,(PyObject*)str)){
+ fprintf(stderr,"cannot insert column label %d\n",i);
+ }
+ }
+ cf_free(cf__);
+ return Py_BuildValue("OO", PyArray_Return(py_data),clabels);
+}
+
+
+
+static PyMethodDef cf_io_Methods[] = {
+ {"read",(PyCFunction)cf_read, METH_VARARGS | METH_KEYWORDS, "call the c-columnfile reading interface. The mode keyword argument is either:\n \"a\" for ascii (the default)\n \"b\" for binary"},
+ {NULL, NULL, 0, NULL}
+};
+
+
+PyMODINIT_FUNC initcf_io(void)
+{
+ (void) Py_InitModule("cf_io",cf_io_Methods);
+ import_array();
+
+ if (PyErr_Occurred())
+ Py_FatalError("cannot initialize cf_iomodule.c");
+}
+
+
diff --git a/fabio/ext/src/columnfile.c b/fabio/ext/src/columnfile.c
new file mode 100644
index 0000000..ca0756a
--- /dev/null
+++ b/fabio/ext/src/columnfile.c
@@ -0,0 +1,225 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifndef HAVE_ZLIB_H
+#define HAVE_ZLIB_H 0
+#else
+#include <zlib.h>
+#endif
+
+
+
+#include "columnfile.h"
+
+static char hdr_ctl[]="# %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s";
+
+
+
+int compression_yes(char *fname){
+ /*should we use compression*/
+ char *p;
+ if ( HAVE_ZLIB_H && (p=strstr(fname,".gz"))!=NULL && p<fname+strlen(fname) ){
+ return 1;
+ }
+ return 0;
+}
+
+void cf_free( cf_data *p){
+ int i;
+ if (p!=NULL){
+ for (i=0;i<p->nralloc;i++){
+ if (p->data[i]!=NULL) free(p->data[i]);
+ }
+ if( p->data!=NULL){free(p->data);}
+ for (i=0;i<p->ncols;i++){
+ if(p->clabels[i]!=NULL) free(p->clabels[i]);
+ }
+ if(p->clabels!=NULL){free(p->clabels);}
+ free(p);
+ }
+}
+
+int cf_write(char *fname,void *cf_handle, unsigned int FLAGS){
+ int status;
+#if HAVE_ZLIB_H
+ if (FLAGS & CF_GZ_COMP){
+ gzFile gzfp=gzopen(fname,"wbh");
+ if (gzfp==NULL) return -1;
+ status=-1;
+ if (FLAGS && CF_BIN){
+ status=cf_write_bin_gz(gzfp,cf_handle);
+ }else{
+ status=cf_write_ascii_gz(gzfp,cf_handle);
+ }
+ gzclose(gzfp);
+ return status;
+ }else{
+#else
+ if(1){
+#endif
+ FILE *fp=fopen(fname,"wb");
+ if (fp==NULL) return -1;
+ status=-1;
+ if (FLAGS && CF_BIN){
+ /*status=cf_write_bin(fp,cf_handle);
+ */
+ }else{
+ status=cf_write_ascii(fp,cf_handle,0);
+ }
+ fclose(fp);
+ return status;
+ }
+}
+
+int cf_write_ascii(void *fp, void *cf_handle, unsigned int FLAGS){/*{{{*/
+ int r,c;
+ cf_data *cf_=(cf_data *) cf_handle;
+#if HAVE_ZLIB_H
+ if (FLAGS & CF_GZ_COMP){
+ gzprintf((gzFile)fp,"#");
+ for (i=0;i<cf_->ncols;i++){
+ gzprintf((gzFile)fp," %s",cf_->clabels[i]);
+ }
+ gzprintf((gzFile)fp,"\n");
+ for (r=0;r<cf_->nrows;r++){
+ for (i=0;i<cf_->ncols;i++){
+ gzprintf((gzFile)fp," %g",cf_->data[i][r]);
+ }
+ gzprintf((gzFile)fp,"\n");
+ }
+ return 0;
+ }else{
+#endif
+ fprintf((FILE *)fp,"#");
+ for (c=0;c<cf_->ncols;c++){
+ fprintf((FILE *)fp," %s",cf_->clabels[c]);
+ }
+ fprintf((FILE *)fp,"\n");
+ for (r=0;r<cf_->nrows;r++){
+ for (c=0;c<cf_->ncols;c++){
+ fprintf((FILE *)fp," %g",cf_->data[c][r]);
+ }
+ fprintf((FILE *)fp,"\n");
+ }
+ return 0;
+#if HAVE_ZLIB_H
+ }
+#endif
+}/*}}}*/
+
+void *cf_read_ascii(void *fp, void *dest, unsigned int FLAGS){/*{{{*/
+ /*read the first line and figure out how many columns we have*/
+ char line[2048];
+ int i,r;
+ int nr_alloc=CF_INIT_ROWS;
+ int nc_alloc=CF_INIT_COLS;
+ int ncols;
+ char **clabels,**cp;
+ double **data,**dp;
+ char *p;
+ cf_data *dest_local;
+
+ /*read the first line into buffer*/
+#if HAVE_ZLIB_H
+ if (FLAGS & CF_GZ_COMP){
+ if ((gzgets((gzFile )fp,line,2048))==Z_NULL) {fprintf(stderr,"zlib io error in %s \n",__FILE__);return NULL;}
+ }else{
+ if((fgets(line,2048,(FILE *)fp))==NULL){fprintf(stderr,"io-error in %s\n",__FILE__);return NULL;}
+ }
+#else
+ if((fgets(line,2048,(FILE *)fp))==NULL){fprintf(stderr,"io-error in %s\n",__FILE__);return NULL;}
+#endif
+
+ /*initially allocate room for 32 columns - if that is not enough should reallocate*/
+ clabels=(char**) malloc(CF_INIT_COLS* sizeof(char*));
+ for (cp=clabels;cp<clabels+CF_INIT_COLS;cp++){
+ *cp=(char *)malloc(CF_HEADER_ITEM*sizeof(char));
+ }
+
+ /*try to sscanf it using 32 conversions - if that doesn't work use pedestrian version*/
+ ncols=sscanf(line,hdr_ctl,repeat16_inc(clabels,0),repeat16_inc(clabels,16),*(clabels+32));
+ if (ncols==32+1 || ncols==0){
+ /*aha we probably didn't get it all*/
+ /*step through buffer with char ptr and check for whitespace->non-ws slopes. when one is found read from pc-1 into header storage. exit when line is exhausted*/
+ /*count the number of entries*/
+ ncols=0;
+ /*headers are supposed to start with # so skip that*/
+ if (*line=='#') p=line+1;
+ else p=line;
+ while (*p!='\0' || *p!='\n' || p<line+2048){
+ if( is_ws(*p) && !is_ws(*(p+1)) && *(p+1)!='\0') {
+ if(ncols==nc_alloc){
+ clabels=(char**)realloc(clabels,sizeof(char *));
+ *(clabels+ncols)=(char*)malloc(CF_HEADER_ITEM*sizeof(char));
+ nc_alloc++;
+ }
+ sscanf(p,"%s",*(clabels+ncols));
+ ncols++;
+ }
+ p++;
+ }
+ }
+ /*alloc a number of rows*/
+ data=(double**)malloc(nr_alloc*sizeof(double*));
+ for (dp=data;dp<data+nr_alloc;dp++){
+ *dp=(double*)malloc(ncols*sizeof(double));
+ }
+
+ r=0;
+ do {
+#if HAVE_ZLIB_H
+ if (FLAGS & CF_GZ_COMP){
+ if ((gzgets((gzFile )fp,line,2048))==Z_NULL) {fprintf(stderr,"zlib io error reading file at %s\n",__LINE__);return -1;}
+ if(gzeof((gzFile)fp)) break;
+ }else{
+ fgets(line,2048,(FILE *)fp);
+ if (feof((FILE *)fp)) break;
+ }
+#else
+ fgets(line,2048,(FILE *)fp);
+ if (feof((FILE *)fp)) break;
+#endif
+
+ i=0;
+ p=line;
+
+ while (i<ncols && *p!='\0' && *p!='\n' && p<line+2048){
+ /*find the starting points of data items. these are transitions from whitespace to non-ws
+ * 1st one may not have beginning whitespace*/
+ if( (!is_ws(*p) && p==line) || (is_ws(*p) && !is_ws(*(p+1)) && *(p+1)!='\0') ) {
+ *(data[r] + i++)=atof(p);//0;//strtod(p,NULL);
+ }
+ p++;
+ }
+
+ r++;
+ if (r==nr_alloc){
+ /*we need to expand the data buffer*/
+ nr_alloc+=nr_alloc;
+ data=(double**)realloc(data,nr_alloc*sizeof(double*));
+ for (dp=data+r;dp<data+nr_alloc;dp++){
+ *dp=(double*)malloc(ncols*sizeof(double));
+ }
+ }
+ } while (1);
+
+ if (dest==NULL){
+ dest_local=(cf_data*)malloc(sizeof(cf_data));
+ }else{
+ dest_local=(cf_data*)dest;
+ }
+ ((cf_data *) dest_local)->ncols=ncols;
+ ((cf_data *) dest_local)->nrows=r;
+ ((cf_data *) dest_local)->nralloc=nr_alloc;
+ ((cf_data *) dest_local)->clabels=clabels;
+ ((cf_data *) dest_local)->data=data;
+
+ return (void *) dest_local;
+}/*}}}*/
+
+
+void *cf_read_bin(void *fp, void *dest, unsigned int FLAGS){
+ return NULL;
+
+}
diff --git a/fabio/fabioformats.py b/fabio/fabioformats.py
new file mode 100644
index 0000000..ba23a7b
--- /dev/null
+++ b/fabio/fabioformats.py
@@ -0,0 +1,173 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE
+
+"""
+Provide an API to all the supported formats
+"""
+
+__author__ = "Valentin Valls"
+__contact__ = "valentin.valls@esrf.eu"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "27/07/2017"
+__status__ = "stable"
+__docformat__ = 'restructuredtext'
+
+import logging
+_logger = logging.getLogger(__name__)
+
+from . import fabioimage
+
+# Note: The order of the import is important for the import sequence
+from . import edfimage # noqa
+from . import adscimage # noqa
+from . import tifimage # noqa
+from . import marccdimage # noqa
+from . import mar345image # noqa
+from . import fit2dmaskimage # noqa
+from . import brukerimage # noqa
+from . import bruker100image # noqa
+from . import pnmimage # noqa
+from . import GEimage # noqa
+from . import OXDimage # noqa
+from . import dm3image # noqa
+from . import HiPiCimage # noqa
+from . import pilatusimage # noqa
+from . import fit2dspreadsheetimage # noqa
+from . import kcdimage # noqa
+from . import cbfimage # noqa
+from . import xsdimage # noqa
+from . import binaryimage # noqa
+from . import pixiimage # noqa
+from . import raxisimage # noqa
+from . import numpyimage # noqa
+from . import eigerimage # noqa
+from . import hdf5image # noqa
+from . import fit2dimage # noqa
+from . import speimage # noqa
+from . import jpegimage # noqa
+from . import jpeg2kimage # noqa
+from . import mpaimage # noqa
+
+
+def get_all_classes():
+ """Returns the list of supported codec identified by there fabio classes.
+
+ :rtype: list"""
+ return fabioimage.FabioImage.registry.values()
+
+
+def get_classes(reader=None, writer=None):
+ """
+ Return available codecs according to filter
+
+ :param bool reader: True to reach codecs providing reader or False to
+ provide codecs which do not provided reader. If None, reader feature is
+ not filtered
+ :param bool writer: True to reach codecs providing writer or False to
+ provide codecs which do not provided writer. If None, writer feature is
+ not filtered
+ :rtype: list
+ """
+ formats = []
+ for f in get_all_classes():
+ # assert that if the read is redefined, then there is a reader
+ has_reader = f.read.__module__ != fabioimage.__name__
+ # assert that if the write is redefined, then there is a writer
+ has_writer = f.write.__module__ != fabioimage.__name__
+
+ include_format = True
+ if reader is not None and reader != has_reader:
+ include_format = False
+ if writer is not None and writer != has_writer:
+ include_format = False
+ if include_format:
+ formats.append(f)
+ return formats
+
+
+def get_class_by_name(format_name):
+ """
+ Get a format class by its name.
+
+ :param str format_name: Format name, for example, "edfimage"
+ :return: instance of the new class
+ """
+ if format_name in fabioimage.FabioImage.registry:
+ return fabioimage.FabioImage.registry[format_name]
+ else:
+ return None
+
+
+_extension_cache = None
+"""Cache extension mapping"""
+
+
+def _get_extension_mapping():
+ """Returns a dictionary mapping file extension to the list of supported
+ formats. The result is cached, do not edit it
+
+ :rtype: dict
+ """
+ global _extension_cache
+ if _extension_cache is None:
+ _extension_cache = {}
+ for codec in get_all_classes():
+ for ext in codec.DEFAULT_EXTENTIONS:
+ if ext not in _extension_cache:
+ _extension_cache[ext] = []
+ _extension_cache[ext].append(codec)
+ return _extension_cache
+
+
+def get_classes_from_extension(extension):
+ """
+ Returns list of supported file format classes from a file extension
+
+ :param str extension: File extension, for example "edf"
+ :return: fabio image class
+ """
+ mapping = _get_extension_mapping()
+ extension = extension.lower()
+ if extension in mapping:
+ # clone the list
+ return list(mapping[extension])
+ else:
+ return []
+
+
+def is_extension_supported(extension):
+ """
+ Returns true is the extension is supported.
+
+ :param str format_name: Format name, for example, "edfimage"
+ :return: instance of the new class
+ """
+ mapping = _get_extension_mapping()
+ extension = extension.lower()
+ return extension in mapping
diff --git a/fabio/fabioimage.py b/fabio/fabioimage.py
new file mode 100644
index 0000000..ac93a24
--- /dev/null
+++ b/fabio/fabioimage.py
@@ -0,0 +1,604 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+"""
+
+Authors: Henning O. Sorensen & Erik Knudsen
+ Center for Fundamental Research: Metal Structures in Four Dimensions
+ Risoe National Laboratory
+ Frederiksborgvej 399
+ DK-4000 Roskilde
+ email:erik.knudsen@risoe.dk
+
+ and Jon Wright, Jerome Kieffer: ESRF
+
+"""
+# get ready for python3
+from __future__ import with_statement, print_function, absolute_import, division
+
+__authors__ = ["Henning O. Sorensen", "Erik Knudsen", "Jon Wright", "Jérôme Kieffer"]
+__contact__ = "jerome.kieffer@esrf.fr"
+__license__ = "MIT"
+__copyright__ = "ESRF"
+__date__ = "29/08/2017"
+
+import os
+import logging
+import sys
+import tempfile
+logger = logging.getLogger(__name__)
+import numpy
+from . import fabioutils, converters
+from .fabioutils import six, OrderedDict
+from .utils import pilutils
+
+
+class FabioMeta(type):
+ """ Metaclass used to register all image classes inheriting from fabioImage
+ """
+ # we use __init__ rather than __new__ here because we want
+ # to modify attributes of the class *after* they have been
+ # created
+ def __init__(cls, name, bases, dct):
+ if cls.codec_name() != "fabioimage":
+ cls.registry[cls.codec_name()] = cls
+ super(FabioMeta, cls).__init__(name, bases, dct)
+
+
+class FabioImage(six.with_metaclass(FabioMeta, object)):
+ """A common object for images in fable
+
+ Contains a numpy array (.data) and dict of meta data (.header)
+ """
+
+ _need_a_seek_to_read = False
+ _need_a_real_file = False
+ registry = OrderedDict() # list of child classes ...
+
+ RESERVED_HEADER_KEYS = []
+ # List of header keys which are reserved by the file format
+
+ @classmethod
+ def factory(cls, name):
+ """A kind of factory... for image_classes
+
+ :param str name: name of the class to instantiate
+ :return: an instance of the class
+ :rtype: fabio.fabioimage.FabioImage
+ """
+ name = name.lower()
+ obj = None
+ if name in cls.registry:
+ obj = cls.registry[name]()
+ else:
+ msg = ("FileType %s is unknown !, "
+ "please check if the filename exists or select one from %s" % (name, cls.registry.keys()))
+ logger.debug(msg)
+ raise RuntimeError(msg)
+ return obj
+
+ @classmethod
+ def codec_name(cls):
+ """Returns the internal name of the codec"""
+ return cls.__name__.lower()
+
+ def __init__(self, data=None, header=None):
+ """Set up initial values
+
+ :param data: numpy array of values
+ :param header: dict or ordereddict with metadata
+ """
+ self._classname = None
+ self._dim1 = self._dim2 = self._bpp = 0
+ self._bytecode = None
+ self._file = None
+ if type(data) in fabioutils.StringTypes:
+ raise Exception("fabioimage.__init__ bad argument - " +
+ "data should be numpy array")
+ self.data = self.check_data(data)
+ self.pilimage = None
+ self.header = self.check_header(header)
+ # cache for image statistics
+ self.mean = self.maxval = self.stddev = self.minval = None
+ # Cache roi
+ self.roi = None
+ self.area_sum = None
+ self.slice = None
+ # New for multiframe files
+ self.nframes = 1
+ self.currentframe = 0
+ self.filename = None
+ self.filenumber = None
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *arg):
+ # TODO: inspace type, value and traceback
+ if self._file and not self._file.closed:
+ self._file.close()
+
+ def get_header_keys(self):
+ return list(self.header.keys())
+
+ def set_header_keys(self, value):
+ pass
+
+ header_keys = property(get_header_keys, set_header_keys)
+
+ def get_dim1(self):
+ "Getter for dim1: data superseeds _dim1"
+ if self.data is not None:
+ try:
+ return self.data.shape[-1]
+ except IndexError as err:
+ logger.error(err)
+ logger.debug(self.data)
+ return self._dim1
+ else:
+ return self._dim1
+
+ def set_dim1(self, value):
+ "Setter for dim1"
+ self._dim1 = value
+
+ dim1 = property(get_dim1, set_dim1)
+
+ def get_dim2(self):
+ "Getter for dim2: data superseeds _dim2"
+ if self.data is not None:
+ try:
+ return self.data.shape[-2]
+ except IndexError as err:
+ logger.error(err)
+ logger.debug(self.data)
+ return self._dim2
+ else:
+ return self._dim2
+
+ def set_dim2(self, value):
+ "Setter for dim2"
+ self._dim2 = value
+
+ dim2 = property(get_dim2, set_dim2)
+
+ def get_bpp(self):
+ "Getter for bpp: data superseeds _bpp"
+ if self.data is not None:
+ return numpy.dtype(self.data.dtype).itemsize
+ elif self._bytecode is not None:
+ return numpy.dtype(self._bytecode).itemsize
+ else:
+ return self._bpp
+
+ def set_bpp(self, value):
+ "Setter for bpp"
+ self._bpp = value
+ bpp = property(get_bpp, set_bpp)
+
+ def get_bytecode(self):
+ "Getter for bpp: data superseeds _bytecode"
+ if self.data is not None:
+ return self.data.dtype.type
+ else:
+ return self._bytecode
+
+ def set_bytecode(self, value):
+ "Setter for bpp"
+ self._bytecode = value
+ bytecode = property(get_bytecode, set_bytecode)
+
+ @staticmethod
+ def check_header(header=None):
+ """
+ Empty for fabioimage but may be populated by others classes
+
+ :param header: dict like object
+ :return: Ordered dict
+ """
+ if header is None:
+ return OrderedDict()
+ else:
+ return OrderedDict(header)
+
+ @staticmethod
+ def check_data(data=None):
+ """
+ Empty for fabioimage but may be populated by others classes,
+ especially for format accepting only integers
+
+ :param data: array like
+ :return: numpy array or None
+ """
+ if data is None:
+ return None
+ else:
+ return data
+
+ def getclassname(self):
+ """
+ Retrieves the name of the class
+ :return: the name of the class
+ """
+ if self._classname is None:
+ self._classname = str(self.__class__).replace("<class '", "").replace("'>", "").split(".")[-1]
+ return self._classname
+ classname = property(getclassname)
+
+ def getframe(self, num):
+ """ returns the file numbered 'num' in the series as a fabioimage """
+ if self.nframes == 1:
+ # single image per file
+ from .openimage import openimage
+ return openimage(fabioutils.jump_filename(self.filename, num))
+ raise Exception("getframe out of range")
+
+ def previous(self):
+ """ returns the previous file in the series as a fabioimage """
+ from .openimage import openimage
+ return openimage(fabioutils.previous_filename(self.filename))
+
+ def next(self):
+ """Returns the next file in the series as a fabioimage
+
+ :raise IOError: When there is no next file in the series.
+ """
+ from .openimage import openimage
+ return openimage(
+ fabioutils.next_filename(self.filename))
+
+ def toPIL16(self, filename=None):
+ """
+ Convert to Python Imaging Library 16 bit greyscale image
+ """
+ if filename:
+ self.read(filename)
+ if self.pilimage is None:
+ # Create and cache the result
+ self.pilimage = pilutils.create_pil_16(self.data)
+ return self.pilimage
+
+ def getheader(self):
+ """ returns self.header """
+ return self.header
+
+ def getmax(self):
+ """ Find max value in self.data, caching for the future """
+ if self.maxval is None:
+ if self.data is not None:
+ self.maxval = self.data.max()
+ return self.maxval
+
+ def getmin(self):
+ """ Find min value in self.data, caching for the future """
+ if self.minval is None:
+ if self.data is not None:
+ self.minval = self.data.min()
+ return self.minval
+
+ def make_slice(self, coords):
+ """
+ Convert a len(4) set of coords into a len(2)
+ tuple (pair) of slice objects
+ the latter are immutable, meaning the roi can be cached
+ """
+ assert len(coords) == 4
+ if len(coords) == 4:
+ # fabian edfimage preference
+ if coords[0] > coords[2]:
+ coords[0:3:2] = [coords[2], coords[0]]
+ if coords[1] > coords[3]:
+ coords[1:4:2] = [coords[3], coords[1]]
+ # in fabian: normally coordinates are given as (x,y) whereas
+ # a matrix is given as row,col
+ # also the (for whichever reason) the image is flipped upside
+ # down wrt to the matrix hence these tranformations
+ fixme = (self.dim2 - coords[3] - 1,
+ coords[0],
+ self.dim2 - coords[1] - 1,
+ coords[2])
+ return (slice(int(fixme[0]), int(fixme[2]) + 1),
+ slice(int(fixme[1]), int(fixme[3]) + 1))
+
+ def integrate_area(self, coords):
+ """
+ Sums up a region of interest
+ if len(coords) == 4 -> convert coords to slices
+ if len(coords) == 2 -> use as slices
+ floor -> ? removed as unused in the function.
+ """
+ if self.data is None:
+ # This should return NAN, not zero ?
+ return 0
+ if len(coords) == 4:
+ sli = self.make_slice(coords)
+ elif len(coords) == 2 and isinstance(coords[0], slice) and \
+ isinstance(coords[1], slice):
+ sli = coords
+
+ if sli == self.slice and self.area_sum is not None:
+ pass
+ elif sli == self.slice and self.roi is not None:
+ self.area_sum = self.roi.sum(dtype=numpy.float)
+ else:
+ self.slice = sli
+ self.roi = self.data[self.slice]
+ self.area_sum = self.roi.sum(dtype=numpy.float)
+ return self.area_sum
+
+ def getmean(self):
+ """ return the mean """
+ if self.mean is None:
+ self.mean = self.data.mean(dtype=numpy.double)
+ return self.mean
+
+ def getstddev(self):
+ """ return the standard deviation """
+ if self.stddev is None:
+ self.stddev = self.data.std(dtype=numpy.double)
+ return self.stddev
+
+ def add(self, other):
+ """
+ Add another Image - warning, does not clip to 16 bit images by default
+ """
+ if not hasattr(other, 'data'):
+ logger.warning('edfimage.add() called with something that '
+ 'does not have a data field')
+ assert self.data.shape == other.data.shape, 'incompatible images - Do they have the same size?'
+ self.data = self.data + other.data
+ self.resetvals()
+
+ def resetvals(self):
+ """ Reset cache - call on changing data """
+ self.mean = self.stddev = self.maxval = self.minval = None
+ self.roi = self.slice = self.area_sum = None
+
+ def rebin(self, x_rebin_fact, y_rebin_fact, keep_I=True):
+ """
+ Rebin the data and adjust dims
+ :param int x_rebin_fact: x binning factor
+ :param int y_rebin_fact: y binning factor
+ :param bool keep_I: shall the signal increase ?
+ """
+ if self.data is None:
+ raise Exception('Please read in the file you wish to rebin first')
+
+ if (self.dim1 % x_rebin_fact != 0) or (self.dim2 % y_rebin_fact != 0):
+ raise RuntimeError('image size is not divisible by rebin factor - '
+ 'skipping rebin')
+ else:
+ dataIn = self.data.astype("float64")
+ shapeIn = self.data.shape
+ shapeOut = (shapeIn[0] // y_rebin_fact, shapeIn[1] // x_rebin_fact)
+ binsize = y_rebin_fact * x_rebin_fact
+ if binsize < 50: # method faster for small binning (4x4)
+ out = numpy.zeros(shapeOut, dtype="float64")
+ for j in range(x_rebin_fact):
+ for i in range(y_rebin_fact):
+ out += dataIn[i::y_rebin_fact, j::x_rebin_fact]
+ else: # method faster for large binning (8x8)
+ temp = self.data.astype("float64")
+ temp.shape = (shapeOut[0], y_rebin_fact, shapeOut[1], x_rebin_fact)
+ out = temp.sum(axis=3).sum(axis=1)
+ self.resetvals()
+ if keep_I:
+ self.data = (out / (y_rebin_fact * x_rebin_fact)).astype(self.data.dtype)
+ else:
+ self.data = out.astype(self.data.dtype)
+
+ self.dim1 = self.dim1 / x_rebin_fact
+ self.dim2 = self.dim2 / y_rebin_fact
+
+ # update header
+ self.update_header()
+
+ def write(self, fname):
+ """
+ To be overwritten - write the file
+ """
+ module = sys.modules[self.__class__.__module__]
+ raise NotImplementedError("Writing %s format is not implemented" % module.__name__)
+
+ def save(self, fname):
+ 'wrapper for write'
+ self.write(fname)
+
+ def readheader(self, filename):
+ """
+ Call the _readheader function...
+ """
+ # Override the needs asserting that all headers can be read via python modules
+ save_state = self._need_a_real_file, self._need_a_seek_to_read
+ self._need_a_real_file, self._need_a_seek_to_read = False, False
+ fin = self._open(filename)
+ self._readheader(fin)
+ fin.close()
+ self._need_a_real_file, self._need_a_seek_to_read = save_state
+
+ def _readheader(self, fik_obj):
+ """
+ Must be overridden in classes
+ """
+ raise Exception("Class has not implemented _readheader method yet")
+
+ def update_header(self, **kwds):
+ """
+ update the header entries
+ by default pass in a dict of key, values.
+ """
+ self.header.update(kwds)
+
+ def read(self, filename, frame=None):
+ """
+ To be overridden - fill in self.header and self.data
+ """
+ raise Exception("Class has not implemented read method yet")
+# return self
+
+ def load(self, *arg, **kwarg):
+ "Wrapper for read"
+ return self.read(*arg, **kwarg)
+
+ def readROI(self, filename, frame=None, coords=None):
+ """
+ Method reading Region of Interest.
+ This implementation is the trivial one, just doing read and crop
+ """
+ self.read(filename, frame)
+ if len(coords) == 4:
+ self.slice = self.make_slice(coords)
+ elif len(coords) == 2 and isinstance(coords[0], slice) and \
+ isinstance(coords[1], slice):
+ self.slice = coords
+ else:
+ logger.warning('readROI: Unable to understand Region Of Interest: got %s', coords)
+ self.roi = self.data[self.slice]
+ return self.roi
+
+ def _open(self, fname, mode="rb"):
+ """
+ Try to handle compressed files, streams, shared memory etc
+ Return an object which can be used for "read" and "write"
+ ... FIXME - what about seek ?
+ """
+
+ if hasattr(fname, "read") and hasattr(fname, "write"):
+ # It is already something we can use
+ if "name" in dir(fname):
+ self.filename = fname.name
+ else:
+ self.filename = "stream"
+ try:
+ setattr(fname, "name", self.filename)
+ except AttributeError:
+ # cStringIO
+ logger.warning("Unable to set filename attribute to stream (cStringIO?) of type %s" % type(fname))
+ return fname
+
+ fileObject = None
+ self.filename = fname
+ self.filenumber = fabioutils.extract_filenumber(fname)
+
+ if isinstance(fname, fabioutils.StringTypes):
+ comp_type = os.path.splitext(fname)[-1]
+ if comp_type == ".gz":
+ fileObject = self._compressed_stream(fname,
+ fabioutils.COMPRESSORS['.gz'],
+ fabioutils.GzipFile,
+ mode)
+ elif comp_type == '.bz2':
+ fileObject = self._compressed_stream(fname,
+ fabioutils.COMPRESSORS['.bz2'],
+ fabioutils.BZ2File,
+ mode)
+ #
+ # Here we return the file even though it may be bzipped or gzipped
+ # but named incorrectly...
+ #
+ # FIXME - should we fix that or complain about the daft naming?
+ else:
+ fileObject = fabioutils.File(fname, mode)
+ if "name" not in dir(fileObject):
+ fileObject.name = fname
+ self._file = fileObject
+ return fileObject
+
+ def _compressed_stream(self,
+ fname,
+ system_uncompress,
+ python_uncompress,
+ mode='rb'):
+ """
+ Try to transparently handle gzip / bzip2 without always getting python
+ performance
+ """
+ # assert that python modules are always OK based on performance benchmark
+ # Try to fix the way we are using them?
+ fobj = None
+ if self._need_a_real_file and mode[0] == "r":
+ fo = python_uncompress(fname, mode)
+ # problem when not administrator under certain flavors of windows
+ tmpfd, tmpfn = tempfile.mkstemp()
+ os.close(tmpfd)
+ fobj = fabioutils.File(tmpfn, "w+b", temporary=True)
+ fobj.write(fo.read())
+ fo.close()
+ fobj.seek(0)
+ elif self._need_a_seek_to_read and mode[0] == "r":
+ fo = python_uncompress(fname, mode)
+ fobj = fabioutils.BytesIO(fo.read(), fname, mode)
+ else:
+ fobj = python_uncompress(fname, mode)
+ return fobj
+
+ def convert(self, dest):
+ """
+ Convert a fabioimage object into another fabioimage object (with possible conversions)
+ :param dest: destination type "EDF", "edfimage" or the class itself
+ :return: instance of the new class
+ """
+ other = None
+ if type(dest) in fabioutils.StringTypes:
+ dest = dest.lower()
+ if dest.endswith("image"):
+ dest = dest[:-5]
+ if dest + "image" in self.registry:
+ other = self.factory(dest + "image")
+ else:
+ # load modules which could be suitable:
+ from . import fabioformats
+ for class_ in fabioformats.get_classes_from_extension(dest):
+ try:
+ other = class_()
+ except:
+ pass
+
+ elif isinstance(dest, self.__class__):
+ other = dest.__class__()
+ elif ("__new__" in dir(dest)) and isinstance(dest(), fabioimage):
+ other = dest()
+ else:
+ logger.error("Unrecognized destination format: %s " % dest)
+ return self
+ other.data = converters.convert_data(self.classname, other.classname, self.data)
+ other.header = converters.convert_header(self.classname, other.classname, self.header)
+ return other
+
+ def __iter__(self):
+ current_image = self
+ while True:
+ yield current_image
+ try:
+ current_image = current_image.next()
+ except IOError:
+ raise StopIteration
+
+
+fabioimage = FabioImage
diff --git a/fabio/fabioutils.py b/fabio/fabioutils.py
new file mode 100644
index 0000000..689241e
--- /dev/null
+++ b/fabio/fabioutils.py
@@ -0,0 +1,693 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+#
+"""General purpose utilities functions for fabio
+
+"""
+from __future__ import absolute_import, print_function, with_statement, division
+
+__author__ = "Jérôme Kieffer"
+__contact__ = "Jerome.Kieffer@ESRF.eu"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "28/07/2017"
+__status__ = "stable"
+__docformat__ = 'restructuredtext'
+
+import re
+import os
+import logging
+import sys
+import json
+logger = logging.getLogger(__name__)
+
+from .third_party.ordereddict import OrderedDict as _OrderedDict
+from .third_party import six
+
+if six.PY2:
+ bytes_ = str
+ FileIO = file
+ StringTypes = (str, unicode)
+ to_str = str
+else:
+ bytes_ = bytes
+ StringTypes = (str, bytes)
+ unicode = str
+ from io import FileIO
+ to_str = lambda s: str(s, "ASCII")
+
+from .compression import bz2, gzip, COMPRESSORS
+import traceback
+from math import ceil
+
+if sys.version_info < (3, 3):
+ from threading import _Semaphore as _Semaphore
+else:
+ from threading import Semaphore as _Semaphore
+
+dictAscii = {None: [chr(i) for i in range(32, 127)]}
+
+
+def deprecated(func):
+ """
+ used to deprecate a function/method: prints a lot of warning messages to
+ enforce the modification of the code
+ """
+ def wrapper(*arg, **kw):
+ """
+ decorator that deprecates the use of a function
+ """
+ logger.warning("%s is Deprecated !!! %s" % (func.func_name, os.linesep.join([""] + traceback.format_stack()[:-1])))
+ return func(*arg, **kw)
+ return wrapper
+
+
+def pad(mystr, pattern=" ", size=80):
+ """
+ Performs the padding of the string to the right size with the right pattern
+
+ :param mystr: input string
+ :param pattern: the filling pattern
+ :param size: the size of the block
+ :return: the padded string to a multiple of size
+ """
+ size = int(size)
+ padded_size = (len(mystr) + size - 1) // size * size
+ if len(pattern) == 1:
+ return mystr.ljust(padded_size, pattern)
+ else:
+ return (mystr + pattern * int(ceil(float(padded_size - len(mystr)) / len(pattern))))[:padded_size]
+
+
+def getnum(name):
+ """
+ # try to figure out a file number
+ # guess it starts at the back
+ """
+ _stem, num, _post_num = numstem(name)
+ try:
+ return int(num)
+ except ValueError:
+ return None
+
+
+class FilenameObject(object):
+ """
+ The 'meaning' of a filename ...
+ """
+ def __init__(self, stem=None,
+ num=None,
+ directory=None,
+ format_=None,
+ extension=None,
+ postnum=None,
+ digits=4,
+ filename=None):
+ """
+ This class can either be instanciated by a set of parameters like directory, prefix, num, extension, ...
+
+ :param stem: the stem is a kind of prefix (str)
+ :param num: image number in the serie (int)
+ :param directory: name of the directory (str)
+ :param format_: ??
+ :param extension:
+ :param postnum:
+ :param digits: Number of digits used to print num
+
+ Alternative constructor:
+
+ :param filename: fullpath of an image file to be deconstructed into directory, prefix, num, extension, ...
+
+ """
+ self.stem = stem
+ self.num = num
+ self.format = format_
+ self.extension = extension
+ self.digits = digits
+ self.postnum = postnum
+ self.directory = directory
+ self.compressed = None
+ if filename is not None:
+ self.deconstruct_filename(filename)
+
+ def str(self):
+ """ Return a string representation """
+ fmt = "stem %s, num %s format %s extension %s " + \
+ "postnum = %s digits %s dir %s"
+ attrs = [self.stem,
+ self.num,
+ self.format,
+ self.extension,
+ self.postnum,
+ self.digits,
+ self.directory]
+ return fmt % tuple([str(x) for x in attrs])
+ __repr__ = str
+
+ def tostring(self):
+ """
+ convert yourself to a string
+ """
+ name = self.stem
+ if self.digits is not None and self.num is not None:
+ fmt = "%0" + str(self.digits) + "d"
+ name += fmt % self.num
+ if self.postnum is not None:
+ name += self.postnum
+ if self.extension is not None:
+ name += self.extension
+ if self.directory is not None:
+ name = os.path.join(self.directory, name)
+ return name
+
+ def deconstruct_filename(self, filename):
+ """
+ Break up a filename to get image type and number
+ """
+ from . import fabioformats
+ direc, name = os.path.split(filename)
+ direc = direc or None
+ parts = name.split(".")
+ compressed = False
+ stem = parts[0]
+ extn = ""
+ postnum = ""
+ ndigit = 4
+ num = None
+ typ = None
+ if parts[-1].lower() in ["gz", "bz2"]:
+ extn = "." + parts[-1]
+ parts = parts[:-1]
+ compressed = True
+ codec_classes = fabioformats.get_classes_from_extension(parts[-1])
+ if len(codec_classes) > 0:
+ typ = []
+ for codec in codec_classes:
+ name = codec.codec_name()
+ if name.endswith("image"):
+ name = name[:-5]
+ typ.append(name)
+ extn = "." + parts[-1] + extn
+ try:
+ stem, numstring, postnum = numstem(".".join(parts[:-1]))
+ num = int(numstring)
+ ndigit = len(numstring)
+ except Exception as err:
+ # There is no number - hence make num be None, not 0
+ logger.debug("l242: %s" % err)
+ num = None
+ stem = "".join(parts[:-1])
+ else:
+ # Probably two type left
+ if len(parts) == 1:
+ # Probably GE format stem_numb
+ parts2 = parts[0].split("_")
+ if parts2[-1].isdigit():
+ num = int(parts2[-1])
+ ndigit = len(parts2[-1])
+ typ = ['GE']
+ stem = "_".join(parts2[:-1]) + "_"
+ else:
+ try:
+ num = int(parts[-1])
+ ndigit = len(parts[-1])
+ typ = ['bruker']
+ stem = ".".join(parts[:-1]) + "."
+ except Exception as err:
+ logger.debug("l262: %s" % err)
+ typ = None
+ extn = "." + parts[-1] + extn
+ numstring = ""
+ try:
+ stem, numstring, postnum = numstem(".".join(parts[:-1]))
+ except Exception as err:
+ logger.debug("l269: %s" % err)
+ raise
+ if numstring.isdigit():
+ num = int(numstring)
+ ndigit = len(numstring)
+ # raise Exception("Cannot decode "+filename)
+
+ self.stem = stem
+ self.num = num
+ self.directory = direc
+ self.format = typ
+ self.extension = extn
+ self.postnum = postnum
+ self.digits = ndigit
+ self.compressed = compressed
+
+
+def numstem(name):
+ """ cant see how to do without reversing strings
+ Match 1 or more digits going backwards from the end of the string
+ """
+ reg = re.compile(r"^(.*?)(-?[0-9]{0,9})(\D*)$")
+ # reg = re.compile("""(\D*)(\d\d*)(\w*)""")
+ try:
+ res = reg.match(name).groups()
+ # res = reg.match(name[::-1]).groups()
+ # return [ r[::-1] for r in res[::-1]]
+ if len(res[0]) == len(res[1]) == 0: # Hack for file without number
+ return [res[2], '', '']
+ return [r for r in res]
+ except AttributeError: # no digits found
+ return [name, "", ""]
+
+
+# @deprecated
+def deconstruct_filename(filename):
+ """
+ Function for backward compatibility.
+ Deprecated
+ """
+ return FilenameObject(filename=filename)
+
+
+def construct_filename(filename, frame=None):
+ "Try to construct the filename for a given frame"
+ fobj = FilenameObject(filename=filename)
+ if frame is not None:
+ fobj.num = frame
+ return fobj.tostring()
+
+
+def next_filename(name, padding=True):
+ """ increment number """
+ fobj = FilenameObject(filename=name)
+ fobj.num += 1
+ if not padding:
+ fobj.digits = 0
+ return fobj.tostring()
+
+
+def previous_filename(name, padding=True):
+ """ decrement number """
+ fobj = FilenameObject(filename=name)
+ fobj.num -= 1
+ if not padding:
+ fobj.digits = 0
+ return fobj.tostring()
+
+
+def jump_filename(name, num, padding=True):
+ """ jump to number """
+ fobj = FilenameObject(filename=name)
+ fobj.num = num
+ if not padding:
+ fobj.digits = 0
+ return fobj.tostring()
+
+
+def extract_filenumber(name):
+ """ extract file number """
+ fobj = FilenameObject(filename=name)
+ return fobj.num
+
+
+def isAscii(name, listExcluded=None):
+ """
+ :param name: string to check
+ :param listExcluded: list of char or string excluded.
+ :return: True of False whether name is pure ascii or not
+ """
+ isascii = None
+ try:
+ name.encode("ASCII")
+ except UnicodeDecodeError:
+ isascii = False
+ else:
+ if listExcluded:
+ isascii = not(any(bad in name for bad in listExcluded))
+ else:
+ isascii = True
+ return isascii
+
+
+def toAscii(name, excluded=None):
+ """
+ :param name: string to check
+ :param excluded: tuple of char or string excluded (not list: they are mutable).
+ :return: the name with all non valid char removed
+ """
+ if excluded not in dictAscii:
+ ascii = dictAscii[None][:]
+ for i in excluded:
+ if i in ascii:
+ ascii.remove(i)
+ else:
+ logger.error("toAscii: %s not in ascii table" % i)
+ dictAscii[excluded] = ascii
+ else:
+ ascii = dictAscii[excluded]
+ out = [i for i in str(name) if i in ascii]
+ return "".join(out)
+
+
+def nice_int(s):
+ """
+ Workaround that int('1.0') raises an exception
+
+ :param s: string to be converted to integer
+ """
+ try:
+ return int(s)
+ except ValueError:
+ return int(float(s))
+
+
+class BytesIO(six.BytesIO):
+ """
+ just an interface providing the name and mode property to a BytesIO
+
+ BugFix for MacOSX mainly
+ """
+ def __init__(self, data, fname=None, mode="r"):
+ six.BytesIO.__init__(self, data)
+ if "closed" not in dir(self):
+ self.closed = False
+ if fname is None:
+ self.name = "fabioStream"
+ else:
+ self.name = fname
+ self.mode = mode
+ self.lock = _Semaphore()
+ self.__size = None
+
+ def getSize(self):
+ if self.__size is None:
+ logger.debug("Measuring size of %s" % self.name)
+ with self.lock:
+ pos = self.tell()
+ self.seek(0, os.SEEK_END)
+ self.__size = self.tell()
+ self.seek(pos)
+ return self.__size
+
+ def setSize(self, size):
+ self.__size = size
+ size = property(getSize, setSize)
+
+
+class File(FileIO):
+ """
+ wrapper for "file" with locking
+ """
+ def __init__(self, name, mode="rb", buffering=0, temporary=False):
+ """file(name[, mode[, buffering]]) -> file object
+
+ Open a file. The mode can be 'r', 'w' or 'a' for reading (default),
+ writing or appending. The file will be created if it doesn't exist
+ when opened for writing or appending; it will be truncated when
+ opened for writing. Add a 'b' to the mode for binary files.
+ Add a '+' to the mode to allow simultaneous reading and writing.
+ If the buffering argument is given, 0 means unbuffered, 1 means line
+ buffered, and larger numbers specify the buffer size. The preferred way
+ to open a file is with the builtin open() function.
+ Add a 'U' to mode to open the file for input with universal newline
+ support. Any line ending in the input file will be seen as a '\n'
+ in Python. Also, a file so opened gains the attribute 'newlines';
+ the value for this attribute is one of None (no newline read yet),
+ '\r', '\n', '\r\n' or a tuple containing all the newline types seen.
+
+ 'U' cannot be combined with 'w' or '+' mode.
+
+ :param temporary: if True, destroy file at close.
+ """
+ if six.PY2:
+ FileIO.__init__(self, name, mode, buffering)
+ else: # for python3 we drop buffering
+ FileIO.__init__(self, name, mode)
+ self.lock = _Semaphore()
+ self.__size = None
+ self.__temporary = temporary
+
+ def __del__(self):
+ """Explicit close at deletion
+ """
+ if hasattr(self, "closed") and not self.closed:
+ self.close()
+
+ def close(self):
+ name = self.name
+ FileIO.close(self)
+ if self.__temporary:
+ try:
+ os.unlink(name)
+ except Exception as err:
+ logger.error("Unable to remove %s: %s" % (name, err))
+ raise(err)
+
+ def getSize(self):
+ if self.__size is None:
+ logger.debug("Measuring size of %s" % self.name)
+ with self.lock:
+ pos = self.tell()
+ self.seek(0, os.SEEK_END)
+ self.__size = self.tell()
+ self.seek(pos)
+ return self.__size
+
+ def setSize(self, size):
+ self.__size = size
+ size = property(getSize, setSize)
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *args):
+ """
+ Close the file.
+ """
+ return FileIO.close(self)
+
+
+class UnknownCompressedFile(File):
+ """
+ wrapper for "File" with locking
+ """
+ def __init__(self, name, mode="rb", buffering=0):
+ logger.warning("No decompressor found for this type of file (are gzip anf bz2 installed ???")
+ File.__init__(self, name, mode, buffering)
+
+ def __del__(self):
+ """Explicit close at deletion
+ """
+ if hasattr(self, "closed") and not self.closed:
+ self.close()
+
+if gzip is None:
+ GzipFile = UnknownCompressedFile
+else:
+ class GzipFile(gzip.GzipFile):
+ """
+ Just a wrapper for gzip.GzipFile providing the correct seek capabilities for python 2.5
+ """
+ def __init__(self, filename=None, mode=None, compresslevel=9, fileobj=None):
+ """
+ Wrapper with locking for constructor for the GzipFile class.
+
+ At least one of fileobj and filename must be given a
+ non-trivial value.
+
+ The new class instance is based on fileobj, which can be a regular
+ file, a StringIO object, or any other object which simulates a file.
+ It defaults to None, in which case filename is opened to provide
+ a file object.
+
+ When fileobj is not None, the filename argument is only used to be
+ included in the gzip file header, which may includes the original
+ filename of the uncompressed file. It defaults to the filename of
+ fileobj, if discernible; otherwise, it defaults to the empty string,
+ and in this case the original filename is not included in the header.
+
+ The mode argument can be any of 'r', 'rb', 'a', 'ab', 'w', or 'wb',
+ depending on whether the file will be read or written. The default
+ is the mode of fileobj if discernible; otherwise, the default is 'rb'.
+ Be aware that only the 'rb', 'ab', and 'wb' values should be used
+ for cross-platform portability.
+
+ The compresslevel argument is an integer from 1 to 9 controlling the
+ level of compression; 1 is fastest and produces the least compression,
+ and 9 is slowest and produces the most compression. The default is 9.
+ """
+ gzip.GzipFile.__init__(self, filename, mode, compresslevel, fileobj)
+ self.lock = _Semaphore()
+ self.__size = None
+
+ def __del__(self):
+ """Explicit close at deletion
+ """
+ if hasattr(self, "closed") and not self.closed:
+ self.close()
+
+ def __repr__(self):
+ return "fabio." + gzip.GzipFile.__repr__(self)
+
+ def measure_size(self):
+ if self.mode == gzip.WRITE:
+ return self.size
+ if self.__size is None:
+ with self.lock:
+ if self.__size is None:
+ if "offset" in dir(self):
+ pos = self.offset
+ elif "tell" in dir(self):
+ pos = self.tell()
+ end_pos = len(gzip.GzipFile.read(self)) + pos
+ self.seek(pos)
+ logger.debug("Measuring size of %s: %s @ %s == %s" % (self.name, end_pos, pos, pos))
+ self.__size = end_pos
+ return self.__size
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *args):
+ """
+ Close the file.
+ """
+ gzip.GzipFile.close(self)
+
+
+if bz2 is None:
+ BZ2File = UnknownCompressedFile
+else:
+ class BZ2File(bz2.BZ2File):
+ "Wrapper with lock"
+ def __init__(self, name, mode='r', buffering=0, compresslevel=9):
+ """
+ BZ2File(name [, mode='r', compresslevel=9]) -> file object
+
+ Open a bz2 file. The mode can be 'r' or 'w', for reading (default) or
+ writing. When opened for writing, the file will be created if it doesn't
+ exist, and truncated otherwise.
+
+ If compresslevel is given, must be a number between 1 and 9.
+
+ Add a 'U' to mode to open the file for input with universal newline
+ support. Any line ending in the input file will be seen as a '\n' in
+ Python. Also, a file so opened gains the attribute 'newlines'; the value
+ for this attribute is one of None (no newline read yet), '\r', '\n',
+ '\r\n' or a tuple containing all the newline types seen. Universal
+ newlines are available only when reading.
+ """
+ bz2.BZ2File.__init__(self, name, mode, buffering, compresslevel)
+ self.lock = _Semaphore()
+ self.__size = None
+
+ def __del__(self):
+ """Explicit close at deletion
+ """
+ if hasattr(self, "closed") and not self.closed:
+ self.close()
+
+ def getSize(self):
+ if self.__size is None:
+ logger.debug("Measuring size of %s" % self.name)
+ with self.lock:
+ pos = self.tell()
+ _ = self.read()
+ self.__size = self.tell()
+ self.seek(pos)
+ return self.__size
+
+ def setSize(self, value):
+ self.__size = value
+ size = property(getSize, setSize)
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *args):
+ """
+ Close the file at exit
+ """
+ bz2.BZ2File.close(self)
+
+
+class NotGoodReader(RuntimeError):
+ """The reader used is probably not the good one
+ """
+ pass
+
+
+class DebugSemaphore(_Semaphore):
+ """
+ threading.Semaphore like class with helper for fighting dead-locks
+ """
+ write_lock = _Semaphore()
+ blocked = []
+
+ def __init__(self, *arg, **kwarg):
+ _Semaphore.__init__(self, *arg, **kwarg)
+
+ def acquire(self, *arg, **kwarg):
+ if self._Semaphore__value == 0:
+ with self.write_lock:
+ self.blocked.append(id(self))
+ sys.stderr.write(os.linesep.join(["Blocking sem %s" % id(self)] +
+ traceback.format_stack()[:-1] + [""]))
+
+ return _Semaphore.acquire(self, *arg, **kwarg)
+
+ def release(self, *arg, **kwarg):
+ with self.write_lock:
+ uid = id(self)
+ if uid in self.blocked:
+ self.blocked.remove(uid)
+ sys.stderr.write("Released sem %s %s" % (uid, os.linesep))
+ _Semaphore.release(self, *arg, **kwarg)
+
+ def __enter__(self):
+ self.acquire()
+ return self
+
+ def __exit__(self, *arg, **kwarg):
+ self.release()
+
+
+def exists(path):
+ """Test whether a path exists.
+
+ Replaces os.path.exists and handles in addition "::" based URI as defined in
+ http://odo.pydata.org/en/latest/uri.html#separating-parts-with
+
+ :param path: string
+ :return: boolean
+ """
+ return os.path.exists(path.split("::")[0])
+
+
+class OrderedDict(_OrderedDict):
+ """Ordered dictionary with pretty print"""
+ def __repr__(self):
+ return json.dumps(self, indent=2)
diff --git a/fabio/file_series.py b/fabio/file_series.py
new file mode 100644
index 0000000..31eb460
--- /dev/null
+++ b/fabio/file_series.py
@@ -0,0 +1,436 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+
+"""
+
+Authors:
+........
+
+* Henning O. Sorensen & Erik Knudsen
+ Center for Fundamental Research: Metal Structures in Four Dimensions
+ Risoe National Laboratory
+ Frederiksborgvej 399
+ DK-4000 Roskilde
+ email:erik.knudsen@risoe.dk
+* Jon Wright, ESRF
+
+"""
+# Get ready for python3:
+from __future__ import absolute_import, print_function, with_statement, division
+
+
+import logging
+import sys
+logger = logging.getLogger(__name__)
+import traceback as pytraceback
+
+from .fabioutils import FilenameObject, next_filename
+
+from .openimage import openimage
+
+
+def new_file_series0(first_object, first=None, last=None, step=1):
+ """
+ Created from a fabio image
+ first and last are file numbers
+
+ """
+ im = first_object
+ nimages = 0
+ # for counting images
+ if None in (first, last):
+ step = 0
+ total = 1
+ else:
+ total = last - first
+
+ yield im
+ while nimages < total:
+ nimages += step
+ try:
+ newim = im.next()
+ im = newim
+ except Exception as error:
+ pytraceback.print_exc()
+
+ # Skip bad images
+ logger.warning("Got a problem here: %s", error)
+ try:
+ im.filename = next_filename(im.filename)
+ except Exception as error:
+ # KE: This will not work and will throw an exception
+ # fabio.next_filename doesn't understand %nnnn on the end
+ logger.warning("Got another problem here: %s", error)
+ im.filename = next_filename(im.sequencefilename)
+ yield None
+ yield im
+
+
+def new_file_series(first_object, nimages=0, step=1, traceback=False):
+ """
+ A generator function that creates a file series starting from a a fabioimage.
+ Iterates through all images in a file (if more than 1), then proceeds to
+ the next file as determined by fabio.next_filename.
+
+ :param first_object: the starting fabioimage, which will be the first one yielded
+ in the sequence
+ :param nimages: the maximum number of images to consider
+ step: step size, will yield the first and every step'th image until nimages
+ is reached. (e.g. nimages = 5, step = 2 will yield 3 images (0, 2, 4)
+ :param traceback: if True causes it to print a traceback in the event of an
+ exception (missing image, etc.). Otherwise the calling routine can handle
+ the exception as it chooses
+ :param yields: the next fabioimage in the series.
+ In the event there is an exception, it yields the sys.exec_info for the
+ exception instead. sys.exec_info is a tuple:
+ ( exceptionType, exceptionValue, exceptionTraceback )
+ from which all the exception information can be obtained.
+
+ Suggested usage:
+
+ ::
+
+ for obj in new_file_series( ... ):
+ if not isinstance(obj, fabio.fabioimage.fabioimage ):
+ # deal with errors like missing images, non readable files, etc
+ # e.g.
+ traceback.print_exception(obj[0], obj[1], obj[2])
+
+ """
+ im = first_object
+ nprocessed = 0
+ abort = False
+ if nimages > 0:
+ yield im
+ nprocessed += 1
+ while nprocessed < nimages:
+ try:
+ newim = im.next()
+ im = newim
+ retVal = im
+ except Exception as ex:
+ retVal = sys.exc_info()
+ if(traceback):
+ pytraceback.print_exc()
+ # Skip bad images
+ logger.warning("Got a problem here: next() failed %s", ex)
+ # Skip bad images
+ try:
+ im.filename = next_filename(im.filename)
+ except Exception as ex:
+ logger.warning("Got another problem here: next_filename(im.filename) %s", ex)
+ if nprocessed % step == 0:
+ yield retVal
+ # Avoid cyclic references with exc_info ?
+ retVal = None
+ if abort:
+ break
+ nprocessed += 1
+
+
+class file_series(list):
+ """
+ Represents a series of files to iterate
+ has an idea of a current position to do next and prev
+
+ You also get from the list python superclass:
+ append
+ count
+ extend
+ insert
+ pop
+ remove
+ reverse
+ sort
+ """
+ def __init__(self, list_of_strings):
+ """
+ Constructor:
+
+ :param list_of_strings: arg should be a list of strings which are filenames
+
+ """
+ super(file_series, self).__init__(list_of_strings)
+ # track current position in list
+ self._current = 0
+
+ # methods which return a filename
+
+ def first(self):
+ """
+ First image in series
+
+ """
+ return self[0]
+
+ def last(self):
+ """
+ Last in series
+
+ """
+ return self[-1]
+
+ def previous(self):
+ """
+ Prev in a sequence
+
+ """
+ self._current -= 1
+ return self[self._current]
+
+ def current(self):
+ """Current position in a sequence
+
+ """
+ return self[self._current]
+
+ def next(self):
+ """
+ Next in a sequence
+
+ """
+ self._current += 1
+ return self[self._current]
+
+ def jump(self, num):
+ """
+ Goto a position in sequence
+
+ """
+ assert num < len(self) and num > 0, "num out of range"
+ self._current = num
+ return self[self._current]
+
+ def len(self):
+ """
+ Number of files
+
+ """
+ return len(self)
+
+ # Methods which return a fabioimage
+
+ def first_image(self):
+ """
+ First image in a sequence
+
+ :return: fabioimage
+
+ """
+ return openimage(self.first())
+
+ def last_image(self):
+ """
+ Last image in a sequence
+
+ :return: fabioimage
+
+ """
+ return openimage(self.last())
+
+ def next_image(self):
+ """
+ Return the next image
+
+ :return: fabioimage
+
+ """
+ return openimage(self.next())
+
+ def previous_image(self):
+ """
+ Return the previous image
+
+ :return: fabioimage
+
+ """
+ return openimage(self.previous())
+
+ def jump_image(self, num):
+ """
+ Jump to and read image
+
+ :return: fabioimage
+
+ """
+ return openimage(self.jump(num))
+
+ def current_image(self):
+ """
+ Current image in sequence
+
+ :return: fabioimage
+
+ """
+ return openimage(self.current())
+
+ # methods which return a file_object
+
+ def first_object(self):
+ """
+ First image in a sequence
+
+ :return: file_object
+ """
+ return FilenameObject(self.first())
+
+ def last_object(self):
+ """
+ Last image in a sequence
+
+ :return: file_object
+
+ """
+ return FilenameObject(self.last())
+
+ def next_object(self):
+ """
+ Return the next image
+
+ :return: file_object
+
+ """
+ return FilenameObject(self.next())
+
+ def previous_object(self):
+ """
+ Return the previous image
+
+ :return: file_object
+
+ """
+ return FilenameObject(self.previous())
+
+ def jump_object(self, num):
+ """
+ Jump to and read image
+
+ :return: file_object
+
+ """
+ return FilenameObject(self.jump(num))
+
+ def current_object(self):
+ """
+ Current image in sequence
+
+ :return: file_object
+
+ """
+ return FilenameObject(self.current())
+
+
+class numbered_file_series(file_series):
+ """
+ mydata0001.edf = "mydata" + 0001 + ".edf"
+ mydata0002.edf = "mydata" + 0002 + ".edf"
+ mydata0003.edf = "mydata" + 0003 + ".edf"
+ """
+ def __init__(self, stem, first, last, extension,
+ digits=4, padding='Y', step=1):
+ """
+ Constructor
+
+ :param stem: first part of the name
+ :param step: in case of every nth file
+ :param padding: possibility for specifying that numbers are not padded with zeroes up to digits
+
+ """
+ if padding == 'Y':
+ fmt = "%s%0" + str(digits) + "d%s"
+ else:
+ fmt = "%s%i%s"
+
+ super(numbered_file_series, self).__init__([fmt % (stem, i, extension) for i in range(first,
+ last + 1,
+ step)])
+
+
+class filename_series:
+ """ Much like the others, but created from a string filename """
+ def __init__(self, filename):
+ """ create from a filename (String)"""
+ self.obj = FilenameObject(filename)
+
+ def next(self):
+ """ increment number """
+ self.obj.num += 1
+ return self.obj.tostring()
+
+ def previous(self):
+ """ decrement number """
+ self.obj.num -= 1
+ return self.obj.tostring()
+
+ def current(self):
+ """ return current filename string"""
+ return self.obj.tostring()
+
+ def jump(self, num):
+ """ jump to a specific number """
+ self.obj.num = num
+ return self.obj.tostring()
+
+ # image methods
+ def next_image(self):
+ """ returns the next image as a fabioimage """
+ return openimage(self.next())
+
+ def prev_image(self):
+ """ returns the previos image as a fabioimage """
+ return openimage(self.previous())
+
+ def current_image(self):
+ """ returns the current image as a fabioimage"""
+ return openimage(self.current())
+
+ def jump_image(self, num):
+ """ returns the image number as a fabioimage"""
+ return openimage(self.jump(num))
+
+ # object methods
+ def next_object(self):
+ """ returns the next filename as a fabio.FilenameObject"""
+ self.obj.num += 1
+ return self.obj
+
+ def previous_object(self):
+ """ returns the previous filename as a fabio.FilenameObject"""
+ self.obj.num -= 1
+ return self.obj
+
+ def current_object(self):
+ """ returns the current filename as a fabio.FilenameObject"""
+ return self.obj
+
+ def jump_object(self, num):
+ """ returns the filename num as a fabio.FilenameObject"""
+ self.obj.num = num
+ return self.obj
diff --git a/fabio/fit2dimage.py b/fabio/fit2dimage.py
new file mode 100644
index 0000000..3ba6b73
--- /dev/null
+++ b/fabio/fit2dimage.py
@@ -0,0 +1,169 @@
+# coding: utf-8
+#
+# Project: FabIO X-ray image reader
+#
+# Copyright (C) 2010-2016 European Synchrotron Radiation Facility
+# Grenoble, France
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+
+"""FabIO reader for Fit2D binary images
+
+TODO: handle big-endian files
+"""
+# Get ready for python3:
+from __future__ import with_statement, print_function, division
+
+__authors__ = ["Jérôme Kieffer"]
+__contact__ = "jerome.kiefer@esrf.fr"
+__license__ = "MIT"
+__copyright__ = "2016-2016 European Synchrotron Radiation Facility"
+__date__ = "11/08/2017"
+
+import logging
+logger = logging.getLogger(__name__)
+import numpy
+from .fabioimage import FabioImage, OrderedDict
+
+
+def hex_to(stg, type_="int"):
+ """convert a 8-byte-long string (bytes) into an int or a float
+
+ :param stg: bytes string
+ :param str type_: "int" or "float"
+ """
+ value = int(stg, 16)
+ if type_ == "float":
+ value = numpy.array([int("38d1b717", 16)], "int32").view("float32")[0]
+ return value
+
+
+class Fit2dImage(FabioImage):
+ """
+ FabIO image class for Images for XXX detector
+ """
+
+ DESCRIPTION = "Fit2d file format"
+
+ DEFAULT_EXTENTIONS = ["f2d"]
+
+ BUFFER_SIZE = 512 # size of the buffer
+ PIXELS_PER_CHUNK = 128
+ ENC = "ascii"
+
+ def __init__(self, *arg, **kwargs):
+ """
+ Generic constructor
+ """
+ FabioImage.__init__(self, *arg, **kwargs)
+ self.num_block = None
+
+ def _readheader(self, infile):
+ """
+ Read and decode the header of an image:
+
+ :param infile: Opened python file (can be stringIO or bipped file)
+ """
+ # list of header key to keep the order (when writing)
+ header = OrderedDict()
+ self.header = self.check_header()
+
+ while True:
+ line = infile.read(self.BUFFER_SIZE)
+ if len(line) < self.BUFFER_SIZE:
+ break
+ if line[0:1] != b"\\":
+ for block_read in range(2, 16):
+ line = infile.read(self.BUFFER_SIZE)
+ if line[0:1] == b"\\":
+ self.BUFFER_SIZE *= block_read
+ logger.warning("Increase block size to %s ", self.BUFFER_SIZE)
+ infile.seek(0)
+ break
+ else:
+ err = "issue while reading header, expected '\', got %s" % line[0]
+ logger.error(err)
+ raise RuntimeError(err)
+ key, line = line.split(b":", 1)
+ num_block = hex_to(line[:8])
+ # metadatatype = chr(line[8]) if six.PY3 else line[8].decode(self.ENC)
+ metadatatype = line[8:9].decode(self.ENC)
+ key = key[1:].decode(self.ENC)
+ if metadatatype == "s":
+ len_value = hex_to(line[9:17])
+ header[key] = line[17:17 + len_value].decode(self.ENC)
+ elif metadatatype == "r":
+ header[key] = hex_to(line[9:17], "float")
+ elif metadatatype == "i":
+ header[key] = hex_to(line[9:17])
+ elif metadatatype == "a" and num_block != 0: # "a"
+ self.num_block = num_block
+ array_type = line[9:10].decode(self.ENC)
+ dim1 = hex_to(line[26:34])
+ dim2 = hex_to(line[34:42])
+ if array_type == "i":
+ bytecode = "int32"
+ bpp = 4
+ elif array_type == "r":
+ bytecode = "float32"
+ bpp = 4
+ elif array_type == "l":
+ bytecode = "int8"
+ bpp = 1
+ raw = infile.read(self.num_block * self.BUFFER_SIZE)
+ # Fit2d stores 31 pixels per int32
+ i32 = numpy.fromstring(raw, "int32")
+ if numpy.little_endian:
+ # lets's work in big-endian for the moment
+ i32.byteswap(True)
+ r32 = numpy.unpackbits(i32.view("uint8")).reshape((-1, 32))
+ # Remove the sign bit which is the first in big-endian
+ # all pixels are in reverse order in the group of 31
+ r31 = r32[:, -1:0:-1]
+ mask = r31.ravel()[:dim1 * dim2].reshape((dim2, dim1))
+ header[key] = mask
+ continue
+ else:
+ err = "unsupported data type: %s" % array_type
+ logger.error(err)
+ raise RuntimeError(err)
+ raw = infile.read(self.num_block * self.BUFFER_SIZE)
+ decoded = numpy.fromstring(raw, bytecode).reshape((-1, self.BUFFER_SIZE // bpp))
+ # There is a bug in this format: throw away 3/4 of the read data:
+ decoded = decoded[:, :self.PIXELS_PER_CHUNK].ravel()
+ header[key] = decoded[:dim1 * dim2].reshape(dim2, dim1)
+ self.header = header
+
+ def read(self, fname, frame=None):
+ """try to read image
+
+ :param fname: name of the file
+ """
+
+ self.resetvals()
+ with self._open(fname) as infile:
+ self._readheader(infile)
+ self.data = self.header.pop("data_array")
+ return self
+
+
+# this is not compatibility with old code:
+fit2dimage = Fit2dImage
diff --git a/fabio/fit2dmaskimage.py b/fabio/fit2dmaskimage.py
new file mode 100644
index 0000000..8a7c597
--- /dev/null
+++ b/fabio/fit2dmaskimage.py
@@ -0,0 +1,153 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+"""
+Author: Andy Hammersley, ESRF
+Translation into python/fabio: Jon Wright, ESRF.
+Writer: Jérôme Kieffer
+"""
+# Get ready for python3:
+from __future__ import with_statement, print_function
+
+__authors__ = ["Jon Wright", "Jérôme Kieffer"]
+__contact__ = "Jerome.Kieffer@esrf.fr"
+__license__ = "GPLv3+"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__version__ = "06/01/2015"
+
+import numpy
+import sys
+import struct
+from .fabioimage import FabioImage
+if sys.version < '3':
+ bytes = str
+
+
+class Fit2dMaskImage(FabioImage):
+ """ Read and try to write Andy Hammersley's mask format """
+
+ DESCRIPTION = "Fit2d mask file format"
+
+ DEFAULT_EXTENTIONS = ["msk"]
+
+ def _readheader(self, infile):
+ """
+ Read in a header from an already open file
+ """
+ # 1024 bytes gives 256x32 bit integers
+ header = infile.read(1024)
+ for i, j in [(b"M", 0),
+ (b"A", 4),
+ (b"S", 8),
+ (b"K", 12)]:
+ if header[j] != i[0]:
+ raise Exception("Not a fit2d mask file")
+ fit2dhdr = numpy.fromstring(header, numpy.int32)
+ # Enforce little endian
+ if not numpy.little_endian:
+ fit2dhdr.byteswap(True)
+ self._dim1 = fit2dhdr[4] # 1 less than Andy's fortran
+ self._dim2 = fit2dhdr[5]
+
+ def read(self, fname, frame=None):
+ """
+ Read in header into self.header and
+ the data into self.data
+ """
+ fin = self._open(fname)
+ self._readheader(fin)
+ # Compute image size
+ self.bytecode = numpy.uint8
+ self.bpp = numpy.dtype(self.bytecode).itemsize
+
+ # integer division
+ num_ints = (self._dim1 + 31) // 32
+ total = self._dim2 * num_ints * 4
+ data = fin.read(total)
+ assert len(data) == total
+ fin.close()
+
+ # Now to unpack it
+ data = numpy.fromstring(data, numpy.uint8)
+ if not numpy.little_endian:
+ data.byteswap(True)
+
+ data = numpy.reshape(data, (self._dim2, num_ints * 4))
+
+ result = numpy.zeros((self._dim2, num_ints * 4 * 8), numpy.uint8)
+
+ # Unpack using bitwise comparisons to 2**n
+ bits = numpy.ones((1), numpy.uint8)
+ for i in range(8):
+ temp = numpy.bitwise_and(bits, data)
+ result[:, i::8] = temp.astype(numpy.uint8)
+ bits = bits * 2
+ # Extra rows needed for packing odd dimensions
+ spares = num_ints * 4 * 8 - self._dim1
+ if spares == 0:
+ data = numpy.where(result == 0, 0, 1)
+ else:
+ data = numpy.where(result[:, :-spares] == 0, 0, 1)
+ # Transpose appears to be needed to match edf reader (scary??)
+# self.data = numpy.transpose(self.data)
+ self.data = numpy.ascontiguousarray(data, dtype=numpy.uint8).reshape(self._dim2, self._dim1)
+ self.pilimage = None
+ return self
+
+ def write(self, fname):
+ """
+ Try to write a file
+ """
+ header = bytearray(b"\x00" * 1024)
+ header[0] = 77 # M
+ header[4] = 65 # A
+ header[8] = 83 # S
+ header[12] = 75 # K
+ header[24] = 1 # 1
+ header[16:20] = struct.pack("<I", self.dim1)
+ header[20:24] = struct.pack("<I", self.dim2)
+ compact_array = numpy.zeros((self.dim2, ((self.dim1 + 31) // 32) * 4), dtype=numpy.uint8)
+ large_array = numpy.zeros((self.dim2, ((self.dim1 + 31) // 32) * 32), dtype=numpy.uint8)
+ large_array[:self.dim2, :self.dim1] = (self.data != 0)
+ for i in range(8):
+ order = (1 << i)
+ compact_array += large_array[:, i::8] * order
+ with self._open(fname, mode="wb") as outfile:
+ outfile.write(bytes(header))
+ outfile.write(compact_array.tostring())
+
+ @staticmethod
+ def check_data(data=None):
+ if data is None:
+ return None
+ else:
+ return (data != 0).astype(numpy.uint8)
+
+
+fit2dmaskimage = Fit2dMaskImage
diff --git a/fabio/fit2dspreadsheetimage.py b/fabio/fit2dspreadsheetimage.py
new file mode 100644
index 0000000..a03b0f0
--- /dev/null
+++ b/fabio/fit2dspreadsheetimage.py
@@ -0,0 +1,102 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+
+"""
+Read the fit2d ascii image output
+ + Jon Wright, ESRF
+"""
+# Get ready for python3:
+from __future__ import absolute_import, print_function, with_statement, division
+import numpy
+
+from .fabioimage import FabioImage
+
+
+class Fit2dSpreadsheetImage(FabioImage):
+ """
+ Read a fit2d ascii format
+ """
+
+ DESCRIPTION = "Fit2d spreadsheet ascii file format"
+
+ DEFAULT_EXTENTIONS = ["spr"]
+
+ def _readheader(self, infile):
+ """
+
+ TODO : test for minimal attributes?
+ """
+ line = infile.readline()
+ items = line.split()
+ xdim = int(items[0])
+ ydim = int(items[1])
+ self.header['title'] = line
+ self.header['Dim_1'] = xdim
+ self.header['Dim_2'] = ydim
+
+ def read(self, fname, frame=None):
+ """
+ Read in header into self.header and
+ the data into self.data
+ """
+ self.header = self.check_header()
+ self.resetvals()
+ infile = self._open(fname)
+ self._readheader(infile)
+ # Compute image size
+ try:
+ self.dim1 = int(self.header['Dim_1'])
+ self.dim2 = int(self.header['Dim_2'])
+ except (ValueError, KeyError):
+ raise IOError("file %s is corrupt, cannot read it" % str(fname))
+ bytecode = numpy.float32
+
+ self.bpp = len(numpy.array(0, bytecode).tostring())
+
+ # now read the data into the array
+ try:
+ vals = []
+ for line in infile.readlines():
+ try:
+ vals.append([float(x) for x in line.split()])
+ except:
+ pass
+ self.data = numpy.array(vals).astype(bytecode)
+ assert self.data.shape == (self.dim2, self.dim1)
+ except:
+ raise IOError("Error reading ascii")
+
+ self.resetvals()
+ # ensure the PIL image is reset
+ self.pilimage = None
+ return self
+
+
+fit2dspreadsheetimage = Fit2dSpreadsheetImage
diff --git a/fabio/hdf5image.py b/fabio/hdf5image.py
new file mode 100644
index 0000000..d17c53a
--- /dev/null
+++ b/fabio/hdf5image.py
@@ -0,0 +1,174 @@
+# coding: utf-8
+#
+# Project: FabIO X-ray image reader
+#
+# Copyright (C) 2010-2016 European Synchrotron Radiation Facility
+# Grenoble, France
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+
+"""HDF5 image for FabIO
+
+Authors: Jerome Kieffer
+email: Jerome.Kieffer@terre-adelie.org
+
+Specifications:
+input should being the form:
+
+filename::path
+
+Only supports ndim=2 or 3 (exposed as a stack of images
+"""
+# Get ready for python3:
+from __future__ import with_statement, print_function, division
+
+__authors__ = ["Jérôme Kieffer"]
+__contact__ = "Jerome.Kieffer@terre-adelie.org"
+__license__ = "MIT"
+__copyright__ = "Jérôme Kieffer"
+__date__ = "24/07/2017"
+
+import logging
+import os
+import posixpath
+import sys
+from .fabioimage import FabioImage
+logger = logging.getLogger(__name__)
+if sys.version_info[0] < 3:
+ bytes = str
+
+try:
+ import h5py
+except ImportError:
+ h5py = None
+from .fabioutils import previous_filename, next_filename
+
+
+class Hdf5Image(FabioImage):
+ """
+ FabIO image class for Images from an HDF file
+
+ filename::dataset
+ """
+
+ DESCRIPTION = "Hierarchical Data Format HDF5 flat reader"
+
+ DEFAULT_EXTENTIONS = ["h5"]
+
+ def __init__(self, *arg, **kwargs):
+ """
+ Generic constructor
+ """
+ if not h5py:
+ raise RuntimeError("fabio.Hdf5Image cannot be used without h5py. Please install h5py and restart")
+
+ FabioImage.__init__(self, *arg, **kwargs)
+ self.hdf5 = None
+ self.dataset = None
+
+ def read(self, fname, frame=None):
+ """
+ try to read image
+ :param fname: filename::datasetpath
+ """
+
+ self.resetvals()
+ if "::" not in fname:
+ err = "the '::' separator in mandatory for HDF5 container, absent in %s" % fname
+ logger.error(err)
+ raise RuntimeError(err)
+ filename, datapath = fname.split("::", 1)
+
+ self.filename = filename
+ if os.path.isfile(self.filename):
+ self.hdf5 = h5py.File(self.filename, "r")
+ else:
+ error = "No such file or directory: %s" % self.filename
+ logger.error(error)
+ raise RuntimeError(error)
+ try:
+ self.dataset = self.hdf5[datapath]
+ except Exception as err:
+ logger.error("No such datapath %s in %s, %s", datapath, filename, err)
+ raise
+ if isinstance(self.dataset, h5py.Group) and ("data" in self.dataset):
+ datapath = posixpath.join(datapath, "data")
+ logger.warning("The actual dataset is ")
+ self.dataset = self.dataset["data"]
+
+ # ndim does not exist for external links ?
+ ndim = len(self.dataset.shape)
+ if ndim == 3:
+ self.nframes = self.dataset.shape[0]
+ if frame is not None:
+ self.currentframe = int(frame)
+ else:
+ self.currentframe = 0
+ self.data = self.dataset[self.currentframe, :, :]
+ elif ndim == 2:
+ self.data = self.dataset[:, :]
+ else:
+ err = "Only 2D and 3D datasets are supported by FabIO, here %sD" % self.dataset.ndim
+ logger.error(err)
+ raise RuntimeError(err)
+ return self
+
+ def getframe(self, num):
+ """
+ Returns a frame as a new FabioImage object
+ :param num: frame number
+ """
+ if num < 0 or num > self.nframes:
+ raise RuntimeError("Requested frame number %i is out of range [0, %i[ " % (num, self.nframes))
+ # Do a deep copy of the header to make a new one
+ frame = self.__class__(header=self.header)
+ frame.hdf5 = self.hdf5
+ frame.dataset = self.dataset
+ frame.filename = self.filename
+ frame.nframes = self.nframes
+ frame.data = self.dataset[num, :, :]
+ frame.currentframe = num
+ return frame
+
+ def next(self):
+ """
+ Get the next image in a series as a fabio image
+ """
+ if self.currentframe < (self.nframes - 1):
+ return self.getframe(self.currentframe + 1)
+ else:
+ newobj = Hdf5Image()
+ newobj.read(next_filename(self.filename))
+ return newobj
+
+ def previous(self):
+ """
+ Get the previous image in a series as a fabio image
+ """
+ if self.currentframe > 0:
+ return self.getframe(self.currentframe - 1)
+ else:
+ newobj = Hdf5Image()
+ newobj.read(previous_filename(self.filename))
+ return newobj
+
+
+hdf5image = Hdf5Image
diff --git a/fabio/jpeg2kimage.py b/fabio/jpeg2kimage.py
new file mode 100644
index 0000000..79d2fc5
--- /dev/null
+++ b/fabio/jpeg2kimage.py
@@ -0,0 +1,159 @@
+# coding: utf-8
+#
+# Project: FabIO X-ray image reader
+#
+# Copyright (C) 2010-2016 European Synchrotron Radiation Facility
+# Grenoble, France
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+"""
+FabIO class for dealing with JPEG 2000 images.
+"""
+
+from __future__ import with_statement, print_function, division
+
+__authors__ = ["Valentin Valls"]
+__date__ = "28/07/2017"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__status__ = "stable"
+
+import logging
+logger = logging.getLogger(__name__)
+
+try:
+ import PIL
+except ImportError:
+ PIL = None
+
+try:
+ import glymur
+except ImportError:
+ glymur = None
+
+
+from .fabioimage import FabioImage
+from .fabioutils import OrderedDict
+from .utils import pilutils
+
+
+class Jpeg2KImage(FabioImage):
+ """
+ Images in JPEG 2000 format.
+
+ It uses PIL or glymur libraries.
+ """
+ DESCRIPTION = "JPEG 2000 format"
+
+ DEFAULT_EXTENTIONS = ["jp2", "jpx", "j2k", "jpf", "jpg2"]
+
+ _need_a_seek_to_read = True
+
+ def __init__(self, *args, **kwds):
+ """ Tifimage constructor adds an nbits member attribute """
+ self.nbits = None
+ FabioImage.__init__(self, *args, **kwds)
+ self.lib = ""
+
+ self._decoders = OrderedDict()
+ if PIL is not None:
+ self._decoders["PIL"] = self._readWithPil
+ if glymur is not None:
+ self._decoders["glymur"] = self._readWithGlymur
+
+ def _readWithPil(self, filename, infile):
+ """Read data using PIL"""
+ self.pilimage = PIL.Image.open(infile)
+ data = pilutils.get_numpy_array(self.pilimage)
+ self.data = data
+
+ if self.pilimage and self.pilimage.info:
+ for k, v in self.pilimage.info.items():
+ self.header[k] = v
+
+ print(self.data)
+
+ def _loadGlymurImage(self, filename, infile):
+ """
+ Hack to use Glymur with Python file object
+
+ This code was tested with all release 0.8.x
+ """
+ # image = glymur.Jp2k(filename)
+ # inject a shape to avoid calling the read function
+ if not glymur.__version__.startswith("0.8."):
+ raise IOError("Glymur version %s is not supported" % glymur.__version__)
+
+ image = glymur.Jp2k(filename=filename, shape=(1, 1))
+
+ # Move to the end of the file to know the size
+ infile.seek(0, 2)
+ length = infile.tell()
+ infile.seek(0)
+
+ # initialize what it should already be done
+ image.length = length
+ image._shape = None
+ # It is not the only one format supported by Glymur
+ # but it is a simplification
+ image._codec_format = glymur.lib.openjp2.CODEC_JP2
+
+ # parse the data
+ image.box = image.parse_superbox(infile)
+ try:
+ image._validate()
+ except Exception:
+ logger.debug("Backtrace", exc_info=True)
+ raise IOError("File %s is not a valid format" % filename)
+
+ # Now the image can be used normaly
+ return image
+
+ def _readWithGlymur(self, filename, infile):
+ """Read data using Glymur"""
+ image = self._loadGlymurImage(filename, infile)
+ self.data = image.read()
+
+ def read(self, filename, frame=None):
+ infile = self._open(filename, "rb")
+ self.data = None
+
+ for name, read in self._decoders.items():
+ try:
+ infile.seek(0)
+ read(filename, infile)
+ self.lib = name
+ break
+
+ except IOError as e:
+ self.data = None
+ self.header = OrderedDict()
+ logger.debug("Error while using %s library: %s" % (name, e), exc_info=True)
+ pass
+
+ if self.data is None:
+ infile.seek(0)
+ raise IOError("No decoder available for the file %s." % filename)
+ self.resetvals()
+ return self
+
+
+jpeg2kimage = Jpeg2KImage
diff --git a/fabio/jpegimage.py b/fabio/jpegimage.py
new file mode 100644
index 0000000..0060b99
--- /dev/null
+++ b/fabio/jpegimage.py
@@ -0,0 +1,120 @@
+# coding: utf-8
+#
+# Project: FabIO X-ray image reader
+#
+# Copyright (C) 2010-2016 European Synchrotron Radiation Facility
+# Grenoble, France
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+"""
+FabIO class for dealing with JPEG images.
+"""
+
+from __future__ import with_statement, print_function, division
+
+__authors__ = ["Valentin Valls"]
+__date__ = "27/07/2017"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__status__ = "stable"
+
+import logging
+logger = logging.getLogger(__name__)
+
+try:
+ from PIL import Image
+except ImportError:
+ Image = None
+
+from .fabioimage import FabioImage
+from .utils import pilutils
+
+# List of reserved keys reached from
+# http://pillow.readthedocs.io/en/3.4.x/handbook/image-file-formats.html#jpeg
+JPEG_RESERVED_HEADER_KEYS = [
+ "jfif",
+ "jfif_version",
+ "jfif_density",
+ "jfif_unit",
+ "dpi",
+ "adobe",
+ "adobe_transform",
+ "progression",
+ "icc_profile",
+ "exif",
+ "quality",
+ "optimize",
+ "progressive",
+ "dpi",
+ "exif",
+ "subsampling",
+ "qtables"
+]
+
+
+class JpegImage(FabioImage):
+ """
+ Images in JPEG format using PIL
+ """
+ DESCRIPTION = "JPEG format"
+
+ DEFAULT_EXTENTIONS = ["jpg", "jpeg"]
+
+ RESERVED_HEADER_KEYS = JPEG_RESERVED_HEADER_KEYS
+
+ _need_a_seek_to_read = True
+
+ def __init__(self, *args, **kwds):
+ """ Tifimage constructor adds an nbits member attribute """
+ self.nbits = None
+ FabioImage.__init__(self, *args, **kwds)
+
+ def _readWithPil(self, filename, infile):
+ try:
+ infile.seek(0)
+ self.pilimage = Image.open(infile)
+ except Exception:
+ infile.seek(0)
+ raise IOError("Error in opening %s with PIL" % filename)
+
+ data = pilutils.get_numpy_array(self.pilimage)
+ self.data = data
+
+ if self.pilimage and self.pilimage.info:
+ for k, v in self.pilimage.info.items():
+ self.header[k] = v
+
+ def read(self, filename, frame=None):
+ infile = self._open(filename, "rb")
+ self.data = None
+
+ if Image is not None:
+ self._readWithPil(filename, infile)
+
+ if self.data is None:
+ infile.seek(0)
+ raise IOError("Error in opening %s." % filename)
+
+ self.resetvals()
+ return self
+
+
+jpegimage = JpegImage
diff --git a/fabio/kcdimage.py b/fabio/kcdimage.py
new file mode 100644
index 0000000..ee79504
--- /dev/null
+++ b/fabio/kcdimage.py
@@ -0,0 +1,192 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE
+
+"""
+Authors: Jerome Kieffer, ESRF
+ email:jerome.kieffer@esrf.fr
+
+kcd images are 2D images written by the old KappaCCD diffractometer built by Nonius in the 1990's
+Based on the edfimage.py parser.
+"""
+# Get ready for python3:
+from __future__ import with_statement, print_function
+
+import numpy
+import logging
+import os
+
+import string
+from .fabioimage import FabioImage
+from .fabioutils import six
+logger = logging.getLogger(__name__)
+
+import io
+if not hasattr(io, "SEEK_END"):
+ SEEK_END = 2
+else:
+ SEEK_END = io.SEEK_END
+
+
+DATA_TYPES = {"u16": numpy.uint16}
+
+MINIMUM_KEYS = [
+ # 'ByteOrder', Assume little by default
+ 'Data type',
+ 'X dimension',
+ 'Y dimension',
+ 'Number of readouts']
+
+DEFAULT_VALUES = {"Data type": "u16"}
+
+if six.PY2:
+ ALPHANUM = string.digits + string.letters + ". "
+else:
+ ALPHANUM = bytes(string.digits + string.ascii_letters + ". ", encoding="ASCII")
+
+
+class KcdImage(FabioImage):
+ """
+ Read the Nonius kcd data format """
+
+ DESCRIPTION = "KCD file format from Nonius's KappaCCD diffractometer"
+
+ DEFAULT_EXTENTIONS = ["kcd"]
+
+ def _readheader(self, infile):
+ """
+ Read in a header in some KCD format from an already open file
+ """
+ one_line = infile.readline()
+
+ asciiHeader = True
+ for oneChar in one_line.strip():
+ if oneChar not in ALPHANUM:
+ asciiHeader = False
+
+ if asciiHeader is False:
+ # This does not look like an KappaCCD file
+ logger.warning("First line of %s does not seam to be ascii text!" % infile.name)
+ end_of_headers = False
+ while not end_of_headers:
+ one_line = infile.readline()
+ try:
+ one_line = one_line.decode("ASCII")
+ except UnicodeDecodeError:
+ end_of_headers = True
+ else:
+ if len(one_line) > 100:
+ end_of_headers = True
+ if not end_of_headers:
+ if one_line.strip() == "Binned mode":
+ one_line = "Mode = Binned"
+ if "=" in one_line:
+ key, val = one_line.split('=', 1)
+ key = key.strip()
+ self.header[key] = val.strip()
+ else:
+ end_of_headers = True
+
+ missing = []
+ for item in MINIMUM_KEYS:
+ if item not in self.header:
+ missing.append(item)
+ if len(missing) > 0:
+ logger.debug("KCD file misses the keys " + " ".join(missing))
+
+ def read(self, fname, frame=None):
+ """
+ Read in header into self.header and
+ the data into self.data
+ """
+ self.header = self.check_header()
+ self.resetvals()
+ with self._open(fname, "rb") as infile:
+ self._readheader(infile)
+ # Compute image size
+ try:
+ self.dim1 = int(self.header['X dimension'])
+ self.dim2 = int(self.header['Y dimension'])
+ except (KeyError, ValueError):
+ raise IOError("KCD file %s is corrupt, cannot read it" % fname)
+ try:
+ bytecode = DATA_TYPES[self.header['Data type']]
+ self.bpp = len(numpy.array(0, bytecode).tostring())
+ except KeyError:
+ bytecode = numpy.uint16
+ self.bpp = 2
+ logger.warning("Defaulting type to uint16")
+ try:
+ nbReadOut = int(self.header['Number of readouts'])
+ except KeyError:
+ logger.warning("Defaulting number of ReadOut to 1")
+ nbReadOut = 1
+ expected_size = self.dim1 * self.dim2 * self.bpp * nbReadOut
+
+ try:
+ infile.seek(-expected_size, SEEK_END)
+ except:
+ logger.warning("seeking from end is not implemeneted for file %s", fname)
+ if hasattr(infile, "measure_size"):
+ fileSize = infile.measure_size()
+ elif hasattr(infile, "size"):
+ fileSize = infile.size
+ elif hasattr(infile, "getSize"):
+ fileSize = infile.getSize()
+ else:
+ logger.warning("Unable to guess the file-size of %s", fname)
+ fileSize = os.stat(fname)[6]
+ infile.seek(fileSize - expected_size - infile.tell(), 1)
+ block = infile.read(expected_size)
+ # infile.close()
+
+ # now read the data into the array
+ self.data = numpy.zeros((self.dim2, self.dim1), numpy.int32)
+ stop = 0
+ for i in range(nbReadOut):
+ start = stop
+ stop = (i + 1) * expected_size // nbReadOut
+ data = numpy.fromstring(block[start: stop], bytecode)
+ data.shape = self.dim2, self.dim1
+ if not numpy.little_endian:
+ data.byteswap(True)
+ self.data += data
+ self.bytecode = self.data.dtype.type
+ self.resetvals()
+ # ensure the PIL image is reset
+ self.pilimage = None
+ return self
+
+ @staticmethod
+ def checkData(data=None):
+ if data is None:
+ return None
+ else:
+ return data.astype(int)
+
+
+kcdimage = KcdImage
diff --git a/fabio/mar345image.py b/fabio/mar345image.py
new file mode 100644
index 0000000..b1bf4d9
--- /dev/null
+++ b/fabio/mar345image.py
@@ -0,0 +1,394 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE
+
+"""
+
+Authors:
+........
+* Henning O. Sorensen & Erik Knudsen:
+ Center for Fundamental Research: Metal Structures in Four Dimensions;
+ Risoe National Laboratory;
+ Frederiksborgvej 399;
+ DK-4000 Roskilde;
+ email:erik.knudsen@risoe.dk
+* Jon Wright, Jérôme Kieffer & Gaël Goret:
+ European Synchrotron Radiation Facility;
+ Grenoble (France)
+
+Supports Mar345 imaging plate and Mar555 flat panel
+
+Documentation on the format is available from:
+http://rayonix.com/site_media/downloads/mar345_formats.pdf
+"""
+# Get ready for python3:
+from __future__ import with_statement, print_function, absolute_import
+
+__authors__ = ["Henning O. Sorensen", "Erik Knudsen", "Jon Wright", "Jérôme Kieffer"]
+__date__ = "27/07/2017"
+__status__ = "production"
+__copyright__ = "2007-2009 Risoe National Laboratory; 2010-2016 ESRF"
+__licence__ = "MIT"
+
+
+import struct
+import time
+import sys
+import logging
+import numpy
+from .fabioimage import FabioImage
+
+
+logger = logging.getLogger(__name__)
+from .compression import compPCK, decPCK
+
+
+class Mar345Image(FabioImage):
+ _need_a_real_file = True
+
+ DESCRIPTION = "File format from Mar345 imaging plate and Mar555 flat panel"
+
+ DEFAULT_EXTENTIONS = ["mar2300"]
+
+ def __init__(self, *args, **kwargs):
+ FabioImage.__init__(self, *args, **kwargs)
+ self.numhigh = None
+ self.numpixels = None
+ self.swap_needed = None
+
+ def read(self, fname, frame=None):
+ """ Read a mar345 image"""
+ self.filename = fname
+ f = self._open(self.filename, "rb")
+ self._readheader(f)
+ if 'compressed' in self.header['Format']:
+ self.data = decPCK(f, self.dim1, self.dim2, self.numhigh, swap_needed=self.swap_needed)
+ else:
+ logger.error("Cannot handle these formats yet due to lack of documentation")
+ return None
+ self.bytecode = numpy.uint32
+ f.close()
+ return self
+
+ def _readheader(self, infile=None):
+ """ Read a mar345 image header """
+ # clip was not used anywhere - commented out
+ # clip = '\x00'
+ # using a couple of local variables inside this function
+ f = infile
+ h = {}
+
+ # header is 4096 bytes long
+ data = f.read(64)
+ # the contents of the mar345 header is taken to be as
+ # described in
+ # http://www.mar-usa.com/support/downloads/mar345_formats.pdf
+ # the first 64 bytes are 4-byte integers (but in the CBFlib
+ # example image it seems to 128 bytes?)
+ # first 4-byte integer is a marker to check endianness
+ if struct.unpack("<i", data[0:4])[0] == 1234:
+ fs = '<i'
+ self.swap_needed = not(numpy.little_endian)
+ logger.debug("Going for little endian, swap_needed %s" % self.swap_needed)
+ else:
+ self.swap_needed = numpy.little_endian
+ fs = '>i'
+ logger.debug("Going for big endian, swap_needed %s" % self.swap_needed)
+
+ # image dimensions
+ self.dim1 = int(struct.unpack(fs, data[4:8])[0])
+ # number of high intensity pixels
+ self.numhigh = struct.unpack(fs, data[2 * 4: (2 + 1) * 4])[0]
+ h['NumHigh'] = self.numhigh
+ # Image format
+ i = struct.unpack(fs, data[3 * 4: (3 + 1) * 4])[0]
+ if i == 1:
+ h['Format'] = 'compressed'
+ elif i == 2:
+ h['Format'] = 'spiral'
+ else:
+ h['Format'] = 'compressed'
+ logger.warning("image format could not be determined" +
+ "- assuming compressed mar345")
+ # collection mode
+ h['Mode'] = {0: 'Dose', 1: 'Time'}[struct.unpack(fs, data[4 * 4:(4 + 1) * 4])[0]]
+ # total number of pixels
+ self.numpixels = struct.unpack(fs, data[5 * 4:(5 + 1) * 4])[0]
+ h['NumPixels'] = str(self.numpixels)
+ self.dim2 = self.numpixels // self.dim1
+ # pixel dimensions (length,height) in mm
+ h['PixelLength'] = struct.unpack(fs, data[6 * 4:(6 + 1) * 4])[0] / 1000.0
+ h['PixelHeight'] = struct.unpack(fs, data[7 * 4:(7 + 1) * 4])[0] / 1000.0
+ # x-ray wavelength in AA
+ h['Wavelength'] = struct.unpack(fs, data[8 * 4:(8 + 1) * 4])[0] / 1000000.0
+ # used distance
+ h['Distance'] = struct.unpack(fs, data[9 * 4:(9 + 1) * 4])[0] / 1000.0
+ # starting and ending phi
+ h['StartPhi'] = struct.unpack(fs, data[10 * 4:11 * 4])[0] / 1000.0
+ h['EndPhi'] = struct.unpack(fs, data[11 * 4:12 * 4])[0] / 1000.0
+ # starting and ending omega
+ h['StartOmega'] = struct.unpack(fs, data[12 * 4:13 * 4])[0] / 1000.0
+ h['EndOmega'] = struct.unpack(fs, data[13 * 4:14 * 4])[0] / 1000.0
+ # Chi and Twotheta angles
+ h['Chi'] = struct.unpack(fs, data[14 * 4:15 * 4])[0] / 1000.0
+ h['TwoTheta'] = struct.unpack(fs, data[15 * 4:16 * 4])[0] / 1000.0
+
+ # the rest of the header is ascii
+ # TODO: validate these values against the binaries already read
+ data = f.read(128)
+ if b'mar research' not in data:
+ logger.warning("the string \"mar research\" should be in " +
+ "bytes 65-76 of the header but was not")
+ start = 128
+ else:
+ start = data.index(b'mar research')
+ f.seek(64 + start)
+ data = f.read(4096 - start - 64).strip()
+ for m in data.splitlines():
+ try:
+ m = m.decode("ASCII")
+ except UnicodeDecodeError:
+ if m.startswith(b"DATE"):
+ m = m[:39].decode("ASCII")
+ else:
+ logger.warning("Skip binary trash on header line %s" % m)
+ continue
+ if m == 'END OF HEADER':
+ break
+ n = m.split(' ', 1)
+ if n[0] == '':
+ continue
+ if n[0] in ('PROGRAM', 'DATE', 'SCANNER', 'HIGH', 'MULTIPLIER',
+ 'GAIN', 'WAVELENGTH', 'DISTANCE', 'RESOLUTION',
+ 'CHI', 'TWOTHETA', 'MODE', 'TIME', 'GENERATOR',
+ 'MONOCHROMATOR', 'REMARK'):
+ logger.debug("reading: %s %s", n[0], n[1])
+ h[n[0]] = n[1].strip()
+ continue
+ if n[0] in ('FORMAT'):
+ (h['DIM'], h['FORMAT_TYPE'], h['NO_PIXELS']) = n[1].split()
+ continue
+ if n[0] in ('PIXEL', 'OFFSET', 'PHI', 'OMEGA', 'COUNTS',
+ 'CENTER', 'INTENSITY', 'HISTOGRAM', 'COLLIMATOR'):
+ n = m.split()
+ h.update([(n[0] + '_' + n[j], n[j + 1]) for j in range(1, len(n), 2)])
+ continue
+ self.header = h
+ return h
+
+ def write(self, fname):
+ """Try to write mar345 file.
+ It uses a MIT implementation of the CCP4 (LGPL) PCK1 algo from JPA"""
+ bin_headers = self.binary_header()
+ asc_headers = self.ascii_header("\n", 4096 - len(bin_headers)).encode("ASCII")
+ hotpixels = self._high_intensity_pixel_records()
+ compressed_stream = compPCK(self.data)
+ with self._open(fname, mode="wb") as outfile:
+ outfile.write(bin_headers)
+ outfile.write(asc_headers)
+ outfile.write(hotpixels)
+ outfile.write(compressed_stream)
+ outfile.close()
+
+ def binary_header(self):
+ """
+ :return: Binary header of mar345 file
+ """
+ self.header["HIGH"] = str(self.nb_overflow_pixels())
+ binheader = numpy.zeros(16, "int32")
+ binheader[0] = 1234
+ binheader[1] = self.dim1
+ binheader[2] = self.nb_overflow_pixels()
+ binheader[3] = 1
+ binheader[4] = (self.header.get("MODE", "TIME") == "TIME")
+ binheader[5] = self.dim1 * self.dim2
+ binheader[6] = int(self.header.get("PIXEL_LENGTH", 1))
+ binheader[7] = int(self.header.get("PIXEL_HEIGHT", 1))
+ binheader[8] = int(float(self.header.get("WAVELENGTH", 1)) * 1e6)
+ binheader[9] = int(float(self.header.get("DISTANCE", 1)) * 1e3)
+ binheader[10] = int(float(self.header.get("PHI_START", 1)) * 1e3)
+ binheader[11] = int(float(self.header.get("PHI_END", 1)) * 1e3)
+ binheader[12] = int(float(self.header.get("OMEGA_START", 1)) * 1e3)
+ binheader[13] = int(float(self.header.get("OMEGA_END", 1)) * 1e3)
+ binheader[14] = int(float(self.header.get("CHI", 1)) * 1e3)
+ binheader[15] = int(float(self.header.get("TWOTHETA", 1)) * 1e3)
+ self.header["HIGH"] = str(binheader[2])
+ if self.swap_needed:
+ binheader.byteswap(True)
+ return binheader.tostring()
+
+ def ascii_header(self, linesep="\n", size=4096):
+ """
+ Generate the ASCII header for writing
+
+ :param linesep: end of line separator
+ :param size: size of the header (without the binary header)
+ :return: string (unicode) containing the mar345 header
+
+ """
+ try:
+ version = sys.modules["fabio"].version
+ except (KeyError, AttributeError):
+ version = "0.1.1"
+ lnsep = len(linesep)
+
+ lstout = ['mar research'.ljust(64 - lnsep)]
+ lstout.append("PROGRAM".ljust(15) + (str(self.header.get("PROGRAM", "FabIO Version %s" % (version))).ljust(49 - lnsep)))
+ lstout.append("DATE".ljust(15) + (str(self.header.get("DATE", time.ctime()))).ljust(49 - lnsep))
+ key = "SCANNER"
+ if key in self.header:
+ lstout.append(key.ljust(15) + str(self.header[key]).ljust(49 - lnsep))
+ key = "FORMAT_TYPE"
+ if key in self.header:
+ lstout.append("FORMAT".ljust(15) + ("%s %s %s" % (self.dim1, self.header[key], self.dim1 * self.dim2)).ljust(49 - lnsep))
+ key = "HIGH"
+ if key in self.header:
+ lstout.append(key.ljust(15) + str(self.header[key]).ljust(49 - lnsep))
+ key1 = "PIXEL_LENGTH"
+ key2 = "PIXEL_HEIGHT"
+ if (key1 in self.header) and (key2 in self.header):
+ lstout.append("PIXEL".ljust(15) + ("LENGTH %s HEIGHT %s" % (self.header[key1], self.header[key2])).ljust(49 - lnsep))
+ key1 = "OFFSET_ROFF"
+ key2 = "OFFSET_TOFF"
+ if key1 in self.header and key2 in self.header:
+ lstout.append("OFFSET".ljust(15) + ("ROFF %s TOFF %s" % (self.header[key1], self.header[key2])).ljust(49 - lnsep))
+ key = "MULTIPLIER"
+ if key in self.header:
+ lstout.append(key.ljust(15) + str(self.header[key]).ljust(49 - lnsep))
+ key = "GAIN"
+ if key in self.header:
+ lstout.append(key.ljust(15) + str(self.header[key]).ljust(49 - lnsep))
+ key = "WAVELENGTH"
+ if key in self.header:
+ lstout.append(key.ljust(15) + str(self.header[key]).ljust(49 - lnsep))
+ key = "DISTANCE"
+ if key in self.header:
+ lstout.append(key.ljust(15) + str(self.header[key]).ljust(49 - lnsep))
+ key = "RESOLUTION"
+ if key in self.header:
+ lstout.append(key.ljust(15) + str(self.header[key]).ljust(49 - lnsep))
+ key1 = "PHI_START"
+ key2 = "PHI_END"
+ key3 = "PHI_OSC"
+ if (key1 in self.header) and (key2 in self.header) and (key3 in self.header):
+ lstout.append("PHI".ljust(15) + ("START %s END %s OSC %s" % (self.header[key1], self.header[key2], self.header[key3])).ljust(49 - lnsep))
+ key1 = "OMEGA_START"
+ key2 = "OMEGA_END"
+ key3 = "OMEGA_OSC"
+ if (key1 in self.header) and (key2 in self.header) and (key3 in self.header):
+ lstout.append("OMEGA".ljust(15) + ("START %s END %s OSC %s" % (self.header[key1], self.header[key2], self.header[key3])).ljust(49 - lnsep))
+ key = "CHI"
+ if key in self.header:
+ lstout.append(key.ljust(15) + str(self.header[key]).ljust(49 - lnsep))
+ key = "TWOTHETA"
+ if key in self.header:
+ lstout.append(key.ljust(15) + str(self.header[key]).ljust(49 - lnsep))
+ key1 = "CENTER_X"
+ key2 = "CENTER_Y"
+ if (key1 in self.header) and (key2 in self.header):
+ lstout.append("CENTER".ljust(15) + ("X %s Y %s" % (self.header[key1], self.header[key2])).ljust(49 - lnsep))
+ key = "MODE"
+ if key in self.header:
+ lstout.append(key.ljust(15) + str(self.header[key]).ljust(49 - lnsep))
+ key = "TIME"
+ if key in self.header:
+ lstout.append(key.ljust(15) + str(self.header[key]).ljust(49 - lnsep))
+ key1 = "COUNTS_START"
+ key2 = "COUNTS_END"
+ key3 = "COUNTS_NMEAS"
+ if key1 in self.header and key2 in self.header and key3 in self.header:
+ lstout.append("COUNTS".ljust(15) + ("START %s END %s NMEAS %s" % (self.header[key1], self.header[key2], self.header[key3])).ljust(49 - lnsep))
+ key1 = "COUNTS_MIN"
+ key2 = "COUNTS_MAX"
+ if key1 in self.header and key2 in self.header:
+ lstout.append("COUNTS".ljust(15) + ("MIN %s MAX %s" % (self.header[key1], self.header[key2])).ljust(49 - lnsep))
+ key1 = "COUNTS_AVE"
+ key2 = "COUNTS_SIG"
+ if key1 in self.header and key2 in self.header:
+ lstout.append("COUNTS".ljust(15) + ("AVE %s SIG %s" % (self.header[key1], self.header[key2])).ljust(49 - lnsep))
+ key1 = "INTENSITY_MIN"
+ key2 = "INTENSITY_MAX"
+ key3 = "INTENSITY_AVE"
+ key4 = "INTENSITY_SIG"
+ if key1 in self.header and key2 in self.header and key3 in self.header and key4 in self.header:
+ lstout.append("INTENSITY".ljust(15) + ("MIN %s MAX %s AVE %s SIG %s" % (self.header[key1], self.header[key2], self.header[key3], self.header[key4])).ljust(49 - lnsep))
+ key1 = "HISTOGRAM_START"
+ key2 = "HISTOGRAM_END"
+ key3 = "HISTOGRAM_MAX"
+ if key1 in self.header and key2 in self.header and key3 in self.header:
+ lstout.append("HISTOGRAM".ljust(15) + ("START %s END %s MAX %s" % (self.header[key1], self.header[key2], self.header[key3])).ljust(49 - lnsep))
+ key = "GENERATOR"
+ if key in self.header:
+ lstout.append(key.ljust(15) + str(self.header[key]).ljust(49 - lnsep))
+ key = "MONOCHROMATOR"
+ if key in self.header:
+ lstout.append(key.ljust(15) + str(self.header[key]).ljust(49 - lnsep))
+ key1 = "COLLIMATOR_WIDTH"
+ key2 = "COLLIMATOR_HEIGHT"
+ if key1 in self.header and key2 in self.header:
+ lstout.append("COLLIMATOR".ljust(15) + ("WIDTH %s HEIGHT %s" % (self.header[key1], self.header[key2])).ljust(49 - lnsep))
+ key = "REMARK"
+ if key in self.header:
+ lstout.append(key.ljust(15) + str(self.header[key]).ljust(49 - lnsep))
+ else:
+ lstout.append(key.ljust(64 - lnsep))
+ key = "END OF HEADER"
+ lstout.append(key)
+ return linesep.join(lstout).ljust(size)
+
+ def _high_intensity_pixel_records(self):
+ flt_data = self.data.flatten()
+ pix_location = numpy.where(flt_data > 65535)[0]
+ nb_pix = pix_location.size
+ if nb_pix % 8 == 0:
+ tmp = numpy.zeros((nb_pix, 2), dtype="int32")
+ else:
+ tmp = numpy.zeros(((nb_pix // 8 + 1) * 8, 2), dtype="int32")
+ tmp[:nb_pix, 0] = pix_location + 1
+ tmp[:nb_pix, 1] = flt_data[pix_location]
+ if self.swap_needed:
+ tmp.byteswap(True)
+ return tmp.tostring()
+
+ def nb_overflow_pixels(self):
+ return (self.data > 65535).sum()
+
+ @staticmethod
+ def checkData(data=None):
+ if data is None:
+ return None
+ else:
+ # enforce square image
+ shape = data.shape
+ assert len(shape) == 2, "image has 2 dimensions"
+ mshape = max(shape)
+ z = numpy.zeros((mshape, mshape), dtype=int)
+ z[:shape[0], :shape[1]] = data
+ return z
+
+
+mar345image = Mar345Image
diff --git a/fabio/marccdimage.py b/fabio/marccdimage.py
new file mode 100644
index 0000000..2dab4d8
--- /dev/null
+++ b/fabio/marccdimage.py
@@ -0,0 +1,344 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE
+
+"""
+
+Authors:
+........
+* Henning O. Sorensen & Erik Knudsen:
+ Center for Fundamental Research: Metal Structures in Four Dimensions;
+ Risoe National Laboratory;
+ Frederiksborgvej 399;
+ DK-4000 Roskilde;
+ email:erik.knudsen@risoe.dk
+* Jon Wright:
+ European Synchrotron Radiation Facility;
+ Grenoble (France)
+
+marccdimage can read MarCCD and MarMosaic images including header info.
+
+JPW : Use a parser in case of typos (sorry?)
+
+"""
+# Get ready for python3:
+from __future__ import with_statement, print_function, absolute_import
+
+# Base this on the tifimage (as marccd seems to be tiff with a
+# special header
+import logging
+import struct
+from .tifimage import TifImage
+
+logger = logging.getLogger(__name__)
+
+# Now for the c definition (found on mar webpage)
+# The following string is therefore copyrighted by Mar I guess
+
+CDEFINITION = """
+typedef struct frame_header_type {
+ /* File/header format parameters (256 bytes) */
+ UINT32 header_type; /* flag for header type
+ (can be used as magic number) */
+ char header_name[16]; /* header name (MMX) */
+ UINT32 header_major_version; /* header_major_version (n.) */
+ UINT32 header_minor_version; /* header_minor_version (.n) */
+ UINT32 header_byte_order;/* BIG_ENDIAN (Motorola,MIPS);
+ LITTLE_ENDIAN (DEC, Intel) */
+ UINT32 data_byte_order; /* BIG_ENDIAN (Motorola,MIPS);
+ LITTLE_ENDIAN (DEC, Intel) */
+ UINT32 header_size; /* in bytes */
+ UINT32 frame_type; /* flag for frame type */
+ UINT32 magic_number; /* to be used as a flag -
+ usually to indicate new file */
+ UINT32 compression_type; /* type of image compression */
+ UINT32 compression1; /* compression parameter 1 */
+ UINT32 compression2; /* compression parameter 2 */
+ UINT32 compression3; /* compression parameter 3 */
+ UINT32 compression4; /* compression parameter 4 */
+ UINT32 compression5; /* compression parameter 4 */
+ UINT32 compression6; /* compression parameter 4 */
+ UINT32 nheaders; /* total number of headers */
+ UINT32 nfast; /* number of pixels in one line */
+ UINT32 nslow; /* number of lines in image */
+ UINT32 depth; /* number of bytes per pixel */
+ UINT32 record_length; /* number of pixels between
+ succesive rows */
+ UINT32 signif_bits; /* true depth of data, in bits */
+ UINT32 data_type; /* (signed,unsigned,float...) */
+ UINT32 saturated_value; /* value marks pixel as saturated */
+ UINT32 sequence; /* TRUE or FALSE */
+ UINT32 nimages; /* total number of images - size of
+ each is nfast*(nslow/nimages) */
+ UINT32 origin; /* corner of origin */
+ UINT32 orientation; /* direction of fast axis */
+ UINT32 view_direction; /* direction to view frame */
+ UINT32 overflow_location;/* FOLLOWING_HEADER, FOLLOWING_DATA */
+ UINT32 over_8_bits; /* # of pixels with counts 255 */
+ UINT32 over_16_bits; /* # of pixels with count 65535 */
+ UINT32 multiplexed; /* multiplex flag */
+ UINT32 nfastimages; /* # of images in fast direction */
+ UINT32 nslowimages; /* # of images in slow direction */
+ UINT32 background_applied;/* flags correction has been applied
+ hold magic number ? */
+ UINT32 bias_applied; /* flags correction has been applied
+ hold magic number ? */
+ UINT32 flatfield_applied;/* flags correction has been applied -
+ hold magic number ? */
+ UINT32 distortion_applied;/*flags correction has been applied -
+ hold magic number ? */
+ UINT32 original_header_type; /* Header/frame type from file
+ that frame is read from */
+ UINT32 file_saved; /* Flag that file has been saved,
+ should be zeroed if modified */
+ char reserve1[(64-40)*sizeof(INT32)-16];
+
+ /* Data statistics (128) */
+ UINT32 total_counts[2]; /* 64 bit integer range = 1.85E19*/
+ UINT32 special_counts1[2];
+ UINT32 special_counts2[2];
+ UINT32 min;
+ UINT32 max;
+ UINT32 mean;
+ UINT32 rms;
+ UINT32 p10;
+ UINT32 p90;
+ UINT32 stats_uptodate;
+ UINT32 pixel_noise[MAXIMAGES]; /*1000*base noise value (ADUs) */
+ char reserve2[(32-13-MAXIMAGES)*sizeof(INT32)];
+
+ /* More statistics (256) */
+ UINT16 percentile[128];
+
+
+ /* Goniostat parameters (128 bytes) */
+ INT32 xtal_to_detector; /* 1000*distance in millimeters */
+ INT32 beam_x; /* 1000*x beam position (pixels) */
+ INT32 beam_y; /* 1000*y beam position (pixels) */
+ INT32 integration_time; /* integration time in milliseconds */
+ INT32 exposure_time; /* exposure time in milliseconds */
+ INT32 readout_time; /* readout time in milliseconds */
+ INT32 nreads; /* number of readouts to get this image */
+ INT32 start_twotheta; /* 1000*two_theta angle */
+ INT32 start_omega; /* 1000*omega angle */
+ INT32 start_chi; /* 1000*chi angle */
+ INT32 start_kappa; /* 1000*kappa angle */
+ INT32 start_phi; /* 1000*phi angle */
+ INT32 start_delta; /* 1000*delta angle */
+ INT32 start_gamma; /* 1000*gamma angle */
+ INT32 start_xtal_to_detector; /* 1000*distance in mm (dist in um)*/
+ INT32 end_twotheta; /* 1000*two_theta angle */
+ INT32 end_omega; /* 1000*omega angle */
+ INT32 end_chi; /* 1000*chi angle */
+ INT32 end_kappa; /* 1000*kappa angle */
+ INT32 end_phi; /* 1000*phi angle */
+ INT32 end_delta; /* 1000*delta angle */
+ INT32 end_gamma; /* 1000*gamma angle */
+ INT32 end_xtal_to_detector; /* 1000*distance in mm (dist in um)*/
+ INT32 rotation_axis; /* active rotation axis */
+ INT32 rotation_range; /* 1000*rotation angle */
+ INT32 detector_rotx; /* 1000*rotation of detector around X */
+ INT32 detector_roty; /* 1000*rotation of detector around Y */
+ INT32 detector_rotz; /* 1000*rotation of detector around Z */
+ char reserve3[(32-28)*sizeof(INT32)];
+
+ /* Detector parameters (128 bytes) */
+ INT32 detector_type; /* detector type */
+ INT32 pixelsize_x; /* pixel size (nanometers) */
+ INT32 pixelsize_y; /* pixel size (nanometers) */
+ INT32 mean_bias; /* 1000*mean bias value */
+ INT32 photons_per_100adu; /* photons / 100 ADUs */
+ INT32 measured_bias[MAXIMAGES];/* 1000*mean bias value for each image*/
+ INT32 measured_temperature[MAXIMAGES]; /* Temperature of each
+ detector in milliKelvins */
+ INT32 measured_pressure[MAXIMAGES]; /* Pressure of each chamber
+ in microTorr */
+ /* Retired reserve4 when MAXIMAGES set to 9 from 16 and
+ two fields removed, and temp and pressure added
+ char reserve4[(32-(5+3*MAXIMAGES))*sizeof(INT32)]
+ */
+
+ /* X-ray source and optics parameters (128 bytes) */
+ /* X-ray source parameters (8*4 bytes) */
+ INT32 source_type; /* (code) - target, synch. etc */
+ INT32 source_dx; /* Optics param. - (size microns) */
+ INT32 source_dy; /* Optics param. - (size microns) */
+ INT32 source_wavelength; /* wavelength (femtoMeters) */
+ INT32 source_power; /* (Watts) */
+ INT32 source_voltage; /* (Volts) */
+ INT32 source_current; /* (microAmps) */
+ INT32 source_bias; /* (Volts) */
+ INT32 source_polarization_x; /* () */
+ INT32 source_polarization_y; /* () */
+ char reserve_source[4*sizeof(INT32)];
+
+ /* X-ray optics_parameters (8*4 bytes) */
+ INT32 optics_type; /* Optics type (code)*/
+ INT32 optics_dx; /* Optics param. - (size microns) */
+ INT32 optics_dy; /* Optics param. - (size microns) */
+ INT32 optics_wavelength; /* Optics param. - (size microns) */
+ INT32 optics_dispersion; /* Optics param. - (*10E6) */
+ INT32 optics_crossfire_x; /* Optics param. - (microRadians) */
+ INT32 optics_crossfire_y; /* Optics param. - (microRadians) */
+ INT32 optics_angle; /* Optics param. - (monoch.
+ 2theta - microradians) */
+ INT32 optics_polarization_x; /* () */
+ INT32 optics_polarization_y; /* () */
+ char reserve_optics[4*sizeof(INT32)];
+
+ char reserve5[((32-28)*sizeof(INT32))];
+
+ /* File parameters (1024 bytes) */
+ char filetitle[128]; /* Title */
+ char filepath[128]; /* path name for data file */
+ char filename[64]; /* name of data file */
+ char acquire_timestamp[32]; /* date and time of acquisition */
+ char header_timestamp[32]; /* date and time of header update */
+ char save_timestamp[32]; /* date and time file saved */
+ char file_comments[512]; /* comments, use as desired */
+ char reserve6[1024-(128+128+64+(3*32)+512)];
+
+ /* Dataset parameters (512 bytes) */
+ char dataset_comments[512]; /* comments, used as desired */
+ /* pad out to 3072 bytes */
+ char pad[3072-(256+128+256+(3*128)+1024+512)];
+
+ } frame_header;
+"""
+
+# Convert mar c header file types to python struct module types
+C_TO_STRUCT = {
+ "INT32": "i",
+ "UINT32": "I",
+ "char": "c",
+ "UINT16": "H"}
+
+# Sizes (bytes) of mar c header objects
+C_SIZES = {
+ "INT32": 4,
+ "UINT32": 4,
+ "char": 1,
+ "UINT16": 2}
+
+# This was worked out by trial and error from a trial image I think
+MAXIMAGES = 9
+
+
+def make_format(c_def_string):
+ """
+ Reads the header definition in c and makes the format
+ string to pass to struct.unpack
+ """
+ lines = c_def_string.split("\n")
+ fmt = ""
+ names = []
+ expected = 0
+ for line in lines:
+ if line.find(";") == -1:
+ continue
+ decl = line.split(";")[0].lstrip().rstrip()
+ try:
+ [typ, name] = decl.split()
+ except ValueError:
+ logger.debug("skipping: %s", line)
+ continue
+
+ if name.find("[") > -1:
+ # repeated ... times
+ try:
+ num = name.split("[")[1].split("]")[0]
+ num = num.replace("MAXIMAGES", str(MAXIMAGES))
+ num = num.replace("sizeof(INT32)", "4")
+ times = eval(num)
+ except Exception as error:
+ logger.error("%s Please decode %s", error, decl)
+ raise error
+ else:
+ times = 1
+ try:
+ fmt += C_TO_STRUCT[typ] * times
+ names += [name] * times
+ expected += C_SIZES[typ] * times
+ except KeyError:
+ continue
+ return names, fmt
+
+
+# Make these be compiled on loading module
+HEADER_NAMES, HEADER_FORMAT = make_format(CDEFINITION)
+
+
+def interpret_header(header, fmt, names):
+ """
+ given a format and header interpret it
+ """
+ values = struct.unpack(fmt, header)
+ hdr = {}
+ i = 0
+ for name in names:
+ if name in hdr:
+ if isinstance(values[i], str):
+ hdr[name] = hdr[name] + values[i]
+ else:
+ try:
+ hdr[name].append(values[i])
+ except AttributeError:
+ hdr[name] = [hdr[name], values[i]]
+ else:
+ hdr[name] = values[i]
+ i = i + 1
+
+ return hdr
+
+
+class MarccdImage(TifImage):
+ """ Read in data in mar ccd format, also
+ MarMosaic images, including header info """
+
+ DESCRIPTION = "File format from MarCCD and MarMosaic images"
+
+ DEFAULT_EXTENTIONS = ["mccd"]
+
+ def _readheader(self, infile):
+ """
+ Parser based approach
+ Gets all entries
+ """
+ infile.seek(1024)
+ hstr = infile.read(3072)
+ self.header = interpret_header(hstr, HEADER_FORMAT, HEADER_NAMES)
+
+ def _read(self, fname):
+ """
+ inherited from tifimage
+ ... a marccd image *is a* tif image
+ just with a header
+ """
+ return TifImage.read(self, fname)
+
+
+marccdimage = MarccdImage
diff --git a/fabio/mpaimage.py b/fabio/mpaimage.py
new file mode 100644
index 0000000..605c98d
--- /dev/null
+++ b/fabio/mpaimage.py
@@ -0,0 +1,131 @@
+# coding: utf-8
+#
+# Project: FabIO X-ray image reader
+#
+# Copyright (C) 2017 Cornell High Energy Synchrotron Source
+# Ithaca (New York, USA)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+
+"""
+Author:
+........
+* Jesse Hopkins:
+ Cornell High Energy Synchrotron Source;
+ Ithaca (New York, USA)
+
+mpaimage can read ascii and binary .mpa (multiwire) files
+"""
+
+# Get ready for python3:
+from __future__ import with_statement, print_function, division, absolute_import
+
+import logging
+import numpy
+from .fabioimage import FabioImage, OrderedDict
+
+logger = logging.getLogger(__name__)
+
+
+class MpaImage(FabioImage):
+ """
+ FabIO image class for Images from multiwire data files (mpa)
+ """
+
+ DESCRIPTION = "multiwire data files"
+
+ DEFAULT_EXTENTIONS = ["mpa"]
+
+ def _readheader(self, infile):
+ """
+ Read and decode the header of an image
+
+ :param infile: Opened python file (can be stringIO or bzipped file)
+ """
+ # list of header key to keep the order (when writing)
+ header_prefix = ''
+ tmp_hdr = OrderedDict([("None", OrderedDict())])
+
+ while True:
+ line = infile.readline()
+ line = line.decode()
+ if line.find('=') > -1:
+ key, value = line.strip().split('=', 1)
+ key = key.strip()
+ value = value.strip()
+ if header_prefix == '':
+ tmp_hdr["None"][key] = value
+ else:
+ tmp_hdr[header_prefix][key] = value
+ elif line.startswith('[DATA') or line.startswith('[CDAT'):
+ break
+ else:
+ header_prefix = line.strip().strip('[]')
+ tmp_hdr[header_prefix] = {}
+
+ self.header = OrderedDict()
+ for key, key_data in tmp_hdr.items():
+ key = str(key)
+ for subkey, subkey_data in key_data.items():
+ subkey = str(subkey)
+ if key == 'None':
+ self.header[subkey] = subkey_data
+ else:
+ self.header[key + '_' + subkey] = subkey_data
+
+ def read(self, fname, frame=None):
+ """
+ Try to read image
+
+ :param fname: name of the file
+ """
+
+ infile = self._open(fname, 'r')
+ self._readheader(infile)
+
+ if ('ADC1_range' not in self.header.keys() or
+ 'ADC2_range' not in self.header.keys() or
+ 'mpafmt' not in self.header.keys()):
+ logger.error('Error in opening %s: badly formatted mpa header.', fname)
+ raise IOError('Error in opening %s: badly formatted mpa header.' % fname)
+
+ self.dim1 = int(self.header['ADC1_range'])
+ self.dim2 = int(self.header['ADC2_range'])
+
+ if self.header['mpafmt'] == 'asc':
+ lines = infile.readlines()
+ else:
+ infile.close()
+ infile = self._open(fname, 'rb')
+ lines = infile.readlines()
+
+ for i, line in enumerate(lines):
+ if line.startswith(b'[CDAT'):
+ pos = i
+ break
+
+ img = numpy.array(lines[pos + 1:], dtype=float)
+ self.data = img.reshape((self.dim1, self.dim2))
+
+ return self
+
+
+mpaimage = MpaImage
diff --git a/fabio/mrcimage.py b/fabio/mrcimage.py
new file mode 100644
index 0000000..8b14045
--- /dev/null
+++ b/fabio/mrcimage.py
@@ -0,0 +1,188 @@
+# coding: utf-8
+#
+# Project: FabIO X-ray image reader
+#
+# Copyright (C) 2010-2016 European Synchrotron Radiation Facility
+# Grenoble, France
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+
+"""MRC image for FabIO
+
+Authors: Jerome Kieffer
+email: Jerome.Kieffer@terre-adelie.org
+
+Specifications from:
+http://ami.scripps.edu/software/mrctools/mrc_specification.php
+"""
+# Get ready for python3:
+from __future__ import with_statement, print_function
+
+__authors__ = ["Jérôme Kieffer"]
+__contact__ = "Jerome.Kieffer@terre-adelie.org"
+__license__ = "MIT"
+__copyright__ = "Jérôme Kieffer"
+__version__ = "29 Oct 2013"
+import logging
+import sys
+import numpy
+from .fabioimage import FabioImage
+from .fabioutils import previous_filename, next_filename
+logger = logging.getLogger(__name__)
+if sys.version_info < (3.0):
+ bytes = str
+
+
+class MrcImage(FabioImage):
+ """
+ FabIO image class for Images from a mrc image stack
+ """
+
+ DESCRIPTION = "Medical Research Council file format for 3D electron density and 2D images"
+
+ DEFAULT_EXTENTIONS = ["mrc"]
+
+ KEYS = ("NX", "NY", "NZ", "MODE", "NXSTART", "NYSTART", "NZSTART",
+ "MX", "MY", "MZ", "CELL_A", "CELL_B", "CELL_C",
+ "CELL_ALPHA", "CELL_BETA", "CELL_GAMMA",
+ "MAPC", "MAPR", "MAPS", "DMIN", "DMAX", "DMEAN", "ISPG", "NSYMBT",
+ "EXTRA", "ORIGIN", "MAP", "MACHST", "RMS", "NLABL")
+
+ def _readheader(self, infile):
+ """
+ Read and decode the header of an image:
+
+ :param infile: Opened python file (can be stringIO or bipped file)
+ """
+ # list of header key to keep the order (when writing)
+ self.header = self.check_header()
+
+ # header is composed of 56-int32 plus 10x80char lines
+ int_block = numpy.fromstring(infile.read(56 * 4), dtype=numpy.int32)
+ for key, value in zip(self.KEYS, int_block):
+ self.header[key] = value
+ assert self.header["MAP"] == 542130509 # "MAP " in int32 !
+
+ for i in range(10):
+ label = "LABEL_%02i" % i
+ self.header[label] = infile.read(80).strip()
+ self.dim1 = self.header["NX"]
+ self.dim2 = self.header["NY"]
+ self.nframes = self.header["NZ"]
+ mode = self.header["MODE"]
+ if mode == 0:
+ self.bytecode = numpy.int8
+ elif mode == 1:
+ self.bytecode = numpy.int16
+ elif mode == 2:
+ self.bytecode = numpy.float32
+ elif mode == 3:
+ self.bytecode = numpy.complex64
+ elif mode == 4:
+ self.bytecode = numpy.complex64
+ elif mode == 6:
+ self.bytecode = numpy.uint16
+ self.imagesize = self.dim1 * self.dim2 * numpy.dtype(self.bytecode).itemsize
+
+ def read(self, fname, frame=None):
+ """
+ try to read image
+ :param fname: name of the file
+ :param frame:
+ """
+
+ self.resetvals()
+ self.sequencefilename = fname
+ self.currentframe = frame or 0
+
+ with self._open(fname) as infile:
+ self._readheader(infile)
+ self._readframe(infile, self.currentframe)
+ return self
+
+ def _calc_offset(self, frame):
+ """
+ Calculate the frame position in the file
+
+ :param frame: frame number
+ """
+ assert frame < self.nframes
+ return 1024 + frame * self.imagesize
+
+ def _makeframename(self):
+ self.filename = "%s$%04d" % (self.sequencefilename,
+ self.currentframe)
+
+ def _readframe(self, infile, img_num):
+ """
+ Read a frame an populate data
+ :param infile: opened file
+ :param img_num: frame number (int)
+ """
+ if (img_num > self.nframes or img_num < 0):
+ raise RuntimeError("Requested frame number is out of range")
+ _imgstart = self.header['offset'] + img_num * (512 * 476 * 2 + 24)
+ infile.seek(self.calc_offset(img_num), 0)
+ self.data = numpy.fromstring(infile.read(self.imagesize), self.bytecode)
+ self.data.shape = self.dim2, self.dim1
+ self.currentframe = int(img_num)
+ self._makeframename()
+
+ def getframe(self, num):
+ """
+ Returns a frame as a new FabioImage object
+ :param num: frame number
+ """
+ if num < 0 or num > self.nframes:
+ raise RuntimeError("Requested frame number is out of range")
+ # Do a deep copy of the header to make a new one
+ frame = MrcImage(header=self.header.copy())
+ for key in ("dim1", "dim2", "nframes", "bytecode", "imagesize", "sequencefilename"):
+ frame.__setattr__(key, self.__getattribute__(key))
+ with frame._open(self.sequencefilename, "rb") as infile:
+ frame._readframe(infile, num)
+ return frame
+
+ def next(self):
+ """
+ Get the next image in a series as a fabio image
+ """
+ if self.currentframe < (self.nframes - 1) and self.nframes > 1:
+ return self.getframe(self.currentframe + 1)
+ else:
+ newobj = MrcImage()
+ newobj.read(next_filename(self.sequencefilename))
+ return newobj
+
+ def previous(self):
+ """
+ Get the previous image in a series as a fabio image
+ """
+ if self.currentframe > 0:
+ return self.getframe(self.currentframe - 1)
+ else:
+ newobj = MrcImage()
+ newobj.read(previous_filename(
+ self.sequencefilename))
+ return newobj
+
+
+mrcimage = MrcImage
diff --git a/fabio/nexus.py b/fabio/nexus.py
new file mode 100644
index 0000000..d055e81
--- /dev/null
+++ b/fabio/nexus.py
@@ -0,0 +1,387 @@
+# coding: utf-8
+#
+# Project: FabIO X-ray image reader
+#
+# Copyright (C) 2010-2016 European Synchrotron Radiation Facility
+# Grenoble, France
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+"""Module for handling HDF5 data structure following the NeXuS convention
+
+Stand-alone module which tries to offer interface to HDF5 via H5Py
+
+"""
+from __future__ import absolute_import, print_function, division
+
+__author__ = "Jerome Kieffer"
+__contact__ = "Jerome.Kieffer@ESRF.eu"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "24/07/2017"
+__status__ = "beta"
+__docformat__ = 'restructuredtext'
+
+import logging
+import numpy
+import os
+import sys
+import time
+
+from .fabioutils import exists
+from ._version import version
+
+if sys.version_info[0] < 3:
+ bytes = str
+ from urlparse import urlparse
+else:
+ from urllib.parse import urlparse
+
+
+logger = logging.getLogger(__name__)
+try:
+ import h5py
+except ImportError as error:
+ h5py = None
+ logger.error("h5py module missing")
+else:
+ try:
+ h5py._errors.silence_errors()
+ except AttributeError: # old h5py
+ pass
+
+
+def get_isotime(force_time=None):
+ """
+ :param force_time: enforce a given time (current by default)
+ :type force_time: float
+ :return: the current time as an ISO8601 string
+ :rtype: string
+ """
+ if force_time is None:
+ force_time = time.time()
+ localtime = time.localtime(force_time)
+ gmtime = time.gmtime(force_time)
+ tz_h = localtime.tm_hour - gmtime.tm_hour
+ tz_m = localtime.tm_min - gmtime.tm_min
+ return "%s%+03i:%02i" % (time.strftime("%Y-%m-%dT%H:%M:%S", localtime), tz_h, tz_m)
+
+
+def from_isotime(text, use_tz=False):
+ """
+ :param text: string representing the time is iso format
+ :return: Time in second since epoch (float)
+ """
+ if isinstance(text, numpy.ndarray):
+ text = text[0]
+ if (sys.version_info[0] > 2) and isinstance(text, bytes):
+ text = text.decode("utf-8")
+ else:
+ text = str(text)
+ base = text[:19]
+ if use_tz and len(text) == 25:
+ sgn = 1 if text[:19] == "+" else -1
+ tz = 60 * (60 * int(text[20:22]) + int(text[23:25])) * sgn
+ else:
+ tz = 0
+ return time.mktime(time.strptime(base, "%Y-%m-%dT%H:%M:%S")) + tz
+
+
+def is_hdf5(filename):
+ """
+ Check if a file is actually a HDF5 file
+
+ :param filename: this file has better to exist
+ :return: true or False
+ """
+ signature = b"\x89\x48\x44\x46\x0d\x0a\x1a\x0a"
+ if not exists(filename):
+ raise IOError("No such file %s" % (filename))
+ with open(filename.split("::")[0], "rb") as f:
+ sig = f.read(len(signature))
+ return sig == signature
+
+
+class Nexus(object):
+ """
+ Writer class to handle Nexus/HDF5 data
+ Manages:
+ entry
+ pyFAI-subentry
+ detector
+
+ #TODO: make it thread-safe !!!
+ """
+ def __init__(self, filename, mode="r"):
+ """
+ Constructor
+
+ :param filename: name of the hdf5 file containing the nexus
+ :param mode: can be r or a
+ """
+ self.filename = os.path.abspath(filename)
+ self.mode = mode
+ if not h5py:
+ logger.error("h5py module missing: NeXus not supported")
+ raise RuntimeError("H5py module is missing")
+ if exists(self.filename) and self.mode == "r":
+ self.h5 = h5py.File(self.filename.split("::")[0], mode=self.mode)
+ else:
+ self.h5 = h5py.File(self.filename.split("::")[0])
+ self.to_close = []
+
+ def close(self, endtime=None):
+ """Close the filename and update all entries
+
+ :param endtime: timestamp in iso-format of the end of the acquisition.
+ """
+ if endtime is None:
+ end_time = get_isotime()
+ elif isinstance(endtime, (int, float)):
+ end_time = get_isotime(endtime)
+ for entry in self.to_close:
+ entry["end_time"] = end_time
+ self.h5.close()
+
+ # Context manager for "with" statement compatibility
+ def __enter__(self, *arg, **kwarg):
+ return self
+
+ def __exit__(self, *arg, **kwarg):
+ self.close()
+
+ def get_entry(self, name):
+ """
+ Retrieves an entry from its name
+
+ :param name: name of the entry to retrieve
+ :return: HDF5 group of NXclass == NXentry
+ """
+ for grp_name in self.h5:
+ if grp_name == name:
+ grp = self.h5[grp_name]
+ if (isinstance(grp, h5py.Group) and
+ "start_time" in grp and
+ "NX_class" in grp.attrs and
+ grp.attrs["NX_class"] == "NXentry"):
+ return grp
+
+ def get_entries(self):
+ """
+ retrieves all entry sorted the latest first.
+
+ :return: list of HDF5 groups
+ """
+ entries = [(grp, from_isotime(self.h5[grp + "/start_time"].value))
+ for grp in self.h5
+ if (isinstance(self.h5[grp], h5py.Group) and
+ "start_time" in self.h5[grp] and
+ "NX_class" in self.h5[grp].attrs and
+ self.h5[grp].attrs["NX_class"] == "NXentry")]
+ if entries:
+ entries.sort(key=lambda a: a[1], reverse=True) # sort entries in decreasing time
+ return [self.h5[i[0]] for i in entries]
+ else: # no entries found, try without sorting by time
+ entries = [grp for grp in self.h5
+ if (isinstance(self.h5[grp], h5py.Group) and
+ "NX_class" in self.h5[grp].attrs and
+ self.h5[grp].attrs["NX_class"] == "NXentry")]
+ entries.sort(reverse=True)
+ return [self.h5[i] for i in entries]
+
+ def find_detector(self, all=False):
+ """
+ Tries to find a detector within a NeXus file, takes the first compatible detector
+
+ :param all: return all detectors found as a list
+ """
+ result = []
+ for entry in self.get_entries():
+ for instrument in self.get_class(entry, "NXsubentry") + self.get_class(entry, "NXinstrument"):
+ for detector in self.get_class(instrument, "NXdetector"):
+ if all:
+ result.append(detector)
+ else:
+ return detector
+ return result
+
+ def find_data(self, all=False):
+ """
+ Tries to find a NXdata within a NeXus file
+
+ :param all: return all detectors found as a list
+ """
+ result = []
+ for entry in self.get_entries():
+ data = self.get_data(entry)
+ if data:
+ if all:
+ result += data
+ else:
+ return data[0]
+ for instrument in self.get_class(entry, "NXinstrument"):
+ data = self.get_data(instrument)
+ if data:
+ if all:
+ result += data
+ else:
+ return data[0]
+ for detector in self.get_class(instrument, "NXdetector"):
+ data = self.get_data(detector)
+ if data:
+ if all:
+ result += data
+ else:
+ return data[0]
+ for instrument in self.get_class(entry, "NXsubentry"):
+ data = self.get_data(instrument)
+ if data:
+ if all:
+ result += data
+ else:
+ return data[0]
+ for detector in self.get_class(instrument, "NXdetector"):
+ data = self.get_data(detector)
+ if data:
+ if all:
+ result += data
+ else:
+ return data[0]
+
+ return result
+
+ def new_entry(self, entry="entry", program_name="pyFAI",
+ title="description of experiment",
+ force_time=None, force_name=False):
+ """
+ Create a new entry
+
+ :param entry: name of the entry
+ :param program_name: value of the field as string
+ :param title: value of the field as string
+ :param force_time: seconds since epoch enforce the start_time
+ :param force_name: set to true to prevent the addition of a _0001 suffix
+ :return: the corresponding HDF5 group
+ """
+ if force_name:
+ entry_grp = self.h5.require_group(entry)
+ else:
+ nb_entries = len(self.get_entries())
+ entry_grp = self.h5.require_group("%s_%04i" % (entry, nb_entries))
+ entry_grp.attrs["NX_class"] = "NXentry"
+ entry_grp["title"] = numpy.string_(title)
+ entry_grp["program_name"] = numpy.string_(program_name)
+ entry_grp["start_time"] = numpy.string_(get_isotime(force_time))
+ self.to_close.append(entry_grp)
+ return entry_grp
+
+ def new_instrument(self, entry="entry", instrument_name="id00",):
+ """
+ Create an instrument in an entry or create both the entry and the instrument if
+ """
+ if not isinstance(entry, h5py.Group):
+ entry = self.new_entry(entry)
+ return self.new_class(entry, instrument_name, "NXinstrument")
+# howto external link
+ # myfile['ext link'] = h5py.ExternalLink("otherfile.hdf5", "/path/to/resource")
+
+ def new_class(self, grp, name, class_type="NXcollection"):
+ """
+ create a new sub-group with type class_type
+ :param grp: parent group
+ :param name: name of the sub-group
+ :param class_type: NeXus class name
+ :return: subgroup created
+ """
+ sub = grp.require_group(name)
+ sub.attrs["NX_class"] = class_type
+ return sub
+
+ def new_detector(self, name="detector", entry="entry", subentry="pyFAI"):
+ """
+ Create a new entry/pyFAI/Detector
+
+ :param detector: name of the detector
+ :param entry: name of the entry
+ :param subentry: all pyFAI description of detectors should be in a pyFAI sub-entry
+ """
+ entry_grp = self.new_entry(entry)
+ pyFAI_grp = self.new_class(entry_grp, subentry, "NXsubentry")
+ pyFAI_grp["definition_local"] = numpy.string_("pyFAI")
+ pyFAI_grp["definition_local"].attrs["version"] = version
+ det_grp = self.new_class(pyFAI_grp, name, "NXdetector")
+ return det_grp
+
+ def get_class(self, grp, class_type="NXcollection"):
+ """
+ return all sub-groups of the given type within a group
+
+ :param grp: HDF5 group
+ :param class_type: name of the NeXus class
+ """
+ coll = [grp[name] for name in grp
+ if (isinstance(grp[name], h5py.Group) and
+ "NX_class" in grp[name].attrs and
+ grp[name].attrs["NX_class"] == class_type)]
+ return coll
+
+ def get_data(self, grp, class_type="NXdata"):
+ """
+ return all dataset of the the NeXus class NXdata
+
+ :param grp: HDF5 group
+ :param class_type: name of the NeXus class
+ """
+ result = []
+ for grp in self.get_class(grp, class_type):
+ result += [grp[name] for name in grp
+ if (isinstance(grp[name], h5py.Dataset) and
+ ("signal" in grp[name].attrs))]
+ return result
+
+ def deep_copy(self, name, obj, where="/", toplevel=None, excluded=None, overwrite=False):
+ """
+ perform a deep copy:
+ create a "name" entry in self containing a copy of the object
+
+ :param where: path to the toplevel object (i.e. root)
+ :param toplevel: firectly the top level Group
+ :param excluded: list of keys to be excluded
+ :param overwrite: replace content if already existing
+ """
+ if (excluded is not None) and (name in excluded):
+ return
+ if not toplevel:
+ toplevel = self.h5[where]
+ if isinstance(obj, h5py.Group):
+ if name not in toplevel:
+ grp = toplevel.require_group(name)
+ for k, v in obj.attrs.items():
+ grp.attrs[k] = v
+ elif isinstance(obj, h5py.Dataset):
+ if name in toplevel:
+ if overwrite:
+ del toplevel[name]
+ logger.warning("Overwriting %s in %s" % (toplevel[name].name, self.filename))
+ else:
+ logger.warning("Not overwriting %s in %s" % (toplevel[name].name, self.filename))
+ return
+ toplevel[name] = obj.value
+ for k, v in obj.attrs.items():
+ toplevel[name].attrs[k] = v
diff --git a/fabio/numpyimage.py b/fabio/numpyimage.py
new file mode 100644
index 0000000..f0b5c71
--- /dev/null
+++ b/fabio/numpyimage.py
@@ -0,0 +1,199 @@
+# coding: utf-8
+#
+# Project: FabIO X-ray image reader
+#
+# Copyright (C) 2010-2016 European Synchrotron Radiation Facility
+# Grenoble, France
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+"""Generic numpy file reader for FabIO"""
+# Get ready for python3:
+from __future__ import with_statement, print_function, division
+
+__authors__ = ["Jérôme Kieffer"]
+__contact__ = "jerome.kieffer@esrf.fr"
+__license__ = "MIT"
+__copyright__ = "ESRF"
+__date__ = "27/07/2017"
+
+import logging
+logger = logging.getLogger(__name__)
+import numpy
+from .fabioimage import FabioImage
+
+
+class NumpyImage(FabioImage):
+ """
+ FabIO image class for Images for numpy array dumps
+
+ Source: http://docs.scipy.org/doc/numpy/neps/npy-format.html
+
+ Format Specification: Version 1.0
+ =================================
+
+ The first 6 bytes are a magic string: exactly “x93NUMPY”.
+
+ The next 1 byte is an unsigned byte: the major version number of the file
+ format, e.g. x01.
+
+ The next 1 byte is an unsigned byte: the minor version number of the file
+ format, e.g. x00.
+ Note: the version of the file format is not tied to the version of the numpy
+ package.
+
+ The next 2 bytes form a little-endian unsigned short int: the length of the
+ header data HEADER_LEN.
+
+ The next HEADER_LEN bytes form the header data describing the array’s
+ format. It is an ASCII string which contains a Python literal expression of
+ a dictionary. It is terminated by a newline (‘n’) and padded with
+ spaces (‘x20’) to make the total length of the magic string + 4 + HEADER_LEN
+ be evenly divisible by 16 for alignment purposes.
+
+ The dictionary contains three keys:
+
+ “descr” : dtype.descr
+ An object that can be passed as an argument to the numpy.dtype()
+ constructor to create the array’s dtype.
+ “fortran_order” : bool
+ Whether the array data is Fortran-contiguous or not.
+ Since Fortran-contiguous arrays are a common form of
+ non-C-contiguity, we allow them to be written directly
+ to disk for efficiency.
+ “shape” : tuple of int
+ The shape of the array.
+
+ For repeatability and readability, this dictionary is formatted using
+ pprint.pformat() so the keys are in alphabetic order.
+
+ Following the header comes the array data. If the dtype contains Python
+ objects (i.e. dtype.hasobject is True), then the data is a Python pickle of
+ the array. Otherwise the data is the contiguous (either C- or Fortran-,
+ depending on fortran_order) bytes of the array. Consumers can figure out the
+ number of bytes by multiplying the number of elements given by the shape
+ (noting that shape=() means there is 1 element) by dtype.itemsize.
+
+ Format Specification: Version 2.0
+ =================================
+
+ The version 1.0 format only allowed the array header to have a total size of
+ 65535 bytes. This can be exceeded by structured arrays with a large number
+ of columns. The version 2.0 format extends the header size to 4 GiB.
+ numpy.save will automatically save in 2.0 format if the data requires it,
+ else it will always use the more compatible 1.0 format.
+
+ The description of the fourth element of the header therefore has become:
+
+ The next 4 bytes form a little-endian unsigned int: the length of the header data HEADER_LEN.
+ """
+
+ DESCRIPTION = "Numpy array file format"
+
+ DEFAULT_EXTENTIONS = ["npy"]
+
+ def __init__(self, data=None, header=None):
+ """
+ Set up initial values
+ """
+ FabioImage.__init__(self, data, header)
+ self.dataset = self.data
+ self.slice_dataset()
+ self.filename = "Numpy_array_%x" % id(self.dataset)
+
+ def slice_dataset(self, frame=None):
+ if self.dataset is None:
+ return
+ if self.dataset.ndim > 3:
+ shape = self.dataset.shape[-2:]
+ self.dataset.shape = (-1,) + shape
+ elif self.dataset.ndim < 2:
+ self.dataset.shape = 1, -1
+
+ if self.dataset.ndim == 2:
+ self.data = self.dataset
+ elif self.dataset.ndim == 3:
+ self.nframes = self.dataset.shape[0]
+ if frame is None:
+ frame = 0
+ if frame < self.nframes:
+ self.data = self.dataset[frame]
+ self.currentframe = frame
+
+ def _readheader(self, infile):
+ """
+ Read and decode the header of an image:
+
+ :param infile: Opened python file (can be stringIO or bzipped file)
+ """
+ # list of header key to keep the order (when writing)
+ self.header = self.check_header()
+ infile.seek(0)
+
+ def read(self, fname, frame=None):
+ """
+ Try to read image
+
+ :param fname: name of the file
+ """
+
+ self.resetvals()
+ infile = self._open(fname)
+ self._readheader(infile)
+
+ # read the image data
+ self.dataset = numpy.load(infile)
+ self.slice_dataset(frame)
+ return self
+
+ def write(self, fname):
+ """
+ Try to write image
+
+ :param fname: name of the file
+ """
+ numpy.save(fname, self.dataset)
+
+ def getframe(self, num):
+ """ returns the frame numbered 'num' in the stack if applicable"""
+ if self.nframes > 1:
+ new_img = None
+ if (num >= 0) and num < self.nframes:
+ data = self.dataset[num]
+ new_img = self.__class__(data=data, header=self.header)
+ new_img.dataset = self.dataset
+ new_img.nframes = self.nframes
+ new_img.currentframe = num
+ else:
+ raise IndexError("getframe %s out of range [%s %s[" % (num, 0, self.nframes))
+ else:
+ new_img = FabioImage.getframe(self, num)
+ return new_img
+
+ def previous(self):
+ """ returns the previous frame in the series as a fabioimage """
+ return self.getframe(self.currentframe - 1)
+
+ def next(self):
+ """ returns the next frame in the series as a fabioimage """
+ return self.getframe(self.currentframe + 1)
+
+
+numpyimage = NumpyImage
diff --git a/fabio/openimage.py b/fabio/openimage.py
new file mode 100644
index 0000000..b2497d1
--- /dev/null
+++ b/fabio/openimage.py
@@ -0,0 +1,217 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE
+
+"""
+
+Authors: Henning O. Sorensen & Erik Knudsen
+ Center for Fundamental Research: Metal Structures in Four Dimensions
+ Risoe National Laboratory
+ Frederiksborgvej 399
+ DK-4000 Roskilde
+ email:henning.sorensen@risoe.dk
+
+mods for fabio by JPW
+modification for HDF5 by Jérôme Kieffer
+
+"""
+# Get ready for python3:
+from __future__ import with_statement, print_function, absolute_import
+
+import sys
+import logging
+logger = logging.getLogger(__name__)
+from .fabioutils import FilenameObject, six, BytesIO
+from .fabioimage import FabioImage
+
+# Make sure to load all formats
+from . import fabioformats # noqa
+
+
+MAGIC_NUMBERS = [
+ # "\42\5a" : 'bzipped'
+ # "\1f\8b" : 'gzipped'
+ (b"FORMAT : 86", 'bruker'),
+ (b"\x4d\x4d\x00\x2a", 'tif'),
+ # The marCCD and Pilatus formats are both standard tif with a header
+ # hopefully these byte patterns are unique for the formats
+ # If not the image will be read, but the is missing
+ (b"\x49\x49\x2a\x00\x08\x00", 'marccd/tif'),
+ (b"\x49\x49\x2a\x00\x82\x00", 'pilatus'),
+ (b"\x49\x49\x2a\x00", 'tif'),
+ # ADSC must come before edf
+ (b"{\nHEA", 'adsc'),
+ (b"{", 'edf'),
+ (b"\r{", 'edf'),
+ (b"\n{", 'edf'),
+ (b"ADEPT", 'GE'),
+ (b"OD", 'OXD'),
+ (b"IM", 'HiPiC'),
+ (b'\x2d\x04', 'mar345'),
+ (b'\xd2\x04', 'mar345'),
+ (b'\x04\x2d', 'mar345'), # some machines may need byteswapping
+ (b'\x04\xd2', 'mar345'),
+ # hint : MASK in 32 bit
+ (b'M\x00\x00\x00A\x00\x00\x00S\x00\x00\x00K\x00\x00\x00', 'fit2dmask'),
+ (b'\x00\x00\x00\x03', 'dm3'),
+ (b"No", "kcd"),
+ (b"<", "xsd"),
+ (b"\n\xb8\x03\x00", 'pixi'),
+ (b"\x89\x48\x44\x46\x0d\x0a\x1a\x0a", "eiger/hdf5"),
+ (b"R-AXIS", 'raxis'),
+ (b"\x93NUMPY", 'numpy'),
+ (b"\\$FFF_START", 'fit2d'),
+ # Raw JPEG
+ (b"\xFF\xD8\xFF\xDB", "jpeg"),
+ # JFIF format
+ (b"\xFF\xD8\xFF\xE0", "jpeg"),
+ # Exif format
+ (b"\xFF\xD8\xFF\xE1", "jpeg"),
+ # JPEG 2000 (from RFC 3745)
+ (b"\x00\x00\x00\x0C\x6A\x50\x20\x20\x0D\x0A\x87\x0A", "jpeg2k"),
+]
+
+
+def do_magic(byts, filename):
+ """ Try to interpret the bytes starting the file as a magic number """
+ for magic, format_type in MAGIC_NUMBERS:
+ if byts.startswith(magic):
+ if "/" in format_type:
+ if format_type == "eiger/hdf5":
+ if "::" in filename:
+ return "hdf5"
+ else:
+ return "eiger"
+ elif format_type == "marccd/tif":
+ if "mccd" in filename.split("."):
+ return "marccd"
+ else:
+ return "tif"
+ return format_type
+ raise Exception("Could not interpret magic string")
+
+
+def openimage(filename, frame=None):
+ """ Try to open an image """
+ if isinstance(filename, FilenameObject):
+ try:
+ logger.debug("Attempting to open %s" % (filename.tostring()))
+ obj = _openimage(filename.tostring())
+ logger.debug("Attempting to read frame %s from %s with reader %s" % (frame, filename.tostring(), obj.classname))
+ obj = obj.read(filename.tostring(), frame)
+ except Exception as ex:
+ # multiframe file
+ # logger.debug( "DEBUG: multiframe file, start # %d"%(
+ # filename.num)
+ logger.debug("Exception %s, trying name %s" % (ex, filename.stem))
+ obj = _openimage(filename.stem)
+ logger.debug("Reading frame %s from %s" % (filename.num, filename.stem))
+ obj.read(filename.stem, frame=filename.num)
+ else:
+ logger.debug("Attempting to open %s" % (filename))
+ obj = _openimage(filename)
+ logger.debug("Attempting to read frame %s from %s with reader %s" % (frame, filename, obj.classname))
+ obj = obj.read(obj.filename, frame)
+ return obj
+
+
+def openheader(filename):
+ """ return only the header"""
+ obj = _openimage(filename)
+ obj.readheader(obj.filename)
+ return obj
+
+
+def _openimage(filename):
+ """
+ determine which format for a filename
+ and return appropriate class which can be used for opening the image
+
+ :param filename: can be an url like:
+
+ hdf5:///example.h5?entry/instrument/detector/data/data#slice=[:,:,5]
+
+ """
+ try:
+ url = six.moves.urllib_parse.urlparse(filename)
+ except AttributeError as err:
+ # Assume we have as input a BytesIO object
+ attrs = dir(filename)
+ if "seek" in attrs and "read" in attrs:
+ if not isinstance(filename, BytesIO):
+ filename.seek(0)
+ actual_filename = BytesIO(filename.read())
+ else:
+ actual_filename = filename
+ url = six.moves.urllib_parse.urlparse("")
+
+ else:
+ # related to https://github.com/silx-kit/fabio/issues/34
+ if (len(url.scheme) == 1 and (sys.platform == "win32")) or url.path.startswith(":"):
+ # this is likely a C: from windows or filename::path
+ filename = url.scheme + ":" + url.path
+ else:
+ filename = url.path
+ actual_filename = filename.split("::")[0]
+
+ try:
+ imo = FabioImage()
+ byts = imo._open(actual_filename).read(18)
+ filetype = do_magic(byts, filename)
+ except IOError as error:
+ logger.error("%s: File probably does not exist", error)
+ raise error
+ except:
+ try:
+ file_obj = FilenameObject(filename=filename)
+ if file_obj is None:
+ raise Exception("Unable to deconstruct filename")
+ if (file_obj.format is not None) and\
+ len(file_obj.format) != 1 and \
+ isinstance(file_obj.format, list):
+ # one of OXD/ADSC - should have got in previous
+ raise Exception("openimage failed on magic bytes & name guess")
+ filetype = file_obj.format
+
+ except Exception as error:
+ logger.error(error)
+ import traceback
+ traceback.print_exc()
+ raise Exception("Fabio could not identify " + filename)
+ klass_name = "".join(filetype) + 'image'
+
+ try:
+ obj = FabioImage.factory(klass_name)
+ except RuntimeError as err:
+ logger.error("Filetype not known %s %s" % (filename, klass_name))
+ raise err
+
+ if url.scheme in ["nxs", "hdf5"] and filetype == "hdf5":
+ obj.set_url(url)
+ obj.filename = filename
+ # skip the read for read header
+ return obj
diff --git a/fabio/pilatusimage.py b/fabio/pilatusimage.py
new file mode 100644
index 0000000..c880bf0
--- /dev/null
+++ b/fabio/pilatusimage.py
@@ -0,0 +1,113 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE
+
+"""
+
+Authors:
+........
+* Henning O. Sorensen & Erik Knudsen:
+ Center for Fundamental Research: Metal Structures in Four Dimensions;
+ Risoe National Laboratory;
+ Frederiksborgvej 399;
+ DK-4000 Roskilde;
+ email:erik.knudsen@risoe.dk
+* Jon Wright:
+ European Synchrotron Radiation Facility;
+ Grenoble (France)
+
+"""
+# Get ready for python3:
+from __future__ import with_statement, print_function
+
+
+# Base this on the tifimage (as Pilatus is tiff with a
+# tiff header
+
+from .tifimage import TifImage
+
+
+class PilatusImage(TifImage):
+ """ Read in Pilatus format, also
+ pilatus images, including header info """
+
+ DESCRIPTION = "Pilatus file format based on Tiff"
+
+ DEFAULT_EXTENTIONS = ["tif", "tiff"]
+
+ def _readheader(self, infile):
+ """
+ Parser based approach
+ Gets all entries
+ """
+
+ self.header = self.check_header()
+
+# infile = open(infile)
+ hstr = infile.read(4096)
+ # well not very pretty - but seems to find start of
+ # header information
+ if (hstr.find(b'# ') == -1):
+ return self.header
+
+ hstr = hstr[hstr.index(b'# '):]
+ hstr = hstr[:hstr.index(b'\x00')]
+ hstr = hstr.split(b'#')
+ go_on = True
+ while go_on:
+ try:
+ hstr.remove(b'')
+ except Exception:
+ go_on = False
+
+ for line in hstr:
+ line = line[1:line.index(b'\r\n')]
+ if line.find(b':') > -1:
+ dump = line.split(b':')
+ self.header[dump[0]] = dump[1]
+ elif line.find(b'=') > -1:
+ dump = line.split(b'=')
+ self.header[dump[0]] = dump[1]
+ elif line.find(b' ') > -1:
+ i = line.find(b' ')
+ self.header[line[:i]] = line[i:]
+ elif line.find(b',') > -1:
+ dump = line.split(b',')
+ self.header[dump[0]] = dump[1]
+
+ return self.header
+
+ def _read(self, fname):
+ """
+ inherited from tifimage
+ ... a Pilatus image *is a* tif image
+ just with a header
+ """
+ return TifImage.read(self, fname)
+
+
+pilatusimage = PilatusImage
diff --git a/fabio/pixiimage.py b/fabio/pixiimage.py
new file mode 100644
index 0000000..20e6c81
--- /dev/null
+++ b/fabio/pixiimage.py
@@ -0,0 +1,171 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE
+
+
+"""
+Author: Jon Wright, ESRF.
+"""
+# Get ready for python3:
+from __future__ import with_statement, print_function
+
+__authors__ = ["Jon Wright", "Jérôme Kieffer"]
+__contact__ = "wright@esrf.fr"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "25/07/2017"
+
+import numpy
+import os
+import logging
+
+logger = logging.getLogger(__name__)
+
+from .fabioimage import FabioImage
+from .fabioutils import previous_filename, next_filename
+
+
+class PixiImage(FabioImage):
+
+ DESCRIPTION = "Pixi file format"
+
+ DEFAULT_EXTENTIONS = []
+
+ _need_a_seek_to_read = True
+
+ def _readheader(self, infile):
+ infile.seek(0)
+ self.header = self.check_header()
+ byt = infile.read(4)
+ framesize = numpy.fromstring(byt, numpy.int32)
+ if framesize == 243722:
+ # life is good
+ width = 476
+ height = 512
+ offset = 24
+ self.header['framesize'] = framesize
+ self.header['width'] = width
+ self.header['height'] = height
+ self.header['offset'] = offset
+ else:
+ logger.warning("Pixiimage, bad framesize: %s", framesize)
+ raise
+
+ def read(self, fname, frame=None):
+ if frame is None:
+ frame = 0
+ self.header = self.check_header()
+ self.resetvals()
+ with self._open(fname, "rb") as infile:
+ self.sequencefilename = fname
+ self._readheader(infile)
+ self.nframes = os.path.getsize(fname) / 487448
+ self._readframe(infile, frame)
+ # infile.close()
+ return self
+
+ def _makeframename(self):
+ self.filename = "%s$%04d" % (self.sequencefilename,
+ self.currentframe)
+
+ def _readframe(self, filepointer, img_num):
+ if (img_num > self.nframes or img_num < 0):
+ raise Exception("Bad image number")
+ imgstart = self.header['offset'] + img_num * (512 * 476 * 2 + 24)
+ filepointer.seek(imgstart, 0)
+ self.data = numpy.fromstring(filepointer.read(512 * 476 * 2),
+ numpy.uint16)
+ self.data.shape = self.header['height'], self.header['width']
+ self.dim2, self.dim1 = self.data.shape
+ self.currentframe = int(img_num)
+ self._makeframename()
+
+ def getframe(self, num):
+ """
+ Returns a frame as a new FabioImage object
+ """
+ if num < 0 or num > self.nframes:
+ raise Exception("Requested frame number is out of range")
+ # Do a deep copy of the header to make a new one
+ newheader = {}
+ for k in self.header.keys():
+ newheader[k] = self.header[k]
+ frame = pixiimage(header=newheader)
+ frame.nframes = self.nframes
+ frame.sequencefilename = self.sequencefilename
+ infile = frame._open(self.sequencefilename, "rb")
+ frame._readframe(infile, num)
+ infile.close()
+ return frame
+
+ def next(self):
+ """
+ Get the next image in a series as a fabio image
+ """
+ if self.currentframe < (self.nframes - 1) and self.nframes > 1:
+ return self.getframe(self.currentframe + 1)
+ else:
+ newobj = pixiimage()
+ newobj.read(next_filename(
+ self.sequencefilename))
+ return newobj
+
+ def previous(self):
+ """
+ Get the previous image in a series as a fabio image
+ """
+ if self.currentframe > 0:
+ return self.getframe(self.currentframe - 1)
+ else:
+ newobj = pixiimage()
+ newobj.read(previous_filename(
+ self.sequencefilename))
+ return newobj
+
+
+pixiimage = PixiImage
+
+
+def demo(fname):
+ i = PixiImage()
+ i.read(fname)
+ import pylab
+ pylab.imshow(numpy.log(i.data))
+ print("%s\t%s\t%s\t%s" % (i.filename, i.data.max(), i.data.min(), i.data.mean()))
+ pylab.title(i.filename)
+ pylab.show()
+ while 1:
+ i = i.next()
+ pylab.imshow(numpy.log(i.data))
+ pylab.title(i.filename)
+ pylab.show()
+ raw_input()
+
+
+if __name__ == "__main__":
+ import sys
+ demo(sys.argv[1])
diff --git a/fabio/pnmimage.py b/fabio/pnmimage.py
new file mode 100644
index 0000000..670aa3b
--- /dev/null
+++ b/fabio/pnmimage.py
@@ -0,0 +1,230 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE
+
+"""
+
+Authors: Henning O. Sorensen & Erik Knudsen
+ Center for Fundamental Research: Metal Structures in Four Dimensions
+ Risoe National Laboratory
+ Frederiksborgvej 399
+ DK-4000 Roskilde
+ email:henning.sorensen@risoe.dk
+
+* Jérôme Kieffer:
+ European Synchrotron Radiation Facility;
+ Grenoble (France)
+
+License: MIT
+"""
+# Get ready for python3:
+from __future__ import absolute_import, print_function, with_statement, division
+__authors__ = ["Jérôme Kieffer", "Henning O. Sorensen", "Erik Knudsen"]
+__date__ = "27/07/2017"
+__license__ = "MIT+"
+__copyright__ = "ESRF, Grenoble & Risoe National Laboratory"
+__status__ = "stable"
+
+import logging
+import numpy
+
+logger = logging.getLogger(__name__)
+from .fabioimage import FabioImage
+from .fabioutils import six
+
+SUBFORMATS = [six.b(i) for i in ('P1', 'P2', 'P3', 'P4', 'P5', 'P6', 'P7')]
+
+HEADERITEMS = [six.b(i) for i in ('SUBFORMAT', 'WIDTH', 'HEIGHT', 'MAXVAL')]
+P7HEADERITEMS = [six.b(i) for i in ('WIDTH', 'HEIGHT', 'DEPTH', 'MAXVAL', 'TUPLTYPE', 'ENDHDR')]
+
+
+class PnmImage(FabioImage):
+
+ DESCRIPTION = "PNM file format"
+
+ DEFAULT_EXTENTIONS = ["pnm", "pgm", "pbm"]
+
+ def __init__(self, *arg, **kwargs):
+ FabioImage.__init__(self, *arg, **kwargs)
+ self.header['Subformat'] = 'P5'
+
+ def _readheader(self, f):
+ # pnm images have a 3-line header but ignore lines starting with '#'
+ # 1st line contains the pnm image sub format
+ # 2nd line contains the image pixel dimension
+ # 3rd line contains the maximum pixel value (at least for grayscale - check this)
+
+ line = f.readline().strip()
+ if line not in SUBFORMATS:
+ raise IOError('unknown subformat of pnm: %s' % line)
+ else:
+ self.header[six.b('SUBFORMAT')] = line
+
+ if self.header[six.b('SUBFORMAT')] == 'P7':
+ # this one has a special header
+ while six.b('ENDHDR') not in line:
+ line = f.readline()
+ while(line[0] == '#'):
+ line = f.readline()
+ s = line.lsplit(' ', 1)
+ if s[0] not in P7HEADERITEMS:
+ raise IOError('Illegal pam (netpnm p7) headeritem %s' % s[0])
+ self.header[s[0]] = s[1]
+ else:
+ values = list(line.split())
+ while len(values) < len(HEADERITEMS):
+ line = f.readline()
+ while line[0] == '#':
+ line = f.readline()
+ values += line.split()
+ for k, v in zip(HEADERITEMS, values):
+ self.header[k] = v.strip()
+
+ # set the dimensions
+ self.dim1 = int(self.header[six.b("WIDTH")])
+ self.dim2 = int(self.header[six.b("HEIGHT")])
+ # figure out how many bytes are used to store the data
+ # case construct here!
+ m = int(self.header[six.b('MAXVAL')])
+ if m < 256:
+ self.bytecode = numpy.uint8
+ elif m < 65536:
+ self.bytecode = numpy.uint16
+ elif m < 2147483648:
+ self.bytecode = numpy.uint32
+ logger.warning('32-bit pixels are not really supported by the netpgm standard')
+ else:
+ raise IOError('could not figure out what kind of pixels you have')
+
+ def read(self, fname, frame=None):
+ """
+ try to read PNM images
+ :param fname: name of the file
+ :param frame: not relevant here! PNM is always single framed
+ """
+ self.header = self.check_header()
+ self.resetvals()
+ infile = self._open(fname)
+ self._readheader(infile)
+
+ # read the image data
+ if six.PY3:
+ fmt = str(self.header[six.b('SUBFORMAT')], encoding="latin-1")
+ else:
+ fmt = self.header[six.b('SUBFORMAT')]
+ decoder_name = "%sdec" % fmt
+ if decoder_name in dir(PnmImage):
+ decoder = getattr(PnmImage, decoder_name)
+ self.data = decoder(self, infile, self.bytecode)
+ else:
+ raise IOError("No decoder named %s for file %s" % (decoder_name, fname))
+ self.resetvals()
+ return self
+
+ def write(self, fname):
+ """
+ try to write image. For now, limited to
+ :param fname: name of the file
+ """
+ self.header[six.b("SUBFORMAT")] = "P5"
+ self.header[six.b("WIDTH")] = self.dim1
+ self.header[six.b("HEIGHT")] = self.dim2
+ self.header[six.b("MAXVAL")] = self.data.max()
+ header = six.b(" ".join([str(self.header[key]) for key in HEADERITEMS[1:]]))
+ with open(fname, "wb") as fobj:
+ fobj.write(six.b("P5 \n"))
+ fobj.write(header)
+ fobj.write(six.b(" \n"))
+ if numpy.little_endian:
+ fobj.write(self.data.byteswap().tostring())
+ else:
+ fobj.write(self.data.tostring())
+
+ def P1dec(self, buf, bytecode):
+ data = numpy.zeros((self.dim2, self.dim1))
+ i = 0
+ for l in buf:
+ try:
+ data[i, :] = numpy.array(l.split()).astype(bytecode)
+ except ValueError:
+ raise IOError('Size spec in pnm-header does not match size of image data field')
+ return data
+
+ def P4dec(self, buf, bytecode):
+ err = 'single bit (pbm) images are not supported - yet'
+ logger.error(err)
+ raise NotImplementedError(err)
+
+ def P2dec(self, buf, bytecode):
+ data = numpy.zeros((self.dim2, self.dim1))
+ i = 0
+ for l in buf:
+ try:
+ data[i, :] = numpy.array(l.split()).astype(bytecode)
+ except ValueError:
+ raise IOError('Size spec in pnm-header does not match size of image data field')
+ return data
+
+ def P5dec(self, buf, bytecode):
+ data = buf.read()
+ try:
+ data = numpy.fromstring(data, bytecode)
+ except ValueError:
+ raise IOError('Size spec in pnm-header does not match size of image data field')
+ data.shape = self.dim2, self.dim1
+ if numpy.little_endian:
+ data.byteswap(True)
+ return data
+
+ def P3dec(self, buf, bytecode):
+ err = '(plain-ppm) RGB images are not supported - yet'
+ logger.error(err)
+ raise NotImplementedError(err)
+
+ def P6dec(self, buf, bytecode):
+ err = '(ppm) RGB images are not supported - yet'
+ logger.error(err)
+ raise NotImplementedError(err)
+
+ def P7dec(self, buf, bytecode):
+ err = '(pam) images are not supported - yet'
+ logger.error(err)
+ raise NotImplementedError(err)
+
+ @staticmethod
+ def check_data(data=None):
+ if data is None:
+ return None
+ else:
+ data = data.clip(0, 65535)
+ if data.max() < 256:
+ return data.astype(numpy.uint8)
+ else:
+ return data.astype(numpy.uint16)
+
+
+pnmimage = PnmImage
diff --git a/fabio/raxisimage.py b/fabio/raxisimage.py
new file mode 100644
index 0000000..56e2e42
--- /dev/null
+++ b/fabio/raxisimage.py
@@ -0,0 +1,339 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+# Principal author: "Brian R. Pauw" "brian@stack.nl"
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE
+
+"""
+
+Authors: Brian R. Pauw
+email: brian@stack.nl
+
+Written using information gleaned from the ReadRAXISImage program
+written by T. L. Hendrixson, made available by Rigaku Americas.
+Available at: http://www.rigaku.com/downloads/software/readimage.html
+
+
+"""
+
+
+# Get ready for python3:
+from __future__ import with_statement, print_function, division
+
+__authors__ = ["Brian R. Pauw"]
+__contact__ = "brian@stack.nl"
+__license__ = "MIT"
+__copyright__ = "Brian R. Pauw"
+__date__ = "27/07/2017"
+
+import logging
+import struct
+import os
+import numpy
+from .fabioimage import FabioImage
+from .fabioutils import OrderedDict
+logger = logging.getLogger(__name__)
+
+
+RIGAKU_KEYS = OrderedDict([
+ ('InstrumentType', 10),
+ ('Version', 10),
+ ('Crystal Name', 20),
+ ('Crystal System', 12),
+ ('A', 'float'),
+ ('B', 'float'),
+ ('C', 'float'),
+ ('Alpha', 'float'),
+ ('Beta', 'float'),
+ ('Gamma', 'float'),
+ ('Space Group', 12),
+ ('Mosaicity', 'float'),
+ ('Memo', 80),
+ ('Date', 12),
+ ('Reserved Space 1', 84),
+ ('User', 20),
+ ('Xray Target', 4),
+ ('Wavelength', 'float'),
+ ('Monochromator', 20),
+ ('Monochromator 2theta', 'float'),
+ ('Collimator', 20),
+ ('Filter', 4),
+ ('Crystal-to-detector Distance', 'float'),
+ ('Generator Voltage', 'float'),
+ ('Generator Current', 'float'),
+ ('Focus', 12),
+ ('Xray Memo', 80),
+ ('IP shape', 'long'), # 1= cylindrical, 0=flat. A "long" is overkill.
+ ('Oscillation Type', 'float'), # 1=weissenberg. else regular. "float"? really?
+ ('Reserved Space 2', 56),
+ ('Crystal Mount (spindle axis)', 4),
+ ('Crystal Mount (beam axis)', 4),
+ ('Phi Datum', 'float'), # degrees
+ ('Phi Oscillation Start', 'float'), # deg
+ ('Phi Oscillation Stop', 'float'), # deg
+ ('Frame Number', 'long'),
+ ('Exposure Time', 'float'), # minutes
+ ('Direct beam X position', 'float'), # special, x,y
+ ('Direct beam Y position', 'float'), # special, x,y
+ ('Omega Angle', 'float'), # omega angle
+ ('Chi Angle', 'float'), # omega angle
+ ('2Theta Angle', 'float'), # omega angle
+ ('Mu Angle', 'float'), # omega angle
+ ('Image Template', 204), # used for storing scan template..
+ ('X Pixels', 'long'),
+ ('Y Pixels', 'long'),
+ ('X Pixel Length', 'float'), # mm
+ ('Y Pixel Length', 'float'), # mm
+ ('Record Length', 'long'),
+ ('Total', 'long'),
+ ('Starting Line', 'long'),
+ ('IP Number', 'long'),
+ ('Photomultiplier Ratio', 'float'),
+ ('Fade Time (to start of read)', 'float'),
+ ('Fade Time (to end of read)', 'float'), # good that they thought of this, but is it applied?
+ ('Host Type/Endian', 10),
+ ('IP Type', 10),
+ ('Horizontal Scan', 'long'), # 0=left->Right, 1=Rigth->Left
+ ('Vertical Scan', 'long'), # 0=down->up, 1=up->down
+ ('Front/Back Scan', 'long'), # 0=front, 1=back
+ ('Pixel Shift (RAXIS V)', 'float'),
+ ('Even/Odd Intensity Ratio (RAXIS V)', 'float'),
+ ('Magic number', 'long'), # 'RAPID'-specific
+ ('Number of Axes', 'long'),
+ ('Goniometer Vector ax.1.1', 'float'),
+ ('Goniometer Vector ax.1.2', 'float'),
+ ('Goniometer Vector ax.1.3', 'float'),
+ ('Goniometer Vector ax.2.1', 'float'),
+ ('Goniometer Vector ax.2.2', 'float'),
+ ('Goniometer Vector ax.2.3', 'float'),
+ ('Goniometer Vector ax.3.1', 'float'),
+ ('Goniometer Vector ax.3.2', 'float'),
+ ('Goniometer Vector ax.3.3', 'float'),
+ ('Goniometer Vector ax.4.1', 'float'),
+ ('Goniometer Vector ax.4.2', 'float'),
+ ('Goniometer Vector ax.4.3', 'float'),
+ ('Goniometer Vector ax.5.1', 'float'),
+ ('Goniometer Vector ax.5.2', 'float'),
+ ('Goniometer Vector ax.5.3', 'float'),
+ ('Goniometer Start ax.1', 'float'),
+ ('Goniometer Start ax.2', 'float'),
+ ('Goniometer Start ax.3', 'float'),
+ ('Goniometer Start ax.4', 'float'),
+ ('Goniometer Start ax.5', 'float'),
+ ('Goniometer End ax.1', 'float'),
+ ('Goniometer End ax.2', 'float'),
+ ('Goniometer End ax.3', 'float'),
+ ('Goniometer End ax.4', 'float'),
+ ('Goniometer End ax.5', 'float'),
+ ('Goniometer Offset ax.1', 'float'),
+ ('Goniometer Offset ax.2', 'float'),
+ ('Goniometer Offset ax.3', 'float'),
+ ('Goniometer Offset ax.4', 'float'),
+ ('Goniometer Offset ax.5', 'float'),
+ ('Goniometer Scan Axis', 'long'),
+ ('Axes Names', 40),
+ ('file', 16),
+ ('cmnt', 20),
+ ('smpl', 20),
+ ('iext', 'long'),
+ ('reso', 'long'),
+ ('save', 'long'),
+ ('dint', 'long'),
+ ('byte', 'long'),
+ ('init', 'long'),
+ ('ipus', 'long'),
+ ('dexp', 'long'),
+ ('expn', 'long'),
+ ('posx', 20),
+ ('posy', 20),
+ ('xray', 'long'),
+ # more values can be added here
+ ('Header Leftovers', -1)
+])
+
+
+class RaxisImage(FabioImage):
+ """
+ FabIO image class to read Rigaku RAXIS image files.
+ Write functions are not planned as there are plenty of more suitable
+ file formats available for storing detector data.
+ In particular, the MSB used in Rigaku files is used in an uncommon way:
+ it is used as a *multiply-by* flag rather than a normal image value bit.
+ While it is said to multiply by the value specified in the header, there
+ is at least one case where this is found not to hold, so YMMV and be careful.
+ """
+
+ DESCRIPTION = "Rigaku RAXIS file format"
+
+ DEFAULT_EXTENTIONS = ["img"]
+
+ def __init__(self, *arg, **kwargs):
+ """
+ Generic constructor
+ """
+ FabioImage.__init__(self, *arg, **kwargs)
+ self.bytecode = 'uint16' # same for all RAXIS images AFAICT
+ self.bpp = 2
+ self.endianness = '>' # this may be tested for.
+
+ def swap_needed(self):
+ """not sure if this function is needed"""
+ endian = self.endianness
+ # Decide if we need to byteswap
+ if (endian == '<' and numpy.little_endian) or (endian == '>' and not numpy.little_endian):
+ return False
+ if (endian == '>' and numpy.little_endian) or (endian == '<' and not numpy.little_endian):
+ return True
+
+ def _readheader(self, infile):
+ """
+ Read and decode the header of a Rigaku RAXIS image.
+ The Rigaku format uses a block of (at least) 1400 bytes for storing
+ information. The information has a fixed structure, but endianness
+ can be flipped for non-char values. Header items which are not
+ capitalised form part of a non-standardized data block and may not
+ be accurate.
+
+ TODO: It would be useful to have an automatic endianness test in here.
+
+ :param infile: Opened python file (can be stringIO or bzipped file)
+ """
+ endianness = self.endianness
+ # list of header key to keep the order (when writing)
+ self.header = self.check_header()
+
+ # swapBool=False
+ fs = endianness
+ minHeaderLength = 1400 # from rigaku's def
+ # if (numpy.little_endian and endianness=='>'):
+ # swapBool=True
+ # file should be open already
+ # fh=open(filename,'rb')
+ infile.seek(0) # hopefully seeking works.
+ rawHead = infile.read(minHeaderLength)
+ # fh.close() #don't like open files in case of intermediate crash
+
+ curByte = 0
+ for key, kind in RIGAKU_KEYS.items():
+ if isinstance(kind, int):
+ # read a number of bytes, convert to char.
+ # if -1, read remainder of header
+ if kind == -1:
+ rByte = len(rawHead) - curByte
+ self.header[key] = struct.unpack(fs + str(rByte) + 's',
+ rawHead[curByte: curByte + rByte])[0]
+ curByte += rByte
+ break
+
+ rByte = kind
+ self.header[key] = struct.unpack(fs + str(rByte) + 's',
+ rawHead[curByte: curByte + rByte])[0]
+ curByte += rByte
+ elif kind == 'float':
+ # read a float, 4 bytes
+ rByte = 4
+ self.header[key] = struct.unpack(fs + 'f',
+ rawHead[curByte: curByte + rByte])[0]
+ curByte += rByte
+ elif kind == 'long':
+ # read a long, 4 bytes
+ rByte = 4
+ self.header[key] = struct.unpack(fs + 'l',
+ rawHead[curByte: curByte + rByte])[0]
+ curByte += rByte
+ else:
+ logger.warning('special header data type %s not understood', kind)
+ if len(rawHead) == curByte:
+ # "end reached"
+ break
+
+ def read(self, fname, frame=None):
+ """
+ try to read image
+ :param fname: name of the file
+ :param frame:
+ """
+ self.resetvals()
+ infile = self._open(fname, 'rb')
+ offset = -1 # read from EOF backward
+ self._readheader(infile)
+
+ # we read the required bytes from the end of file, using code
+ # lifted from binaryimage
+ # read the image data
+
+ self.dim1 = self.header['X Pixels']
+ self.dim2 = self.header['Y Pixels']
+ self.bytecode = numpy.uint16
+ dims = [self.dim2, self.dim1]
+ size = dims[0] * dims[1] * self.bpp
+ if offset >= 0:
+ infile.seek(offset)
+ else:
+ try:
+ attrs = dir(infile)
+ if "measure_size" in attrs: # Handle specifically gzip
+ infile.seek(infile.measure_size() - size) # seek from EOF backwards
+ elif "size" in attrs:
+ infile.seek(infile.size - size) # seek from EOF backwards
+ if "len" in attrs:
+ infile.seek(infile.len - size) # seek from EOF backwards
+ else:
+ infile.seek(-size + offset + 1, os.SEEK_END) # seek from EOF backwards
+# infile.seek(-size + offset + 1 , os.SEEK_END) #seek from EOF backwards
+ except IOError as error:
+ logger.warning('expected datablock too large, please check bytecode settings: %s, IOError: %s' % (self.bytecode, error))
+ except Exception as error:
+ logger.error('Uncommon error encountered when reading file: %s' % error)
+ rawData = infile.read(size)
+ if self.swap_needed():
+ data = numpy.fromstring(rawData, self.bytecode).byteswap().reshape(tuple(dims))
+ else:
+ data = numpy.fromstring(rawData, self.bytecode).reshape(tuple(dims))
+# print(data)
+ di = (data >> 15) != 0 # greater than 2^15
+ if di.sum() >= 1:
+ # find indices for which we need to do the correction (for which
+ # the 16th bit is set):
+
+ logger.debug("Correct for PM: %s" % di.sum())
+ data = data << 1 >> 1 # reset bit #15 to zero
+ self.bytecode = numpy.uint32
+ data = data.astype(self.bytecode)
+ # Now we do some fixing for Rigaku's refusal to adhere to standards:
+ sf = self.header['Photomultiplier Ratio']
+ # multiply by the ratio defined in the header
+ # data[di] *= sf
+ data[di] = (sf * data[di]).astype(numpy.uint32)
+ self.bpp = numpy.dtype(self.bytecode).itemsize
+
+ self.data = data
+ return self
+
+ def rigakuKeys(self):
+ # returns dict of keys and keyLengths
+ RKey = RIGAKU_KEYS
+ orderList = list(RIGAKU_KEYS.keys())
+ return RKey, orderList
+
+
+raxisimage = RaxisImage
diff --git a/fabio/readbytestream.py b/fabio/readbytestream.py
new file mode 100644
index 0000000..0d629c3
--- /dev/null
+++ b/fabio/readbytestream.py
@@ -0,0 +1,114 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE
+
+"""Reads a bytestream
+
+Authors: Jon Wright Henning O. Sorensen & Erik Knudsen
+ ESRF Risoe National Laboratory
+"""
+# Get ready for python3:
+from __future__ import with_statement, print_function, division
+
+import logging
+import numpy
+logger = logging.getLogger(__name__)
+
+
+DATATYPES = {
+ # type sign bytes
+ ("int", 'n', 1): numpy.uint8,
+ ("int", 'n', 2): numpy.uint16,
+ ("int", 'n', 4): numpy.uint32,
+ ("int", 'y', 1): numpy.int8,
+ ("int", 'y', 2): numpy.int16,
+ ("int", 'y', 4): numpy.int32,
+ ('float', 'y', 4): numpy.float32, # does this occur in bruker?
+ ('double', 'y', 4): numpy.float64
+}
+
+
+def readbytestream(fil,
+ offset,
+ x,
+ y,
+ nbytespp,
+ datatype='int',
+ signed='n',
+ swap='n',
+ typeout=numpy.uint16):
+ """
+ Reads in a bytestream from a file (which may be a string indicating
+ a filename, or an already opened file (should be "rb"))
+ offset is the position (in bytes) where the pixel data start
+ nbytespp = number of bytes per pixel
+ type can be int or float (4 bytes pp) or double (8 bytes pp)
+ signed: normally signed data 'y', but 'n' to try to get back the
+ right numbers when unsigned data are converted to signed
+ (python once had no unsigned numeric types.)
+ swap, normally do not bother, but 'y' to swap bytes
+ typeout is the numpy type to output, normally uint16,
+ but more if overflows occurred
+ x and y are the pixel dimensions
+
+ TODO : Read in regions of interest
+
+ PLEASE LEAVE THE STRANGE INTERFACE ALONE -
+ IT IS USEFUL FOR THE BRUKER FORMAT
+ """
+ tin = "dunno"
+ length = nbytespp * x * y # bytes per pixel times number of pixels
+ if datatype in ['float', 'double']:
+ signed = 'y'
+
+ key = (datatype, signed, nbytespp)
+ try:
+ tin = DATATYPES[key]
+ except KeyError:
+ logger.warning("datatype, signed, nbytespp: %s", str(key))
+ raise Exception("Unknown combination of types to readbytestream")
+
+ # Did we get a string (filename) or a readable stream object?
+ if hasattr(fil, "read") and hasattr(fil, "seek"):
+ infile = fil
+ opened = False
+ else:
+ infile = open(fil, 'rb')
+ opened = True
+
+ infile.seek(offset)
+
+ data = numpy.fromstring(infile.read(length), tin)
+ arr = numpy.array(numpy.reshape(data, (x, y)), typeout)
+
+ if swap == 'y':
+ arr = arr.byteswap()
+
+ if opened:
+ infile.close()
+
+ return arr
diff --git a/fabio/setup.py b/fabio/setup.py
new file mode 100644
index 0000000..71f7920
--- /dev/null
+++ b/fabio/setup.py
@@ -0,0 +1,48 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2015-2016 European Synchrotron Radiation Facility
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+# ###########################################################################*/
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "31/07/2017"
+
+from numpy.distutils.misc_util import Configuration
+
+
+def configuration(parent_package='', top_path=None):
+ config = Configuration('fabio', parent_package, top_path)
+ config.add_subpackage('app')
+ config.add_subpackage('benchmark')
+ config.add_subpackage('ext')
+ config.add_subpackage('test')
+ config.add_subpackage('third_party')
+ config.add_subpackage('utils')
+
+ return config
+
+
+if __name__ == "__main__":
+ from numpy.distutils.core import setup
+
+ setup(configuration=configuration)
diff --git a/fabio/speimage.py b/fabio/speimage.py
new file mode 100644
index 0000000..daee24b
--- /dev/null
+++ b/fabio/speimage.py
@@ -0,0 +1,313 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) 2016 Univeristy Köln, Germany
+#
+# Principal author: Clemens Prescher (c.prescher@uni-koeln.de)
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+
+"""Princeton instrument SPE image reader for FabIO
+
+
+"""
+# Get ready for python3:
+from __future__ import with_statement, print_function, division
+
+__authors__ = ["Clemens Prescher"]
+__contact__ = "c.prescher@uni-koeln.de"
+__license__ = "MIT"
+__copyright__ = "Clemens Prescher"
+__date__ = "24/07/2017"
+
+import logging
+
+logger = logging.getLogger(__name__)
+
+import datetime
+from xml.dom.minidom import parseString
+
+import numpy as np
+from numpy.polynomial.polynomial import polyval
+
+from .fabioimage import FabioImage
+
+
+class SpeImage(FabioImage):
+ """FabIO image class for Images for Princeton/SPE detector
+
+ Put some documentation here
+ """
+ DATA_TYPES = {0: np.float32,
+ 1: np.int32,
+ 2: np.int16,
+ 3: np.uint16}
+
+ DESCRIPTION = "Princeton instrument SPE file format"
+
+ DEFAULT_EXTENTIONS = ["spe"]
+
+ def _readheader(self, infile):
+ """
+ Read and decode the header of an image:
+
+ :param infile: Opened python file (can be stringIO or bipped file)
+ """
+
+ self.header['version'] = self._get_version(infile)
+
+ self.header['data_type'] = self._read_at(infile, 108, 1, np.uint16)[0]
+ self.header['x_dim'] = int(self._read_at(infile, 42, 1, np.int16)[0])
+ self.header['y_dim'] = int(self._read_at(infile, 656, 1, np.int16)[0])
+ self.header['num_frames'] = self._read_at(infile, 1446, 1, np.int32)[0]
+
+ if self.header['version'] == 2:
+ self.header['time'] = self._read_date_time_from_header(infile)
+ self.header['x_calibration'] = self._read_calibration_from_header(infile)
+ self.header['exposure_time'] = self._read_at(infile, 10, 1, np.float32)[0]
+ self.header['detector'] = 'unspecified'
+ self.header['grating'] = str(self._read_at(infile, 650, 1, np.float32)[0])
+ self.header['center_wavelength'] = float(self._read_at(infile, 72, 1, np.float32)[0])
+ # # self._read_roi_from_header()
+ # self._read_num_frames_from_header()
+ # self._read_num_combined_frames_from_header()
+ elif self.header['version'] == 3:
+ xml_string = self._get_xml_string(infile)
+ dom = self._create_dom_from_xml(xml_string)
+ self.header['time'] = self._read_date_time_from_dom(dom)
+ self.header['roi'] = self._read_roi_from_dom(dom)
+ self.header['x_calibration'] = self._read_calibration_from_dom(dom)
+ self.header['exposure_time'] = self._read_exposure_from_dom(dom)
+ self.header['detector'] = self._read_detector_from_dom(dom)
+ self.header['grating'] = self._read_grating_from_dom(dom, infile)
+ self.header['center_wavelength'] = self._read_center_wavelength_from_dom(dom, infile)
+
+ self.header = self.check_header(self.header)
+
+ def read(self, fname, frame=None):
+ """
+ try to read image
+ :param fname: name of the file
+ :param frame:
+ """
+
+ self.resetvals()
+
+ with self._open(fname, 'rb') as infile:
+ self._readheader(infile)
+ # read the image data and declare
+ self.data = self._read_data(infile, frame)
+
+ return self
+
+ def _get_version(self, infile):
+ self.xml_offset = self._read_at(infile, 678, 1, np.long)[0]
+ if self.xml_offset == 0:
+ return 2
+ else:
+ return 3
+
+ def _read_date_time_from_header(self, infile):
+ """Reads the collection time from the header into the date_time field"""
+ raw_date = self._read_at(infile, 20, 9, np.int8)
+ raw_time = self._read_at(infile, 172, 6, np.int8)
+ str_date = ''.join([chr(i) for i in raw_date])
+ str_date += ''.join([chr(i) for i in raw_time])
+ date_time = datetime.datetime.strptime(str_date, "%d%b%Y%H%M%S")
+ return date_time.strftime("%m/%d/%Y %H:%M:%S")
+
+ def _read_date_time_from_dom(self, dom):
+ """Reads the time of collection and saves it date_time field"""
+ date_time_str = dom.getElementsByTagName('Origin')[0].getAttribute('created')
+ try:
+ date_time = datetime.datetime.strptime(date_time_str[:-7], "%Y-%m-%dT%H:%M:%S.%f")
+ return date_time.strftime("%m/%d/%Y %H:%M:%S.%f")
+ except ValueError:
+ date_time = datetime.datetime.strptime(date_time_str[:-6], "%Y-%m-%dT%H:%M:%S")
+ return date_time.strftime("%m/%d/%Y %H:%M:%S")
+
+ def _read_calibration_from_header(self, infile):
+ """Reads the calibration from the header into the x_calibration field"""
+ x_polynocoeff = self._read_at(infile, 3263, 6, np.double)
+ x_val = np.arange(self.header['x_dim']) + 1
+ return np.array(polyval(x_val, x_polynocoeff))
+
+ def _read_calibration_from_dom(self, dom):
+ """Reads the x calibration of the image from the xml footer and saves
+ it in the x_calibration field"""
+ spe_format = dom.childNodes[0]
+ calibrations = spe_format.getElementsByTagName('Calibrations')[0]
+ wavelengthmapping = calibrations.getElementsByTagName('WavelengthMapping')[0]
+ wavelengths = wavelengthmapping.getElementsByTagName('Wavelength')[0]
+ wavelength_values = wavelengths.childNodes[0]
+ x_calibration = np.array([float(i) for i in wavelength_values.toxml().split(',')])
+ return x_calibration[self.header['roi'][0]:self.header['roi'][1]]
+
+ def _read_num_frames_from_header(self, infile):
+ self.num_frames = self._read_at(infile, 1446, 1, np.int32)[0]
+
+ def _get_xml_string(self, infile):
+ """Reads out the xml string from the file end"""
+ if "size" in dir(infile):
+ size = infile.size
+ elif "measure_size" in dir(infile):
+ size = infile.measure_size()
+ else:
+ raise RuntimeError("Unable to guess the actual size of the file")
+ xml_size = size - self.xml_offset
+ xml = self._read_at(infile, self.xml_offset, xml_size, np.byte)
+ return ''.join([chr(i) for i in xml])
+ # if self.debug:
+ # fid = open(self.filename + '.xml', 'w')
+ # for line in self.xml_string:
+ # fid.write(line)
+ # fid.close()
+
+ def _create_dom_from_xml(self, xml_string):
+ """Creates a DOM representation of the xml footer and saves it in the
+ dom field"""
+ return parseString(xml_string)
+
+ def _read_exposure_from_dom(self, dom):
+ """Reads th exposure time of the experiment into the exposure_time field"""
+ if len(dom.getElementsByTagName('Experiment')) != 1: # check if it is a real v3.0 file
+ if len(dom.getElementsByTagName('ShutterTiming')) == 1: # check if it is a pixis detector
+ exposure_time = dom.getElementsByTagName('ExposureTime')[0].childNodes[0]
+ return np.float(exposure_time.toxml()) / 1000.0
+ else:
+ exposure_time = dom.getElementsByTagName('ReadoutControl')[0]. \
+ getElementsByTagName('Time')[0].childNodes[0].nodeValue
+ self.header['accumulations'] = dom.getElementsByTagName('Accumulations')[0].childNodes[0].nodeValue
+ return np.float(exposure_time) * np.float(self.header['accumulations'])
+ else: # this is searching for legacy experiment:
+ self._exposure_time = dom.getElementsByTagName('LegacyExperiment')[0]. \
+ getElementsByTagName('Experiment')[0]. \
+ getElementsByTagName('CollectionParameters')[0]. \
+ getElementsByTagName('Exposure')[0].attributes["value"].value
+ return np.float(self._exposure_time.split()[0])
+
+ def _read_detector_from_dom(self, dom):
+ """Reads the detector information from the dom object"""
+ self._camera = dom.getElementsByTagName('Camera')
+ if len(self._camera) >= 1:
+ return self._camera[0].getAttribute('model')
+ else:
+ return 'unspecified'
+
+ def _read_grating_from_dom(self, dom, infile):
+ """Reads the type of grating from the dom Model"""
+ try:
+ grating = dom.getElementsByTagName('Devices')[0]. \
+ getElementsByTagName('Spectrometer')[0]. \
+ getElementsByTagName('Grating')[0]. \
+ getElementsByTagName('Selected')[0].childNodes[0].toxml()
+ return grating.split('[')[1].split(']')[0].replace(',', ' ')
+ except IndexError:
+ # try from header:
+ return str(self._read_at(infile, 650, 1, np.float32)[0])
+
+ def _read_center_wavelength_from_dom(self, dom, infile):
+ """Reads the center wavelength from the dom Model and saves it center_wavelength field"""
+ try:
+ center_wavelength = dom.getElementsByTagName('Devices')[0]. \
+ getElementsByTagName('Spectrometer')[0]. \
+ getElementsByTagName('Grating')[0]. \
+ getElementsByTagName('CenterWavelength')[0]. \
+ childNodes[0].toxml()
+ return float(center_wavelength)
+ except IndexError:
+ # try from header
+ return float(self._read_at(infile, 72, 1, np.float32)[0])
+
+ def _read_roi_from_dom(self, dom):
+ """Reads the ROIs information defined in the SPE file.
+ Depending on the modus it will read out:
+ For CustomRegions
+ roi_x, roi_y, roi_width, roi_height, roi_x_binning, roi_y_binning
+ For FullSensor
+ roi_x,roi_y, roi_width, roi_height"""
+ try:
+ roi_modus = str(dom.getElementsByTagName('ReadoutControl')[0].
+ getElementsByTagName('RegionsOfInterest')[0].
+ getElementsByTagName('Selection')[0].
+ childNodes[0].toxml())
+ if roi_modus == 'CustomRegions':
+ roi_dom = dom.getElementsByTagName('ReadoutControl')[0]. \
+ getElementsByTagName('RegionsOfInterest')[0]. \
+ getElementsByTagName('CustomRegions')[0]. \
+ getElementsByTagName('RegionOfInterest')[0]
+ roi_x = int(roi_dom.attributes['x'].value)
+ roi_y = int(roi_dom.attributes['y'].value)
+ roi_width = int(roi_dom.attributes['width'].value)
+ roi_height = int(roi_dom.attributes['height'].value)
+ else:
+ roi_x = 0
+ roi_y = 0
+ roi_width = self.header['x_dim']
+ roi_height = self.header['y_dim']
+
+ except IndexError:
+ roi_x = 0
+ roi_y = 0
+ roi_width = self.header['x_dim']
+ roi_height = self.header['y_dim']
+
+ return roi_x, roi_x + roi_width, roi_y, roi_y + roi_height
+
+ def _read_at(self, infile, pos, size, ntype):
+ infile.seek(pos)
+ dtype = np.dtype(ntype)
+ bp = dtype.itemsize
+ data = infile.read(size * bp)
+ return np.fromstring(data, dtype)
+
+ def _read_data(self, infile, frame=None):
+ if frame is None:
+ frame = 0
+ dtype = self.DATA_TYPES.get(self.header['data_type'])
+ if dtype is None:
+ raise RuntimeError("Unsuported data type: %s" % self.header['data_type'])
+ number_size = np.dtype(dtype).itemsize
+ frame_size = self.header['x_dim'] * self.header['y_dim'] * number_size
+ return self._read_frame(infile, 4100 + frame * frame_size)
+
+ def _read_frame(self, infile, pos=None):
+ """Reads in a frame at a specific binary position. The following header parameters have to
+ be predefined before calling this function:
+ datatype - either 0,1,2,3 for float32, int32, int16 or uint16
+ x_dim, y_dim - being the dimensions.
+ """
+ if pos is None:
+ pos = infile.tell()
+ dtype = self.DATA_TYPES.get(self.header['data_type'])
+
+ if dtype is None:
+ return None
+
+ data = self._read_at(infile, pos, self.header['x_dim'] * self.header['y_dim'], dtype)
+ return data.reshape((self.header['y_dim'], self.header['x_dim']))
+
+
+# this is not compatibility with old code:
+speimage = SpeImage
diff --git a/fabio/templateimage.py b/fabio/templateimage.py
new file mode 100644
index 0000000..996f49c
--- /dev/null
+++ b/fabio/templateimage.py
@@ -0,0 +1,131 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+
+"""Template for FabIO image reader
+
+This is a template for adding new file formats to FabIO
+
+We hope it will be relatively easy to add new file formats to fabio in the
+future.
+The basic idea is the following:
+
+1) inherit from FabioImage overriding the methods _readheader, read and optionally write.
+ Name your new module XXXimage where XXX means something (eg tifimage).
+
+2) readheader fills in a dictionary of "name":"value" pairs in self.header.
+ No one expects to find anything much in there.
+
+3) read fills in self.data with a numpy array holding the image.
+ Some info are automatically exposed from data:
+ * self.dim1 and self.dim2: the image dimensions,
+ * self.bpp is the bytes per pixel
+ * self.bytecode is the numpy.dtype.type of the data.
+
+4) The member variables "_need_a_seek_to_read" and "_need_a_real_file" are there
+ in case you have
+ trouble with the transparent handling of bz2 and gz files.
+
+5) Add your new module as an import into fabio.fabioformats.
+ Your class will be registered automatically.
+
+6) Fill out the magic numbers for your format in fabio.openimage if you know
+ them (the characteristic first few bytes in the file)
+
+7) Upload a testimage to the file release system and create a unittest testcase
+ which opens an example of your new format, confirming the image has actually
+ been read in successfully (eg check the mean, max, min and esd are all correct,
+ perhaps orientation too)
+
+8) Run pylint on your code and then please go clean it up. Have a go at mine
+ while you are at it, before requesting a pull-request on github.
+
+9) Bask in the warm glow of appreciation when someone unexpectedly learns they
+ don't need to convert their data into another format
+
+"""
+# Get ready for python3:
+from __future__ import with_statement, print_function, division
+
+__authors__ = ["author"]
+__contact__ = "name@institut.org"
+__license__ = "MIT"
+__copyright__ = "Institut"
+__date__ = "22/08/2017"
+
+import logging
+logger = logging.getLogger(__name__)
+import numpy
+from .fabioimage import FabioImage, OrderedDict
+
+
+class TemplateImage(FabioImage):
+ """FabIO image class for Images for XXX detector
+
+ Put some documentation here
+ """
+
+ DESCRIPTION = "Name of the file format"
+
+ DEFAULT_EXTENTIONS = []
+
+ def __init__(self, *arg, **kwargs):
+ """
+ Generic constructor
+ """
+ FabioImage.__init__(self, *arg, **kwargs)
+
+ def _readheader(self, infile):
+ """
+ Read and decode the header of an image:
+
+ :param infile: Opened python file (can be stringIO or bipped file)
+ """
+ # list of header key to keep the order (when writing)
+ self.header = self.check_header()
+
+ def read(self, fname, frame=None):
+ """
+ Try to read image
+
+ :param fname: name of the file
+ :param frame: number of the frame
+ """
+
+ self.resetvals()
+ with self._open(fname) as infile:
+ self._readheader(infile)
+ # read the image data and declare it
+
+ shape = (50, 60)
+ self.data = numpy.zeros(shape, dtype=self.uint16)
+ # Nota: dim1, dim2, bytecode and bpp are properties defined by the dataset
+ return self
+
+
+# This is not compatibility with old code:
+templateimage = TemplateImage
diff --git a/fabio/test/__init__.py b/fabio/test/__init__.py
new file mode 100755
index 0000000..cd7f251
--- /dev/null
+++ b/fabio/test/__init__.py
@@ -0,0 +1,56 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+"""
+Test module FabIO
+"""
+
+__authors__ = ["Jérôme Kieffer"]
+__contact__ = "jerome.kieffer@esrf.eu"
+__license__ = "GPLv3+"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__data__ = "30/10/2015"
+
+import sys
+import unittest
+from . import utilstest
+from . import test_all
+
+
+def suite():
+ test_suite = unittest.TestSuite()
+ test_suite.addTest(test_all.suite())
+ return test_suite
+
+
+def run_tests():
+ """Run test complete test_suite"""
+ mysuite = test_all.suite()
+ runner = unittest.TextTestRunner()
+ if not runner.run(mysuite).wasSuccessful():
+ print("Test suite failed")
+ return 1
+ else:
+ print("Test suite succeeded")
+ return 0
diff --git a/fabio/test/profile_all.py b/fabio/test/profile_all.py
new file mode 100755
index 0000000..dc552f1
--- /dev/null
+++ b/fabio/test/profile_all.py
@@ -0,0 +1,85 @@
+#!/usr/bin/python
+# coding: utf-8
+#
+# Project: Azimuthal integration
+# https://github.com/pyFAI/pyFAI
+#
+# Copyright (C) 2015 European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+"""Test suite for all pyFAI modules with timing and memory profiling"""
+
+from __future__ import absolute_import, division, print_function
+
+__authors__ = ["Jérôme Kieffer"]
+__contact__ = "jerome.kieffer@esrf.eu"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "24/07/2017"
+
+
+import sys
+import os
+import unittest
+import time
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+from . import test_all
+
+import resource
+import logging
+profiler = logging.getLogger("memProf")
+profiler.setLevel(logging.DEBUG)
+profiler.handlers.append(logging.FileHandler("profile.log"))
+
+
+class TestResult(unittest.TestResult):
+
+ def startTest(self, test):
+ self.__mem_start = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
+ self.__time_start = time.time()
+ unittest.TestResult.startTest(self, test)
+
+ def stopTest(self, test):
+ unittest.TestResult.stopTest(self, test)
+ profiler.info("Time: %.3fs \t RAM: %.3f Mb\t%s" % (time.time() - self.__time_start,
+ (resource.getrusage(resource.RUSAGE_SELF).ru_maxrss - self.__mem_start) / 1e3,
+ test.id()))
+
+
+class ProfileTestRunner(unittest.TextTestRunner):
+ def _makeResult(self):
+ return TestResult(stream=sys.stderr, descriptions=True, verbosity=1)
+
+
+if __name__ == '__main__':
+ suite = test_all.suite()
+ runner = ProfileTestRunner()
+ testresult = runner.run(suite)
+ if testresult.wasSuccessful():
+ # UtilsTest.clean_up()
+ print("all tests passed")
+ else:
+ sys.exit(1)
diff --git a/fabio/test/setup.py b/fabio/test/setup.py
new file mode 100644
index 0000000..2c9e321
--- /dev/null
+++ b/fabio/test/setup.py
@@ -0,0 +1,39 @@
+# coding: utf-8
+# /*##########################################################################
+# Copyright (C) 2016 European Synchrotron Radiation Facility
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+# ############################################################################*/
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "31/07/2017"
+
+from numpy.distutils.misc_util import Configuration
+
+
+def configuration(parent_package='', top_path=None):
+ config = Configuration('test', parent_package, top_path)
+ return config
+
+
+if __name__ == "__main__":
+ from numpy.distutils.core import setup
+ setup(configuration=configuration)
diff --git a/fabio/test/testGEimage.py b/fabio/test/testGEimage.py
new file mode 100644
index 0000000..72b6592
--- /dev/null
+++ b/fabio/test/testGEimage.py
@@ -0,0 +1,84 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+# Unit tests
+
+# builds on stuff from ImageD11.test.testpeaksearch
+28/11/2014
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from fabio.GEimage import GEimage
+# filename dim1 dim2 min max mean stddev
+TESTIMAGES = """GE_aSI_detector_image_1529 2048 2048 1515 16353 1833.0311 56.9124
+ GE_aSI_detector_image_1529.gz 2048 2048 1515 16353 1833.0311 56.9124
+ GE_aSI_detector_image_1529.bz2 2048 2048 1515 16353 1833.0311 56.9124"""
+
+
+class TestGE(unittest.TestCase):
+
+ def setUp(self):
+ """
+ download images
+ """
+ self.GE = UtilsTest.getimage("GE_aSI_detector_image_1529.bz2")
+
+ def test_read(self):
+ for line in TESTIMAGES.split("\n"):
+ vals = line.split()
+ name = vals[0]
+ dim1, dim2 = [int(x) for x in vals[1:3]]
+ mini, maxi, mean, stddev = [float(x) for x in vals[3:]]
+ obj = GEimage()
+ obj.read(os.path.join(os.path.dirname(self.GE), name))
+
+ self.assertAlmostEqual(mini, obj.getmin(), 4, "getmin")
+ self.assertAlmostEqual(maxi, obj.getmax(), 4, "getmax")
+ self.assertAlmostEqual(mean, obj.getmean(), 4, "getmean")
+ self.assertAlmostEqual(stddev, obj.getstddev(), 4, "getstddev")
+ self.assertEqual(dim1, obj.dim1, "dim1")
+ self.assertEqual(dim2, obj.dim2, "dim2")
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestGE))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testOXDimage.py b/fabio/test/testOXDimage.py
new file mode 100644
index 0000000..47e7e89
--- /dev/null
+++ b/fabio/test/testOXDimage.py
@@ -0,0 +1,190 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE
+#
+
+"""
+# Unit tests for OXD image (Oxford diffraction now Rigaku)
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+
+__author__ = "Jerome Kieffer"
+__license__ = "MIT"
+__date__ = "2016-11-23"
+__contact__ = "jerome.kieffer@esrf.fr"
+
+import unittest
+import sys
+import os
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from fabio.OXDimage import OXDimage
+
+
+# filename dim1 dim2 min max mean stddev values are from OD Sapphire 3.0
+TESTIMAGES = [
+ ("b191_1_9_1.img", 512, 512, -500, 11975, 25.70, 90.2526, "Sapphire2"),
+ ("b191_1_9_1_uncompressed.img", 512, 512, -500, 11975, 25.70, 90.2526, "Sapphire2"),
+ ("100nmfilmonglass_1_1.img", 1024, 1024, -172, 460, 44.20, 63.0245, "Sapphire3"),
+ ("pilatus300k.rod_img", 487, 619, -2, 173075, 27.315, 538.938, "Pilatus")]
+
+
+class TestOxd(unittest.TestCase):
+ def setUp(self):
+ self.fn = {}
+ for vals in TESTIMAGES:
+ name = vals[0]
+ self.fn[name] = UtilsTest.getimage(name + ".bz2")[:-4]
+ for i in self.fn:
+ assert os.path.exists(self.fn[i])
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ self.fn = {}
+
+ def test_read(self):
+ "Test reading of compressed OXD images"
+ for vals in TESTIMAGES:
+ name = vals[0]
+ dim1, dim2 = vals[1:3]
+ mini, maxi, mean, stddev = vals[3:7]
+ detector_type = vals[7]
+ obj = OXDimage()
+ obj.read(self.fn[name])
+
+ self.assertEqual(dim1, obj.dim1, "dim1")
+ self.assertEqual(dim2, obj.dim2, "dim2")
+
+ self.assertAlmostEqual(mini, obj.getmin(), 2, "getmin on " + name)
+ self.assertAlmostEqual(maxi, obj.getmax(), 2, "getmax on " + name)
+ self.assertAlmostEqual(mean, obj.getmean(), 2, "getmean on " + name)
+ self.assertAlmostEqual(stddev, obj.getstddev(), 2, "getstddev on " + name)
+
+ self.assertIn(detector_type, obj.header["Detector type"], "detector type on " + name)
+
+ def test_write(self):
+ "Test writing with self consistency at the fabio level"
+ for vals in TESTIMAGES:
+ name = vals[0]
+ obj = OXDimage()
+ obj.read(self.fn[name])
+ if obj.header.get("Compression") not in ["NO ", "TY1"]:
+ logger.info("Skip write test for now")
+ continue
+ obj.write(os.path.join(UtilsTest.tempdir, name))
+ other = OXDimage()
+ other.read(os.path.join(UtilsTest.tempdir, name))
+ self.assertEqual(abs(obj.data - other.data).max(), 0, "data are not the same for %s" % name)
+ for key in obj.header:
+ if key == "filename":
+ continue
+ self.assertTrue(key in other.header, "Key %s is in header" % key)
+ self.assertEqual(obj.header[key], other.header[key], "metadata '%s' are not the same for %s" % (key, name))
+
+ os.unlink(os.path.join(UtilsTest.tempdir, name))
+
+
+class TestOxdSame(unittest.TestCase):
+ def setUp(self):
+ self.fn = {}
+ for i in ["b191_1_9_1.img", "b191_1_9_1_uncompressed.img"]:
+ self.fn[i] = UtilsTest.getimage(i + ".bz2")[:-4]
+ for i in self.fn:
+ assert os.path.exists(self.fn[i])
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ self.fn = {}
+
+ def test_same(self):
+ """test if images are actually the same"""
+ o1 = fabio.open(self.fn["b191_1_9_1.img"])
+ o2 = fabio.open(self.fn["b191_1_9_1_uncompressed.img"])
+ for attr in ["getmin", "getmax", "getmean", "getstddev"]:
+ a1 = getattr(o1, attr)()
+ a2 = getattr(o2, attr)()
+ self.assertEqual(a1, a2, "testing %s: %s | %s" % (attr, a1, a2))
+
+
+class TestOxdBig(unittest.TestCase):
+ """class to test bugs if OI is large (lot of exceptions 16 bits)"""
+ def setUp(self):
+ self.fn = {}
+ for i in ["d80_60s.img", "d80_60s.edf"]:
+ self.fn[i] = UtilsTest.getimage(i + ".bz2")[:-4]
+ for i in self.fn:
+ self.assertTrue(os.path.exists(self.fn[i]), self.fn[i])
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ self.fn = {}
+
+ def test_same(self):
+ df = [fabio.open(i).data for i in self.fn.values()]
+ self.assertEqual(abs(df[0] - df[1]).max(), 0, "Data are the same")
+
+
+class TestConvert(unittest.TestCase):
+ def setUp(self):
+ self.fn = {}
+ for i in ["face.msk"]:
+ self.fn[i] = UtilsTest.getimage(i + ".bz2")[:-4]
+ for i in self.fn:
+ self.assertTrue(os.path.exists(self.fn[i]), self.fn[i])
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ self.fn = {}
+
+ def test_convert(self):
+ fn = self.fn["face.msk"]
+ dst = os.path.join(UtilsTest.tempdir, "face.oxd")
+ fabio.open(fn).convert("oxd").save(dst)
+ self.assertTrue(os.path.exists(dst), "destination file exists")
+ os.unlink(dst)
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestOxd))
+ testsuite.addTest(loadTests(TestOxdSame))
+ testsuite.addTest(loadTests(TestOxdBig))
+ testsuite.addTest(loadTests(TestConvert))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testXSDimage.py b/fabio/test/testXSDimage.py
new file mode 100755
index 0000000..9a243e3
--- /dev/null
+++ b/fabio/test/testXSDimage.py
@@ -0,0 +1,102 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+# Unit tests
+
+# builds on stuff from ImageD11.test.testpeaksearch
+"""
+
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+
+import fabio.xsdimage
+import numpy
+
+# filename dim1 dim2 min max mean stddev values are from OD Sapphire 3.0
+TESTIMAGES = """XSDataImage.xml 512 512 86 61204 511.63 667.15
+ XSDataImageInv.xml 512 512 -0.2814 0.22705039 2.81e-08 0.010"""
+
+
+class TestXSD(unittest.TestCase):
+ def setUp(self):
+ if fabio.xsdimage.etree is None:
+ self.skipTest("etree is not available")
+
+ self.fn = {}
+ for i in ["XSDataImage.edf", "XSDataImage.xml", "XSDataImageInv.xml"]:
+ self.fn[i] = UtilsTest.getimage(i + ".bz2")[:-4]
+
+ def test_read(self):
+ "Test reading of XSD images"
+ for line in TESTIMAGES.split("\n"):
+ vals = line.split()
+ name = vals[0]
+ dim1, dim2 = [int(x) for x in vals[1:3]]
+ mini, maxi, mean, stddev = [float(x) for x in vals[3:]]
+ obj = fabio.xsdimage.xsdimage()
+ obj.read(self.fn[name])
+
+ self.assertAlmostEqual(mini, obj.getmin(), 2, "getmin")
+ self.assertAlmostEqual(maxi, obj.getmax(), 2, "getmax")
+ self.assertAlmostEqual(mean, obj.getmean(), 2, "getmean")
+ logger.info("%s %s %s" % (name, stddev, obj.getstddev()))
+ self.assertAlmostEqual(stddev, obj.getstddev(), 2, "getstddev")
+ self.assertEqual(dim1, obj.dim1, "dim1")
+ self.assertEqual(dim2, obj.dim2, "dim2")
+
+ def test_same(self):
+ """ test if an image is the same as the EDF equivalent"""
+ xsd = fabio.open(self.fn["XSDataImage.xml"])
+ edf = fabio.open(self.fn["XSDataImage.edf"])
+ self.assertAlmostEqual(0, abs(xsd.data - edf.data).max(), 1, "images are the same")
+
+ def test_invert(self):
+ """ Tests that 2 matrixes are invert """
+ m1 = fabio.open(self.fn["XSDataImage.xml"])
+ m2 = fabio.open(self.fn["XSDataImageInv.xml"])
+ delta = abs((numpy.matrix(m1.data) * numpy.matrix(m2.data)) - numpy.identity(m1.data.shape[0])).max()
+ if delta >= 1e-3:
+ logger.error("Matrices are not invert of each other !!! prod = %s", numpy.matrix(m1.data) * numpy.matrix(m2.data))
+ self.assertTrue(delta < 1e-3, "matrices are invert of each other")
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestXSD))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/test_all.py b/fabio/test/test_all.py
new file mode 100755
index 0000000..6671926
--- /dev/null
+++ b/fabio/test/test_all.py
@@ -0,0 +1,118 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+"""Test suite for all fabio modules."""
+from __future__ import print_function, with_statement, division, absolute_import
+
+import unittest
+import sys
+import os
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from . import testfabioimage
+from . import testedfimage
+from . import testcbfimage
+from . import testfilenames
+from . import test_file_series
+from . import test_filename_steps
+from . import testadscimage
+from . import testfit2dmaskimage
+from . import testGEimage
+from . import testheadernotsingleton
+from . import testmar345image
+from . import testbrukerimage
+from . import testbruker100image
+from . import testmccdimage
+from . import testopenheader
+from . import testopenimage
+from . import testOXDimage
+from . import testkcdimage
+from . import testtifimage
+from . import testXSDimage
+from . import testraxisimage
+from . import testpnmimage
+from . import test_flat_binary
+from . import testnumpyimage
+from . import testcompression
+from . import testpilatusimage
+from . import test_nexus
+from . import testeigerimage
+from . import testhdf5image
+from . import testfit2dimage
+from . import testspeimage
+from . import testfabioconvert
+from . import testjpegimage
+from . import testjpeg2kimage
+from . import testmpaimage
+
+
+def suite():
+ testSuite = unittest.TestSuite()
+ testSuite.addTest(testfabioimage.suite())
+ testSuite.addTest(testedfimage.suite())
+ testSuite.addTest(testcbfimage.suite())
+ testSuite.addTest(testfilenames.suite())
+ testSuite.addTest(test_file_series.suite())
+ testSuite.addTest(test_filename_steps.suite())
+ testSuite.addTest(testadscimage.suite())
+ testSuite.addTest(testfit2dmaskimage.suite())
+ testSuite.addTest(testGEimage.suite())
+ testSuite.addTest(testheadernotsingleton.suite())
+ testSuite.addTest(testmar345image.suite())
+ testSuite.addTest(testbrukerimage.suite())
+ testSuite.addTest(testbruker100image.suite())
+ testSuite.addTest(testmccdimage.suite())
+ testSuite.addTest(testopenheader.suite())
+ testSuite.addTest(testopenimage.suite())
+ testSuite.addTest(testOXDimage.suite())
+ testSuite.addTest(testkcdimage.suite())
+ testSuite.addTest(testtifimage.suite())
+ testSuite.addTest(testXSDimage.suite())
+ testSuite.addTest(testraxisimage.suite())
+ testSuite.addTest(testpnmimage.suite())
+ testSuite.addTest(test_flat_binary.suite())
+ testSuite.addTest(testnumpyimage.suite())
+ testSuite.addTest(testcompression.suite())
+ testSuite.addTest(testpilatusimage.suite())
+ testSuite.addTest(test_nexus.suite())
+ testSuite.addTest(testeigerimage.suite())
+ testSuite.addTest(testhdf5image.suite())
+ testSuite.addTest(testfit2dimage.suite())
+ testSuite.addTest(testspeimage.suite())
+ testSuite.addTest(testfabioconvert.suite())
+ testSuite.addTest(testjpegimage.suite())
+ testSuite.addTest(testjpeg2kimage.suite())
+ testSuite.addTest(testmpaimage.suite())
+ return testSuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ if not runner.run(suite()).wasSuccessful():
+ sys.exit(1)
diff --git a/fabio/test/test_all_images.py b/fabio/test/test_all_images.py
new file mode 100644
index 0000000..0899d52
--- /dev/null
+++ b/fabio/test/test_all_images.py
@@ -0,0 +1,104 @@
+
+"""
+Check we can read all the test images
+"""
+from __future__ import print_function
+
+import glob
+import os
+import time
+import fabio.openimage
+from ..third_party import gzip
+import bz2
+import pstats
+import sys
+try:
+ import cProfile
+except ImportError:
+ import profile as cProfile
+
+times = {}
+images = []
+
+for fname in glob.glob(os.path.join("testimages", "*")):
+ if fname.find("header_only") == -1:
+ images.append(fname)
+
+images.sort()
+
+
+def shellbench(cmd, imname):
+ """
+ The shell appears to be lying about it's performance. It claims
+ zero time to gunzip a file when it actually takes 200 ms. This is
+ cheating via a cache I suspect. We shall try to avoid this problem
+ """
+ if sys.platform != "win32":
+ os.system("touch " + imname)
+ astart = time.time()
+ dummy_file = os.popen(cmd + " " + imname, "rb").read()
+ return time.time() - astart
+
+
+print("I/O 1 : Time to read the image")
+print("I/O 2 : Time to read the image (repeat")
+print("Fabio : Time for fabio to read the image")
+print("Shell : Time for shell to do decompression")
+print("Python : Time for python to do decompression\n")
+
+print("I/O 1 I/O 2 Fabio Shell Python Size/MB")
+for im in images:
+ # Network/disk io time first
+ start = time.clock()
+ the_file = open(im, "rb").read()
+ times[im] = [time.clock() - start]
+ start = time.clock()
+ # Network/disk should be cached
+ the_file = open(im, "rb").read()
+ times[im].append(time.clock() - start)
+ start = time.clock()
+ try:
+ fim = fabio.openimage.openimage(im)
+ except KeyboardInterrupt:
+ raise
+ except:
+ print("Problem with", im)
+ continue
+ # raise
+ times[im].append(time.clock() - start)
+ nt = 3
+ ns = 2
+ # Now check for a fabio slowdown effect
+ if im[-3:] == '.gz':
+ times[im].append(shellbench("gzip -cd ", im))
+ nt += 1
+ ns -= 1
+ start = time.clock()
+ the_file = gzip.GzipFile(im, "rb").read()
+ times[im].append(time.clock() - start)
+ nt += 1
+ ns -= 1
+ if im[-4:] == '.bz2':
+ times[im].append(shellbench("bzip2 -cd ", im))
+ nt += 1
+ ns -= 1
+ start = time.clock()
+ the_file = bz2.BZ2File(im, "rb").read()
+ times[im].append(time.clock() - start)
+ nt += 1
+ ns -= 1
+ # Speed ratings in megabytes per second (for fabio)
+ MB = len(the_file) / 1024.0 / 1024.0
+ try:
+ print(("%.4f "*nt + " "*7 * ns) % tuple(times[im]), "%8.3f" % (MB), im)
+ except:
+ print(times[im], MB, im)
+ raise
+
+ cProfile.run("fabio.openimage.openimage(im)", "stats")
+ p = pstats.Stats("stats")
+ # Hack around python2.4
+ s = sys.stdout
+ sys.stdout = open("profile.txt", "a")
+ p.strip_dirs().sort_stats(-1).print_stats()
+ sys.stdout = s
diff --git a/fabio/test/test_file_series.py b/fabio/test/test_file_series.py
new file mode 100644
index 0000000..c4fc30f
--- /dev/null
+++ b/fabio/test/test_file_series.py
@@ -0,0 +1,126 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+"""
+test cases for fileseries
+
+28/11/2014
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+import bz2
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from fabio.file_series import numbered_file_series, file_series
+
+
+class TestRandomSeries(unittest.TestCase):
+ """arbitrary series"""
+
+ def setUp(self):
+ """sets up"""
+ self.fso = file_series(["first", "second", "last"])
+
+ def testfirst(self):
+ """check first"""
+ self.assertEqual("first", self.fso.first())
+
+ def testlast(self):
+ """check first"""
+ self.assertEqual("last", self.fso.last())
+
+ def testjump(self):
+ """check jump"""
+ self.assertEqual("second", self.fso.jump(1))
+
+
+class TestEdfNumbered(unittest.TestCase):
+ """
+ Typical sequence of edf files
+ """
+ def setUp(self):
+ """ note extension has the . in it"""
+ self.fso = numbered_file_series("mydata", 0, 10005, ".edf")
+
+ def testfirst(self):
+ """ first in series"""
+ self.assertEqual(self.fso.first(), "mydata0000.edf")
+
+ def testlast(self):
+ """ last in series"""
+ self.assertEqual(self.fso.last(), "mydata10005.edf")
+
+ def testnext(self):
+ """ check all in order """
+ mylist = ["mydata%04d.edf" % (i) for i in range(0, 10005)]
+ i = 1
+ while i < len(mylist):
+ self.assertEqual(mylist[i], self.fso.next())
+ i += 1
+
+ def testprevious(self):
+ """ check all in order """
+ mylist = ["mydata%04d.edf" % (i) for i in range(0, 10005)]
+ i = 10003
+ self.fso.jump(10004)
+ while i > 0:
+ self.assertEqual(mylist[i], self.fso.previous())
+ i -= 1
+
+ def testprevjump(self):
+ """check current"""
+ self.fso.jump(9999)
+ self.assertEqual("mydata9999.edf", self.fso.current())
+ self.assertEqual("mydata9998.edf", self.fso.previous())
+
+ def testnextjump(self):
+ """check current"""
+ self.fso.jump(9999)
+ self.assertEqual("mydata9999.edf", self.fso.current())
+ self.assertEqual("mydata10000.edf", self.fso.next())
+
+ def testlen(self):
+ """check len"""
+ self.assertEqual(self.fso.len(), 10006) # +1 for 0000
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestRandomSeries))
+ testsuite.addTest(loadTests(TestEdfNumbered))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/test_filename_steps.py b/fabio/test/test_filename_steps.py
new file mode 100644
index 0000000..347ef5d
--- /dev/null
+++ b/fabio/test/test_filename_steps.py
@@ -0,0 +1,83 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+Test cases for the Next/Previous ...
+
+28/11/2014
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+
+
+class TestNext(unittest.TestCase):
+ def test_next1(self):
+ for name, next_ in [["data0001.edf", "data0002.edf"],
+ ["bob1.edf", "bob2.edf"],
+ ["1.edf", "2.edf"],
+ ["1.mar2300", "2.mar2300"],
+ ]:
+ self.assertEqual(next_, fabio.next_filename(name))
+
+
+class TestPrev(unittest.TestCase):
+ def test_prev1(self):
+ for name, prev in [["data0001.edf", "data0000.edf"],
+ ["bob1.edf", "bob0.edf"],
+ ["1.edf", "0.edf" ],
+ ["1.mar2300", "0.mar2300"],
+ ]:
+ self.assertEqual(prev, fabio.previous_filename(name))
+
+
+class TestJump(unittest.TestCase):
+ def test_jump1(self):
+ for name, res, num in [["data0001.edf", "data99993.edf", 99993],
+ ["bob1.edf", "bob0.edf", 0],
+ ["1.edf", "123456.edf", 123456],
+ ["mydata001.mar2300.gz", "mydata003.mar2300.gz", 3],
+ ]:
+ self.assertEqual(res, fabio.jump_filename(name, num))
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestNext))
+ testsuite.addTest(loadTests(TestPrev))
+ testsuite.addTest(loadTests(TestJump))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/test_flat_binary.py b/fabio/test/test_flat_binary.py
new file mode 100644
index 0000000..f2411d0
--- /dev/null
+++ b/fabio/test/test_flat_binary.py
@@ -0,0 +1,91 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+Test cases for the flat binary images
+
+testsuite by Jerome Kieffer (Jerome.Kieffer@esrf.eu)
+28/11/2014
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+
+
+class TestFlatBinary(unittest.TestCase):
+
+ filenames = [os.path.join(UtilsTest.tempdir, i)
+ for i in ("not.a.file",
+ "bad_news_1234",
+ "empty_files_suck_1234.edf",
+ "notRUBY_1234.dat")]
+
+ def setUp(self):
+ for filename in self.filenames:
+ with open(filename, "wb") as f:
+ # A 2048 by 2048 blank image
+ f.write("\0x0" * 2048 * 2048 * 2)
+
+ def test_openimage(self):
+ """
+ test the opening of "junk" empty images ...
+ JK: I wonder if this test makes sense !
+ """
+ nfail = 0
+ for filename in self.filenames:
+ try:
+ im = fabio.open(filename)
+ if im.data.tostring() != "\0x0" * 2048 * 2048 * 2:
+ nfail += 1
+ else:
+ logger.info("**** Passed: %s" % filename)
+ except:
+ logger.warning("failed for: %s" % filename)
+ nfail += 1
+ self.assertEqual(nfail, 0, " %s failures out of %s" % (nfail, len(self.filenames)))
+
+ def tearDown(self):
+ for filename in self.filenames:
+ os.remove(filename)
+
+
+def suite():
+ # loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ # testsuite.addTest(loadTests(TestFlatBinary))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/test_nexus.py b/fabio/test/test_nexus.py
new file mode 100644
index 0000000..e11a136
--- /dev/null
+++ b/fabio/test/test_nexus.py
@@ -0,0 +1,80 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""Unit tests for nexus file reader
+"""
+
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import os
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+logger = UtilsTest.get_logger(__file__)
+
+from .. import nexus
+
+
+class TestNexus(unittest.TestCase):
+
+ def setUp(self):
+ if nexus.h5py is None:
+ self.skipTest("h5py library is not available. Skipping Nexus test")
+
+ def test_nexus(self):
+ "Test creation of Nexus files"
+ fname = os.path.join(UtilsTest.tempdir, "nexus.h5")
+ nex = nexus.Nexus(fname)
+ entry = nex.new_entry("entry")
+ nex.new_instrument(entry, "ID00")
+ nex.new_detector("camera")
+ self.assertEqual(len(nex.get_entries()), 2, "nexus file has 2 entries")
+ nex.close()
+ self.assertTrue(os.path.exists(fname))
+ os.unlink(fname)
+
+ def test_from_time(self):
+ fname = os.path.join(UtilsTest.tempdir, "nexus.h5")
+ nex = nexus.Nexus(fname)
+ entry = nex.new_entry("entry")
+ time1 = nexus.from_isotime(entry["start_time"].value)
+ entry["bad_time"] = [entry["start_time"].value] # this is a list
+ time2 = nexus.from_isotime(entry["bad_time"].value)
+ self.assertEqual(time1, time2, "start_time in list does not works !")
+ nex.close()
+ self.assertTrue(os.path.exists(fname))
+ os.unlink(fname)
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestNexus))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testadscimage.py b/fabio/test/testadscimage.py
new file mode 100644
index 0000000..3239448
--- /dev/null
+++ b/fabio/test/testadscimage.py
@@ -0,0 +1,114 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+"""
+# Unit tests
+
+# builds on stuff from ImageD11.test.testpeaksearch
+
+Updated by Jerome Kieffer (jerome.kieffer@esrf.eu), 2011
+28/11/2014
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from fabio.adscimage import adscimage
+from fabio.edfimage import edfimage
+
+
+# statistics come from fit2d I think
+# filename dim1 dim2 min max mean stddev
+TESTIMAGES = """mb_LP_1_001.img 3072 3072 0.0000 65535. 120.33 147.38
+ mb_LP_1_001.img.gz 3072 3072 0.0000 65535. 120.33 147.38
+ mb_LP_1_001.img.bz2 3072 3072 0.0000 65535. 120.33 147.38"""
+
+
+class TestMatch(unittest.TestCase):
+ """
+ check the ??fit2d?? conversion to edf gives same numbers
+ """
+ def setUp(self):
+ """ Download images """
+ self.fn_adsc = UtilsTest.getimage("mb_LP_1_001.img.bz2")[:-4]
+ self.fn_edf = UtilsTest.getimage("mb_LP_1_001.edf.bz2")[:-4]
+
+ def testsame(self):
+ """test ADSC image match to EDF"""
+ im1 = edfimage()
+ im1.read(self.fn_edf)
+ im2 = adscimage()
+ im2.read(self.fn_adsc)
+ diff = (im1.data.astype("float32") - im2.data.astype("float32"))
+ logger.debug("type: %s %s shape %s %s " % (im1.data.dtype, im2.data.dtype, im1.data.shape, im2.data.shape))
+ logger.debug("im1 min %s %s max %s %s " % (im1.data.min(), im2.data.min(), im1.data.max(), im2.data.max()))
+ logger.debug("delta min %s max %s mean %s" % (diff.min(), diff.max(), diff.mean()))
+ self.assertEqual(abs(diff).max(), 0.0, "asdc data == edf data")
+
+
+class TestFlatMccdsAdsc(unittest.TestCase):
+ """
+ """
+ def setUp(self):
+ """ Download images """
+ self.im_dir = os.path.dirname(UtilsTest.getimage("mb_LP_1_001.img.bz2"))
+
+ def test_read(self):
+ """ check we can read flat ADSC images"""
+ for line in TESTIMAGES.split("\n"):
+ vals = line.split()
+ name = vals[0]
+ dim1, dim2 = [int(x) for x in vals[1:3]]
+ mini, maxi, mean, stddev = [float(x) for x in vals[3:]]
+ obj = adscimage()
+ obj.read(os.path.join(self.im_dir, name))
+ self.assertAlmostEqual(mini, obj.getmin(), 2, "getmin")
+ self.assertAlmostEqual(maxi, obj.getmax(), 2, "getmax")
+ got_mean = obj.getmean()
+ self.assertAlmostEqual(mean, got_mean, 2, "getmean exp %s != got %s" % (mean, got_mean))
+ self.assertAlmostEqual(stddev, obj.getstddev(), 2, "getstddev")
+ self.assertEqual(dim1, obj.dim1, "dim1")
+ self.assertEqual(dim2, obj.dim2, "dim2")
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestMatch))
+ testsuite.addTest(loadTests(TestFlatMccdsAdsc))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testbruker100image.py b/fabio/test/testbruker100image.py
new file mode 100644
index 0000000..7d2aa62
--- /dev/null
+++ b/fabio/test/testbruker100image.py
@@ -0,0 +1,105 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+#bruker100 Unit tests
+
+19/01/2015
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import os
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+logger = UtilsTest.get_logger(__file__)
+from fabio.bruker100image import Bruker100Image
+from fabio.openimage import openimage
+
+# filename dim1 dim2 min max mean stddev
+TESTIMAGES = """NaCl_10_01_0009.sfrm 512 512 -30 5912 34.4626 26.189
+ NaCl_10_01_0009.sfrm.gz 512 512 -30 5912 34.4626 26.189
+ NaCl_10_01_0009.sfrm.bz2 512 512 -30 5912 34.4626 26.189"""
+REFIMAGE = "NaCl_10_01_0009.npy.bz2"
+
+
+class TestBruker100(unittest.TestCase):
+ """ check some read data from bruker version100 detector"""
+ def setUp(self):
+ """
+ download images
+ """
+ UtilsTest.getimage(REFIMAGE)
+ self.im_dir = os.path.dirname(UtilsTest.getimage(TESTIMAGES.split()[0] + ".bz2"))
+
+ def test_read(self):
+ """ check we can read bruker100 images"""
+ for line in TESTIMAGES.split("\n"):
+ vals = line.split()
+ name = vals[0]
+ dim1, dim2 = [int(x) for x in vals[1:3]]
+ mini, maxi, mean, stddev = [float(x) for x in vals[3:]]
+ obj = Bruker100Image()
+ obj.read(os.path.join(self.im_dir, name))
+ self.assertAlmostEqual(mini, obj.getmin(), 2, "getmin")
+ self.assertAlmostEqual(maxi, obj.getmax(), 2, "getmax")
+ self.assertAlmostEqual(mean, obj.getmean(), 2, "getmean")
+ self.assertAlmostEqual(stddev, obj.getstddev(), 2, "getstddev")
+ self.assertEqual(dim1, obj.dim1, "dim1")
+ self.assertEqual(dim2, obj.dim2, "dim2")
+
+ def test_same(self):
+ """ check we can read bruker100 images"""
+ ref = openimage(os.path.join(self.im_dir, REFIMAGE))
+ for line in TESTIMAGES.split("\n"):
+ obt = openimage(os.path.join(self.im_dir, line.split()[0]))
+ self.assertTrue(abs(ref.data - obt.data).max() == 0, "data are the same")
+
+ def test_write(self):
+ fname = TESTIMAGES.split()[0]
+ obt = openimage(os.path.join(self.im_dir, fname))
+ name = os.path.basename(fname)
+
+ obj = Bruker100Image(data=obt.data, header=obt.header)
+ obj.write(os.path.join(UtilsTest.tempdir, name))
+ other = openimage(os.path.join(UtilsTest.tempdir, name))
+ self.assertEqual(abs(obt.data - other.data).max(), 0, "data are the same")
+ for key in obt.header:
+ self.assertTrue(key in other.header, "Key %s is in header" % key)
+ self.assertEqual(obt.header[key], other.header[key], "value are the same for key %s" % key)
+ os.unlink(os.path.join(UtilsTest.tempdir, name))
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestBruker100))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testbrukerimage.py b/fabio/test/testbrukerimage.py
new file mode 100644
index 0000000..4cd7401
--- /dev/null
+++ b/fabio/test/testbrukerimage.py
@@ -0,0 +1,227 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+#bruker Unit tests
+
+#built on testbrukerimage
+19/01/2015
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import os
+import numpy
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+logger = UtilsTest.get_logger(__file__)
+from ..brukerimage import brukerimage
+from .. import fabioutils
+
+# this is actually a violation of the bruker format since the order of
+# the header items is specified
+# in the standard, whereas the order of a python dictionary is not
+MYHEADER = {"FORMAT": '86',
+ 'NPIXELB': '2',
+ 'VERSION': '9',
+ 'HDRBLKS': '5',
+ 'NOVERFL': '4',
+ 'NCOLS': '256',
+ 'NROWS': '256',
+ 'WORDORD': '0'}
+
+MYIMAGE = numpy.ones((256, 256), numpy.uint16) * 16
+MYIMAGE[0, 0] = 0
+MYIMAGE[1, 1] = 32
+MYIMAGE[127:129, 127:129] = 65535
+if not numpy.little_endian:
+ MYIMAGE.byteswap(True)
+
+
+OVERFLOWS = [
+ ["%09d" % 4194304, ("%07d" % (127 * 256 + 127))],
+ ["%09d" % 4194304, ("%07d" % (127 * 256 + 128))],
+ ["%09d" % 4194304, ("%07d" % (128 * 256 + 127))],
+ ["%09d" % 4194304, ("%07d" % (128 * 256 + 128))]
+ ]
+
+
+class TestBruker(unittest.TestCase):
+ """basic test"""
+
+ def setUp(self):
+ """ Generate a test bruker image """
+ self.filename = os.path.join(UtilsTest.tempdir, "image.0000")
+
+ with open(self.filename, 'wb') as fout:
+ wrb = 0
+ for key, val in MYHEADER.items():
+ fout.write((("%-7s" % key) + ':' + ("%-72s" % val)).encode("ASCII"))
+ wrb = wrb + 80
+ hdrblks = int(MYHEADER['HDRBLKS'])
+ while (wrb < hdrblks * 512):
+ fout.write(b"\x1a\x04")
+ fout.write(b'.' * 78)
+ wrb = wrb + 80
+ fout.write(MYIMAGE.tostring())
+
+ noverfl = int(MYHEADER['NOVERFL'])
+ for ovf in OVERFLOWS:
+ fout.write((ovf[0] + ovf[1]).encode("ASCII"))
+ fout.write(b'.' * (512 - (16 * noverfl) % 512))
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ if os.path.exists(self.filename):
+ os.unlink(self.filename)
+
+ def test_read(self):
+ """ see if we can read the test image """
+ obj = brukerimage()
+ obj.read(self.filename)
+ self.assertAlmostEqual(obj.getmean(), 272.0, 2)
+ self.assertEqual(obj.getmin(), 0)
+ self.assertEqual(obj.getmax(), 4194304)
+
+
+class TestBzipBruker(TestBruker):
+ """ test for a bzipped image """
+ def setUp(self):
+ """ create the image """
+ TestBruker.setUp(self)
+ if os.path.isfile(self.filename + ".bz2"):
+ os.unlink(self.filename + ".bz2")
+ with fabioutils.BZ2File(self.filename + ".bz2", "wb") as wf:
+ with open(self.filename, "rb") as rf:
+ wf.write(rf.read())
+ self.filename = self.filename + ".bz2"
+
+
+class TestGzipBruker(TestBruker):
+ """ test for a gzipped image """
+ def setUp(self):
+ """ Create the image """
+ TestBruker.setUp(self)
+ if os.path.isfile(self.filename + ".gz"):
+ os.unlink(self.filename + ".gz")
+ with fabioutils.GzipFile(self.filename + ".gz", "wb") as wf:
+ with open(self.filename, "rb") as rf:
+ wf.write(rf.read())
+ self.filename = self.filename + ".gz"
+
+
+class TestBrukerLinear(unittest.TestCase):
+ """basic test, test a random array of float32"""
+ def setUp(self):
+ unittest.TestCase.setUp(self)
+ self.filename = os.path.join(UtilsTest.tempdir, "bruker.0000")
+ self.data = numpy.random.random((500, 550)).astype("float32")
+
+ def test_linear(self):
+ """ test for self consistency of random data read/write """
+ obj = brukerimage(data=self.data)
+ obj.write(self.filename)
+ new = brukerimage()
+ new.read(self.filename)
+ error = abs(new.data - self.data).max()
+ self.assertTrue(error < numpy.finfo(numpy.float32).eps, "Error is %s>1e-7" % error)
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ if os.path.exists(self.filename):
+ os.unlink(self.filename)
+
+# statistics come from fit2d I think
+# filename dim1 dim2 min max mean stddev
+TESTIMAGES = """Cr8F8140k103.0026 512 512 0 145942 289.37 432.17
+ Cr8F8140k103.0026.gz 512 512 0 145942 289.37 432.17
+ Cr8F8140k103.0026.bz2 512 512 0 145942 289.37 432.17"""
+
+
+class TestRealImg(unittest.TestCase):
+ """ check some read data from bruker detector"""
+ def setUp(self):
+ """
+ download images
+ """
+ self.im_dir = os.path.dirname(UtilsTest.getimage("Cr8F8140k103.0026.bz2"))
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ self.im_dir = None
+
+ def test_read(self):
+ """ check we can read bruker images"""
+ for line in TESTIMAGES.split("\n"):
+ vals = line.split()
+ name = vals[0]
+ dim1, dim2 = [int(x) for x in vals[1:3]]
+ mini, maxi, mean, stddev = [float(x) for x in vals[3:]]
+ obj = brukerimage()
+ obj.read(os.path.join(self.im_dir, name))
+ self.assertAlmostEqual(mini, obj.getmin(), 2, "getmin")
+ self.assertAlmostEqual(maxi, obj.getmax(), 2, "getmax")
+ self.assertAlmostEqual(mean, obj.getmean(), 2, "getmean")
+ self.assertAlmostEqual(stddev, obj.getstddev(), 2, "getstddev")
+ self.assertEqual(dim1, obj.dim1, "dim1")
+ self.assertEqual(dim2, obj.dim2, "dim2")
+
+ def test_write(self):
+ "Test writing with self consistency at the fabio level"
+ for line in TESTIMAGES.split("\n"):
+ vals = line.split()
+ name = vals[0]
+ obj = brukerimage()
+ ref = brukerimage()
+ fname = os.path.join(self.im_dir, name)
+ obj.read(fname)
+ obj.write(os.path.join(UtilsTest.tempdir, name))
+ other = brukerimage()
+ other.read(os.path.join(UtilsTest.tempdir, name))
+ ref.read(fname)
+ self.assertEqual(abs(obj.data - other.data).max(), 0, "data are the same")
+ for key in ref.header:
+ if key in ("filename",):
+ continue
+ if key not in other.header:
+ logger.warning("Key %s is missing in new header, was %s" % (key, ref.header[key]))
+ else:
+ self.assertEqual(ref.header[key], other.header[key], "value are the same for key %s: was %s now %s" % (key, ref.header[key], other.header[key]))
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestBruker))
+ testsuite.addTest(loadTests(TestBzipBruker))
+ testsuite.addTest(loadTests(TestGzipBruker))
+ testsuite.addTest(loadTests(TestRealImg))
+ testsuite.addTest(loadTests(TestBrukerLinear))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testcbfimage.py b/fabio/test/testcbfimage.py
new file mode 100755
index 0000000..a8d2b8c
--- /dev/null
+++ b/fabio/test/testcbfimage.py
@@ -0,0 +1,176 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+"""
+2011: Jerome Kieffer for ESRF.
+
+Unit tests for CBF images based on references images taken from:
+http://pilatus.web.psi.ch/DATA/DATASETS/insulin_0.2/
+
+19/01/2015
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+import time
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from fabio.cbfimage import cbfimage
+from fabio.compression import decByteOffset_numpy, decByteOffset_cython
+from fabio.third_party.six import PY3
+if PY3:
+ from fabio.fabioutils import unicode
+
+
+class TestCbfReader(unittest.TestCase):
+ """ test cbf image reader """
+
+ def __init__(self, methodName):
+ "Constructor of the class"
+ unittest.TestCase.__init__(self, methodName)
+ self.edf_filename = os.path.join(UtilsTest.image_home, "run2_1_00148.edf")
+ self.cbf_filename = os.path.join(UtilsTest.image_home, "run2_1_00148.cbf")
+
+ def setUp(self):
+ """Download images"""
+
+ UtilsTest.getimage(os.path.basename(self.edf_filename + ".bz2"))
+ UtilsTest.getimage(os.path.basename(self.cbf_filename + ".bz2"))
+
+ def test_read(self):
+ """ check whole reader"""
+ times = []
+ times.append(time.time())
+ cbf = fabio.open(self.cbf_filename)
+ times.append(time.time())
+ edf = fabio.open(self.edf_filename)
+ times.append(time.time())
+
+ self.assertAlmostEqual(0, abs(cbf.data - edf.data).max())
+ logger.info("Reading CBF took %.3fs whereas the same EDF took %.3fs" % (times[1] - times[0], times[2] - times[1]))
+
+ def test_write(self):
+ "Rest writing with self consistency at the fabio level"
+ name = os.path.basename(self.cbf_filename)
+ obj = cbfimage()
+ obj.read(self.cbf_filename)
+ obj.write(os.path.join(UtilsTest.tempdir, name))
+ other = cbfimage()
+ other.read(os.path.join(UtilsTest.tempdir, name))
+ self.assertEqual(abs(obj.data - other.data).max(), 0, "data are the same")
+ for key in obj.header:
+ if key in["filename", "X-Binary-Size-Padding"]:
+ continue
+ self.assertTrue(key in other.header, "Key %s is in header" % key)
+ self.assertEqual(obj.header[key], other.header[key], "value are the same for key %s" % key)
+ # By destroying the object, one actually closes the file, which is needed under windows.
+ del obj
+ del other
+ if os.path.exists(os.path.join(UtilsTest.tempdir, name)):
+ os.unlink(os.path.join(UtilsTest.tempdir, name))
+
+ def test_byte_offset(self):
+ """ check byte offset algorithm"""
+ cbf = fabio.open(self.cbf_filename)
+ starter = b"\x0c\x1a\x04\xd5"
+ cbs = cbf.cbs
+ startPos = cbs.find(starter) + 4
+ data = cbs[startPos: startPos + int(cbf.header["X-Binary-Size"])]
+ startTime = time.time()
+ numpyRes = decByteOffset_numpy(data, size=cbf.dim1 * cbf.dim2)
+ tNumpy = time.time() - startTime
+ logger.info("Timing for Numpy method : %.3fs" % tNumpy)
+
+ startTime = time.time()
+ cythonRes = decByteOffset_cython(stream=data, size=cbf.dim1 * cbf.dim2)
+ tCython = time.time() - startTime
+ delta = abs(numpyRes - cythonRes).max()
+ self.assertAlmostEqual(0, delta)
+ logger.info("Timing for Cython method : %.3fs, max delta= %s" % (tCython, delta))
+
+ def test_consitency_manual(self):
+ """
+ Test if an image can be read and saved and the results are "similar"
+ """
+ name = os.path.basename(self.cbf_filename)
+ obj = fabio.open(self.cbf_filename)
+ new = fabio.cbfimage.cbfimage(data=obj.data, header=obj.header)
+ new.write(os.path.join(UtilsTest.tempdir, name))
+ other = fabio.open(os.path.join(UtilsTest.tempdir, name))
+ self.assertEqual(abs(obj.data - other.data).max(), 0, "data are the same")
+ for key in obj.header:
+ if key in["filename", "X-Binary-Size-Padding"]:
+ continue
+ self.assertTrue(key in other.header, "Key %s is in header" % key)
+ self.assertEqual(obj.header[key], other.header[key], "value are the same for key %s [%s|%s]" % (key, obj.header[key], other.header[key]))
+
+ def test_consitency_convert(self):
+ """
+ Test if an image can be read and saved and the results are "similar"
+ """
+ name = os.path.basename(self.cbf_filename)
+ obj = fabio.open(self.cbf_filename)
+ new = obj.convert("cbf")
+ new.write(os.path.join(UtilsTest.tempdir, name))
+ other = fabio.open(os.path.join(UtilsTest.tempdir, name))
+ self.assertEqual(abs(obj.data - other.data).max(), 0, "data are the same")
+ for key in obj.header:
+ if key in["filename", "X-Binary-Size-Padding"]:
+ continue
+ self.assertTrue(key in other.header, "Key %s is in header" % key)
+ self.assertEqual(obj.header[key], other.header[key], "value are the same for key %s [%s|%s]" % (key, obj.header[key], other.header[key]))
+
+ def test_unicode(self):
+ """
+ Test if an image can be read and saved to an unicode named
+ """
+ name = unicode(os.path.basename(self.cbf_filename))
+ obj = fabio.open(self.cbf_filename)
+ obj.write(os.path.join(UtilsTest.tempdir, name))
+ other = fabio.open(os.path.join(UtilsTest.tempdir, name))
+ self.assertEqual(abs(obj.data - other.data).max(), 0, "data are the same")
+ for key in obj.header:
+ if key in["filename", "X-Binary-Size-Padding"]:
+ continue
+ self.assertTrue(key in other.header, "Key %s is in header" % key)
+ self.assertEqual(obj.header[key], other.header[key], "value are the same for key %s [%s|%s]" % (key, obj.header[key], other.header[key]))
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestCbfReader))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testcompression.py b/fabio/test/testcompression.py
new file mode 100755
index 0000000..6ecaa8b
--- /dev/null
+++ b/fabio/test/testcompression.py
@@ -0,0 +1,135 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+#
+# Get ready for python3:
+from __future__ import with_statement, print_function, division
+
+__authors__ = ["Jérôme Kieffer"]
+__contact__ = "Jerome.Kieffer@esrf.fr"
+__license__ = "MIT"
+__copyright__ = "2011-2016 ESRF"
+__date__ = "27/07/2017"
+
+import unittest
+import sys
+import os
+import numpy
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from fabio import compression
+
+
+class TestByteOffset(unittest.TestCase):
+ """
+ test the byte offset compression and decompression
+ """
+ def setUp(self):
+ self.ds = numpy.array([0, 1, 2, 127, 0, 1, 2, 128, 0, 1, 2, 32767, 0, 1, 2, 32768, 0, 1, 2, 2147483647, 0, 1, 2, 2147483648, 0, 1, 2, 128, 129, 130, 32767, 32768, 128, 129, 130, 32768, 2147483647, 2147483648])
+ self.ref = b'\x00\x01\x01}\x81\x01\x01~\x80\x80\xff\x01\x01\x80\xfd\x7f\x80\x01\x80\x01\x01\x80\xfe\x7f\x80\x00\x80\x00\x80\xff\xff\x01\x01\x80\x00\x80\xfd\xff\xff\x7f\x80\x00\x80\x01\x00\x00\x80\x01\x01\x80\x00\x80\xfe\xff\xff\x7f\x80\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\xff\xff\xff\xff\x01\x01~\x01\x01\x80}\x7f\x01\x80\x80\x80\x01\x01\x80~\x7f\x80\x00\x80\xff\x7f\xff\x7f\x01'
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ self.ds = self.ref = None
+
+ def testComp(self):
+ """
+ """
+ # first with numpy
+ ds = numpy.array([0, 128])
+ ref = b"\x00\x80\x80\00"
+ self.assertEqual(ref, compression.compByteOffset_numpy(ds), "test +128")
+ ds = numpy.array([0, -128])
+ ref = b'\x00\x80\x80\xff'
+ self.assertEqual(ref, compression.compByteOffset_numpy(ds), "test -128")
+ ds = numpy.array([10, -128])
+ ref = b'\n\x80v\xff'
+ self.assertEqual(ref, compression.compByteOffset_numpy(ds), "test +10 -128")
+ self.assertEqual(self.ref, compression.compByteOffset_numpy(self.ds), "test larger")
+
+ # Then with cython 32 bits
+ ds = numpy.array([0, 128], dtype="int32")
+ ref = b"\x00\x80\x80\00"
+ self.assertEqual(ref, compression.compByteOffset_cython(ds), "test +128")
+ ds = numpy.array([0, -128], dtype="int32")
+ ref = b'\x00\x80\x80\xff'
+ self.assertEqual(ref, compression.compByteOffset_cython(ds), "test -128")
+ ds = numpy.array([10, -128], dtype="int32")
+ ref = b'\n\x80v\xff'
+ self.assertEqual(ref, compression.compByteOffset_cython(ds), "test +10 -128")
+ self.assertEqual(self.ref, compression.compByteOffset_cython(self.ds), "test larger")
+
+ # Then with cython 64bits
+ ds = numpy.array([0, 128], dtype="int64")
+ ref = b"\x00\x80\x80\00"
+ self.assertEqual(ref, compression.compByteOffset_cython(ds), "test +128")
+ ds = numpy.array([0, -128], dtype="int64")
+ ref = b'\x00\x80\x80\xff'
+ self.assertEqual(ref, compression.compByteOffset_cython(ds), "test -128")
+ ds = numpy.array([10, -128], dtype="int64")
+ ref = b'\n\x80v\xff'
+ self.assertEqual(ref, compression.compByteOffset_cython(ds), "test +10 -128")
+ self.assertEqual(self.ref, compression.compByteOffset_cython(self.ds), "test larger")
+
+ def testSC(self):
+ """test that datasets are unchanged after various compression/decompressions"""
+
+ obt_np = compression.decByteOffset_numpy(compression.compByteOffset_numpy(self.ds))
+ self.assertEqual(abs(self.ds - obt_np).max(), 0.0, "numpy-numpy algo")
+ obt_cy = compression.decByteOffset_cython(compression.compByteOffset_numpy(self.ds))
+ self.assertEqual(abs(self.ds - obt_cy).max(), 0.0, "cython-numpy algo")
+ obt_cy2 = compression.decByteOffset_cython(compression.compByteOffset_numpy(self.ds), self.ds.size)
+ self.assertEqual(abs(self.ds - obt_cy2).max(), 0.0, "cython2-numpy algo_orig")
+
+ obt_np = compression.decByteOffset_numpy(compression.compByteOffset_cython(self.ds))
+ self.assertEqual(abs(self.ds - obt_np).max(), 0.0, "numpy-numpy algo")
+ obt_cy = compression.decByteOffset_cython(compression.compByteOffset_cython(self.ds))
+ self.assertEqual(abs(self.ds - obt_cy).max(), 0.0, "cython-numpy algo")
+ obt_cy2 = compression.decByteOffset_cython(compression.compByteOffset_cython(self.ds), self.ds.size)
+ self.assertEqual(abs(self.ds - obt_cy2).max(), 0.0, "cython2-numpy algo_orig")
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestByteOffset))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testedfimage.py b/fabio/test/testedfimage.py
new file mode 100755
index 0000000..f0341d5
--- /dev/null
+++ b/fabio/test/testedfimage.py
@@ -0,0 +1,390 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+# Unit tests
+
+# builds on stuff from ImageD11.test.testpeaksearch
+28/11/2014
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+import numpy
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from ..edfimage import edfimage
+from ..third_party import six
+from ..fabioutils import GzipFile, BZ2File
+
+
+class TestFlatEdfs(unittest.TestCase):
+ """ test some flat images """
+ def common_setup(self):
+ self.BYTE_ORDER = "LowByteFirst" if numpy.little_endian else "HighByteFirst"
+ self.MYHEADER = six.b("{\n%-1020s}\n" % (
+ """Omega = 0.0 ;
+ Dim_1 = 256 ;
+ Dim_2 = 256 ;
+ DataType = FloatValue ;
+ ByteOrder = %s ;
+ Image = 1;
+ History-1 = something=something else;
+ \n\n""" % self.BYTE_ORDER))
+ self.MYIMAGE = numpy.ones((256, 256), numpy.float32) * 10
+ self.MYIMAGE[0, 0] = 0
+ self.MYIMAGE[1, 1] = 20
+
+ assert len(self.MYIMAGE[0:1, 0:1].tostring()) == 4, self.MYIMAGE[0:1, 0:1].tostring()
+
+ def setUp(self):
+ """ initialize"""
+ self.common_setup()
+ self.filename = os.path.join(UtilsTest.tempdir, "im0000.edf")
+ if not os.path.isfile(self.filename):
+ outf = open(self.filename, "wb")
+ assert len(self.MYHEADER) % 1024 == 0
+ outf.write(self.MYHEADER)
+ outf.write(self.MYIMAGE.tostring())
+ outf.close()
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ self.BYTE_ORDER = self.MYHEADER = self.MYIMAGE = None
+
+ def test_read(self):
+ """ check readable"""
+ obj = edfimage()
+ obj.read(self.filename)
+ self.assertEqual(obj.dim1, 256, msg="dim1!=256 for file: %s" % self.filename)
+ self.assertEqual(obj.dim2, 256, msg="dim2!=256 for file: %s" % self.filename)
+ self.assertEqual(obj.bpp, 4, msg="bpp!=4 for file: %s" % self.filename)
+ self.assertEqual(obj.bytecode, numpy.float32, msg="bytecode!=flot32 for file: %s" % self.filename)
+ self.assertEqual(obj.data.shape, (256, 256), msg="shape!=(256,256) for file: %s" % self.filename)
+ self.assertEqual(obj.header['History-1'],
+ "something=something else")
+
+ def test_getstats(self):
+ """ test statistics"""
+ obj = edfimage()
+ obj.read(self.filename)
+ self.assertEqual(obj.getmean(), 10)
+ self.assertEqual(obj.getmin(), 0)
+ self.assertEqual(obj.getmax(), 20)
+
+
+class TestBzipEdf(TestFlatEdfs):
+ """ same for bzipped versions """
+ def setUp(self):
+ """set it up"""
+ TestFlatEdfs.setUp(self)
+ if not os.path.isfile(self.filename + ".bz2"):
+ with BZ2File(self.filename + ".bz2", "wb") as f:
+ with open(self.filename, "rb") as d:
+ f.write(d.read())
+ self.filename += ".bz2"
+
+
+class TestGzipEdf(TestFlatEdfs):
+ """ same for gzipped versions """
+ def setUp(self):
+ """ set it up """
+ TestFlatEdfs.setUp(self)
+ if not os.path.isfile(self.filename + ".gz"):
+ with GzipFile(self.filename + ".gz", "wb") as f:
+ with open(self.filename, "rb") as d:
+ f.write(d.read())
+ self.filename += ".gz"
+
+
+# statistics come from fit2d I think
+# filename dim1 dim2 min max mean stddev
+TESTIMAGES = """F2K_Seb_Lyso0675.edf 2048 2048 982 17467 1504.29 217.61
+ F2K_Seb_Lyso0675.edf.bz2 2048 2048 982 17467 1504.29 217.61
+ F2K_Seb_Lyso0675.edf.gz 2048 2048 982 17467 1504.29 217.61
+ id13_badPadding.edf 512 512 85 61947 275.62 583.44 """
+
+
+class TestEdfs(unittest.TestCase):
+ """
+ Read some test images
+ """
+ def setUp(self):
+ self.im_dir = os.path.dirname(UtilsTest.getimage("F2K_Seb_Lyso0675.edf.bz2"))
+ UtilsTest.getimage("id13_badPadding.edf.bz2")
+
+ def test_read(self):
+ """ check we can read these images"""
+ for line in TESTIMAGES.split("\n"):
+ vals = line.split()
+ name = vals[0]
+ dim1, dim2 = [int(x) for x in vals[1:3]]
+ mini, maxi, mean, stddev = [float(x) for x in vals[3:]]
+ obj = edfimage()
+ try:
+ obj.read(os.path.join(self.im_dir, name))
+ except:
+ print("Cannot read image", name)
+ raise
+ self.assertAlmostEqual(mini, obj.getmin(), 2, "testedfs: %s getmin()" % name)
+ self.assertAlmostEqual(maxi, obj.getmax(), 2, "testedfs: %s getmax" % name)
+ logger.info("%s Mean: exp=%s, obt=%s" % (name, mean, obj.getmean()))
+ self.assertAlmostEqual(mean, obj.getmean(), 2, "testedfs: %s getmean" % name)
+ logger.info("%s StdDev: exp=%s, obt=%s" % (name, stddev, obj.getstddev()))
+ self.assertAlmostEqual(stddev, obj.getstddev(), 2, "testedfs: %s getstddev" % name)
+ self.assertEqual(dim1, obj.dim1, "testedfs: %s dim1" % name)
+ self.assertEqual(dim2, obj.dim2, "testedfs: %s dim2" % name)
+ obj = None
+
+ def test_rebin(self):
+ """test the rebin of edfdata"""
+ f = edfimage()
+ f.read(os.path.join(self.im_dir, "F2K_Seb_Lyso0675.edf"))
+ f.rebin(1024, 1024)
+ self.assertEqual(abs(numpy.array([[1547, 1439], [1536, 1494]]) - f.data).max(), 0, "data are the same after rebin")
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ self.im_dir = None
+
+
+class TestEdfCompressedData(unittest.TestCase):
+ """
+ Read some test images with their data-block compressed.
+ Z-Compression and Gzip compression are implemented Bzip2 and byte offet are experimental
+ """
+ def setUp(self):
+ self.im_dir = os.path.dirname(UtilsTest.getimage("edfGzip_U16.edf.bz2"))
+ UtilsTest.getimage("edfCompressed_U16.edf.bz2")
+ UtilsTest.getimage("edfUncompressed_U16.edf.bz2")
+
+ def test_read(self):
+ """ check we can read these images"""
+ ref = edfimage()
+ gzipped = edfimage()
+ compressed = edfimage()
+ refFile = "edfUncompressed_U16.edf"
+ gzippedFile = "edfGzip_U16.edf"
+ compressedFile = "edfCompressed_U16.edf"
+ try:
+ ref.read(os.path.join(self.im_dir, refFile))
+ except:
+ raise RuntimeError("Cannot read image Uncompressed image %s" % refFile)
+ try:
+ gzipped.read(os.path.join(self.im_dir, gzippedFile))
+ except:
+ raise RuntimeError("Cannot read image gzippedFile image %s" % gzippedFile)
+ try:
+ compressed.read(os.path.join(self.im_dir, compressedFile))
+ except:
+ raise RuntimeError("Cannot read image compressedFile image %s" % compressedFile)
+ self.assertEqual((ref.data - gzipped.data).max(), 0, "Gzipped data block is correct")
+ self.assertEqual((ref.data - compressed.data).max(), 0, "Zlib compressed data block is correct")
+
+
+class TestEdfMultiFrame(unittest.TestCase):
+ """
+ Read some test images with their data-block compressed.
+ Z-Compression and Gzip compression are implemented Bzip2 and byte offet are experimental
+ """
+ def setUp(self):
+ self.multiFrameFilename = UtilsTest.getimage("MultiFrame.edf.bz2")[:-4]
+ self.Frame0Filename = UtilsTest.getimage("MultiFrame-Frame0.edf.bz2")[:-4]
+ self.Frame1Filename = UtilsTest.getimage("MultiFrame-Frame1.edf.bz2")[:-4]
+ self.ref = edfimage()
+ self.frame0 = edfimage()
+ self.frame1 = edfimage()
+ try:
+ self.ref.read(self.multiFrameFilename)
+ except:
+ raise RuntimeError("Cannot read image multiFrameFilename image %s" % self.multiFrameFilename)
+ try:
+ self.frame0.read(self.Frame0Filename)
+ except:
+ raise RuntimeError("Cannot read image Frame0File image %s" % self.Frame0File)
+ try:
+ self.frame1.read(self.Frame1Filename)
+ except:
+ raise RuntimeError("Cannot read image Frame1File image %s" % self.Frame1File)
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ self.multiFrameFilename = self.Frame0Filename = self.Frame1Filename = self.ref = self.frame0 = self.frame1 = None
+
+ def test_getFrame_multi(self):
+ """testedfmultiframe.test_getFrame_multi"""
+ self.assertEqual((self.ref.data - self.frame0.data).max(), 0, "getFrame_multi: Same data for frame 0")
+ f1_multi = self.ref.getframe(1)
+# logger.warning("f1_multi.header=%s\nf1_multi.data= %s" % (f1_multi.header, f1_multi.data))
+ self.assertEqual((f1_multi.data - self.frame1.data).max(), 0, "getFrame_multi: Same data for frame 1")
+
+ def test_getFrame_mono(self):
+ "testedfmultiframe.test_getFrame_mono"
+ self.assertEqual((self.ref.data - self.frame0.data).max(), 0, "getFrame_mono: Same data for frame 0")
+ f1_mono = self.frame0.getframe(1)
+ self.assertEqual((f1_mono.data - self.frame1.data).max(), 0, "getFrame_mono: Same data for frame 1")
+
+ def test_next_multi(self):
+ """testedfmultiframe.test_getFrame_mono"""
+ self.assertEqual((self.ref.data - self.frame0.data).max(), 0, "next_multi: Same data for frame 0")
+ next_ = self.ref.next()
+ self.assertEqual((next_.data - self.frame1.data).max(), 0, "next_multi: Same data for frame 1")
+
+ def text_next_mono(self):
+ "testedfmultiframe.text_next_mono"
+ self.assertEqual((self.ref.data - self.frame0.data).max(), 0, "next_mono: Same data for frame 0")
+ next_ = self.frame0.next()
+ self.assertEqual((next_.data - self.frame1.data).max(), 0, "next_mono: Same data for frame 1")
+
+ def test_previous_multi(self):
+ """testedfmultiframe.test_previous_multi"""
+ f1 = self.ref.getframe(1)
+ self.assertEqual((f1.data - self.frame1.data).max(), 0, "previous_multi: Same data for frame 1")
+ f0 = f1.previous()
+ self.assertEqual((f0.data - self.frame1.data).max(), 0, "previous_multi: Same data for frame 0")
+
+ def test_previous_mono(self):
+ "testedfmultiframe.test_previous_mono"
+ f1 = self.ref.getframe(1)
+ self.assertEqual((f1.data - self.frame1.data).max(), 0, "previous_mono: Same data for frame 1")
+ prev = self.frame1.previous()
+ self.assertEqual((prev.data - self.frame0.data).max(), 0, "previous_mono: Same data for frame 0")
+
+ def test_openimage_multiframes(self):
+ "test if openimage can directly read first or second frame of a multi-frame"
+ self.assertEqual((fabio.open(self.multiFrameFilename).data - self.frame0.data).max(), 0, "openimage_multiframes: Same data for default ")
+# print(fabio.open(self.multiFrameFilename, 0).data)
+ self.assertEqual((fabio.open(self.multiFrameFilename, 0).data - self.frame0.data).max(), 0, "openimage_multiframes: Same data for frame 0")
+ self.assertEqual((fabio.open(self.multiFrameFilename, 1).data - self.frame1.data).max(), 0, "openimage_multiframes: Same data for frame 1")
+
+
+class TestEdfFastRead(unittest.TestCase):
+ """
+ Read some test images with their data-block compressed.
+ Z-Compression and Gzip compression are implemented Bzip2 and byte offet are experimental
+ """
+ def setUp(self):
+ self.refFilename = UtilsTest.getimage("MultiFrame-Frame0.edf.bz2")
+ self.fastFilename = self.refFilename[:-4]
+
+ def test_fastread(self):
+ ref = fabio.open(self.refFilename)
+ refdata = ref.data
+ obt = ref.fastReadData(self.fastFilename)
+ self.assertEqual(abs(obt - refdata).max(), 0, "testedffastread: Same data")
+
+
+class TestEdfWrite(unittest.TestCase):
+ """
+ Write dummy edf files with various compression schemes
+ """
+ tmpdir = UtilsTest.tempdir
+
+ def setUp(self):
+ self.data = numpy.arange(100).reshape((10, 10))
+ self.header = {"toto": "tutu"}
+
+ def testFlat(self):
+ self.filename = os.path.join(self.tmpdir, "merged.azim")
+ e = edfimage(data=self.data, header=self.header)
+ e.write(self.filename)
+ r = fabio.open(self.filename)
+ self.assertTrue(r.header["toto"] == self.header["toto"], "header are OK")
+ self.assertTrue(abs(r.data - self.data).max() == 0, "data are OK")
+ self.assertEqual(int(r.header["EDF_HeaderSize"]), 512, "header size is one 512 block")
+
+ def testGzip(self):
+ self.filename = os.path.join(self.tmpdir, "merged.azim.gz")
+ e = edfimage(data=self.data, header=self.header)
+ e.write(self.filename)
+ r = fabio.open(self.filename)
+ self.assertTrue(r.header["toto"] == self.header["toto"], "header are OK")
+ self.assertTrue(abs(r.data - self.data).max() == 0, "data are OK")
+ self.assertEqual(int(r.header["EDF_HeaderSize"]), 512, "header size is one 512 block")
+
+ def testBzip2(self):
+ self.filename = os.path.join(self.tmpdir, "merged.azim.gz")
+ e = edfimage(data=self.data, header=self.header)
+ e.write(self.filename)
+ r = fabio.open(self.filename)
+ self.assertTrue(r.header["toto"] == self.header["toto"], "header are OK")
+ self.assertTrue(abs(r.data - self.data).max() == 0, "data are OK")
+ self.assertEqual(int(r.header["EDF_HeaderSize"]), 512, "header size is one 512 block")
+
+ def tearDown(self):
+ os.unlink(self.filename)
+
+
+class TestEdfRegression(unittest.TestCase):
+ """
+ Test suite to prevent regression
+ """
+ def bug_27(self):
+ """
+ import fabio
+ obj = fabio.open("any.edf")
+ obj.header["missing"]="blah"
+ obj.write("any.edf")
+ """
+ # create dummy image:
+ shape = (32, 32)
+ data = numpy.random.randint(0, 6500, size=shape[0] * shape[1]).astype("uint16").reshape(shape)
+ fname = os.path.join(UtilsTest.tempdir, "bug27.edf")
+ e = edfimage(data=data, header={"key1": "value1"})
+ e.write(fname)
+ del e
+
+ obj = fabio.open(fname)
+ obj.header["missing"] = "blah"
+ obj.write(fname)
+
+ del obj
+# os.unlink(fname)
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestFlatEdfs))
+ testsuite.addTest(loadTests(TestBzipEdf))
+ testsuite.addTest(loadTests(TestGzipEdf))
+ testsuite.addTest(loadTests(TestEdfs))
+ testsuite.addTest(loadTests(TestEdfCompressedData))
+ testsuite.addTest(loadTests(TestEdfMultiFrame))
+ testsuite.addTest(loadTests(TestEdfFastRead))
+ testsuite.addTest(loadTests(TestEdfWrite))
+ testsuite.addTest(loadTests(TestEdfRegression))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testeigerimage.py b/fabio/test/testeigerimage.py
new file mode 100644
index 0000000..e09d817
--- /dev/null
+++ b/fabio/test/testeigerimage.py
@@ -0,0 +1,87 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+
+"""Test Eiger images
+"""
+
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+
+from fabio.openimage import openimage
+from fabio.eigerimage import EigerImage, h5py
+
+
+def make_hdf5(name, shape=(50, 99, 101)):
+ if h5py is None:
+ raise unittest.SkipTest("h5py is not available")
+
+ with h5py.File(name) as h:
+ e = h.require_group("entry/data")
+ if len(shape) == 2:
+ e.require_dataset("data", shape, compression="gzip", compression_opts=9, dtype="float32")
+ elif len(shape) == 3:
+ e.require_dataset("data", shape, chunks=(1,) + shape[1:], compression="gzip", compression_opts=9, dtype="float32")
+
+
+class TestEiger(unittest.TestCase):
+ """basic test"""
+
+ @classmethod
+ def setUpClass(cls):
+ super(TestEiger, cls).setUpClass()
+ cls.fn3 = os.path.join(UtilsTest.tempdir, "eiger3d.h5")
+ make_hdf5(cls.fn3, (50, 99, 101))
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestEiger, cls).tearDownClass()
+ if os.path.exists(cls.fn3):
+ os.unlink(cls.fn3)
+
+ def test_read(self):
+ """ check we can read images from Eiger"""
+ e = EigerImage()
+ e.read(self.fn3)
+ self.assertEqual(e.dim1, 101, "dim1 OK")
+ self.assertEqual(e.dim2, 99, "dim2 OK")
+ self.assertEqual(e.nframes, 50, "nframe: got %s!=50" % e.nframes)
+ self.assertEqual(e.bpp, 4, "bpp OK")
+
+ def test_open(self):
+ """ check we can read images from Eiger"""
+ e = openimage(self.fn3)
+ self.assertEqual(e.dim1, 101, "dim1 OK")
+ self.assertEqual(e.dim2, 99, "dim2 OK")
+ self.assertEqual(e.nframes, 50, "nframe: got %s!=50" % e.nframes)
+ self.assertEqual(e.bpp, 4, "bpp OK")
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestEiger))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testfabioconvert.py b/fabio/test/testfabioconvert.py
new file mode 100644
index 0000000..b537861
--- /dev/null
+++ b/fabio/test/testfabioconvert.py
@@ -0,0 +1,196 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Valentin Valls (valentin.valls@esrf.fr)
+#
+"""
+Test for fabio-convert
+"""
+
+import fabio
+import numpy
+import os.path
+import tempfile
+import shutil
+import sys
+import subprocess
+import time
+import unittest
+import os
+import fabio.app.convert
+
+
+class TestFabioConvert(unittest.TestCase):
+
+ def create_test_env(self):
+ path = tempfile.mkdtemp()
+ os.mkdir(os.path.join(path, "input"))
+ os.mkdir(os.path.join(path, "output"))
+
+ data = numpy.random.rand(100, 100)
+ image = fabio.edfimage.edfimage(data=data)
+ image.write(os.path.join(path, "input", "01.edf"))
+
+ data = numpy.random.rand(100, 100)
+ image = fabio.edfimage.edfimage(data=data)
+ image.write(os.path.join(path, "input", "02.edf"))
+
+ data = numpy.random.rand(100, 100)
+ image = fabio.edfimage.edfimage(data=data)
+ image.write(os.path.join(path, "input", "03.edf"))
+
+ data = numpy.random.rand(100, 100)
+ image = fabio.edfimage.edfimage(data=data)
+ # it is not the right file format, but it makes no difference
+ image.write(os.path.join(path, "output", "01.msk"))
+
+ data = numpy.random.rand(100, 100)
+ image = fabio.edfimage.edfimage(data=data)
+ # it is not the right file format, but it makes no difference
+ image.write(os.path.join(path, "output", "02.msk"))
+
+ t = time.time()
+ older = (t - 5000, t - 5000)
+ default = (t - 4000, t - 4000)
+ newer = (t - 3000, t - 3000)
+
+ os.utime(os.path.join(path, "input", "01.edf"), default)
+ os.utime(os.path.join(path, "input", "02.edf"), default)
+ os.utime(os.path.join(path, "input", "03.edf"), default)
+ os.utime(os.path.join(path, "output", "01.msk"), older)
+ os.utime(os.path.join(path, "output", "02.msk"), newer)
+
+ return path
+
+ def clean_test_env(self, path):
+ shutil.rmtree(path)
+
+ def setUp(self):
+ self.__oldPath = os.getcwd()
+ self.__testPath = self.create_test_env()
+ os.chdir(self.__testPath)
+ env = dict((str(k), str(v)) for k, v in os.environ.items())
+ env["PYTHONPATH"] = os.pathsep.join(sys.path)
+ self.__env = env
+ self.__script = fabio.app.convert.__file__
+
+ def tearDown(self):
+ os.chdir(self.__oldPath)
+ self.clean_test_env(self.__testPath)
+ self.exe, self.env = None, None
+
+ def subprocessFabioConvert(self, *args):
+ commandLine = [sys.executable, self.__script]
+ commandLine.extend(args)
+ return subprocess.Popen(commandLine, env=self.__env, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+
+ def testSingleFile(self):
+ p = self.subprocessFabioConvert("input/03.edf", "-o=output/03.msk")
+ p.communicate()
+ assert(os.path.exists("output/03.msk"))
+ image = fabio.open("output/03.msk")
+ assert(isinstance(image, fabio.fit2dmaskimage.Fit2dMaskImage))
+
+ def testSingleFileToDir(self):
+ p = self.subprocessFabioConvert("input/03.edf", "-F=msk", "-o=output")
+ p.communicate()
+ assert(os.path.exists("output/03.msk"))
+
+ def testSingleFileWithWildcardToDir(self):
+ p = self.subprocessFabioConvert("input/03.*", "-F=msk", "-o=output")
+ p.communicate()
+ assert(os.path.exists("output/03.msk"))
+
+ def testFullFormatName(self):
+ p = self.subprocessFabioConvert("input/03.*", "-F=numpyimage", "-o=output")
+ p.communicate()
+ assert(os.path.exists("output/03.npy"))
+ image = fabio.open("output/03.npy")
+ assert(isinstance(image, fabio.numpyimage.NumpyImage))
+
+ def testForceOption(self):
+ date1 = os.path.getmtime("output/01.msk")
+ date2 = os.path.getmtime("output/02.msk")
+ p = self.subprocessFabioConvert("input/*.edf", "-f", "-F=msk", "-o=output")
+ p.communicate()
+ assert(os.path.exists("output/01.msk"))
+ assert(date1 < os.path.getmtime("output/01.msk"))
+ assert(os.path.exists("output/02.msk"))
+ assert(date2 < os.path.getmtime("output/02.msk"))
+ assert(os.path.exists("output/03.msk"))
+
+ def testRemoveDestinationOption(self):
+ date1 = os.path.getmtime("output/01.msk")
+ date2 = os.path.getmtime("output/02.msk")
+ p = self.subprocessFabioConvert("input/*.edf", "--remove-destination", "-F=msk", "-o=output")
+ p.communicate()
+ assert(os.path.exists("output/01.msk"))
+ assert(date1 < os.path.getmtime("output/01.msk"))
+ assert(os.path.exists("output/02.msk"))
+ assert(date2 < os.path.getmtime("output/02.msk"))
+ assert(os.path.exists("output/03.msk"))
+
+ def testNoClobberOption(self):
+ date1 = os.path.getmtime("output/01.msk")
+ date2 = os.path.getmtime("output/02.msk")
+ p = self.subprocessFabioConvert("input/*.edf", "-n", "-F=msk", "-o=output")
+ p.communicate()
+ assert(os.path.exists("output/01.msk"))
+ assert(date1 == os.path.getmtime("output/01.msk"))
+ assert(os.path.exists("output/02.msk"))
+ assert(date2 == os.path.getmtime("output/02.msk"))
+ assert(os.path.exists("output/03.msk"))
+
+ def testUpdateOption(self):
+ date1 = os.path.getmtime("output/01.msk")
+ date2 = os.path.getmtime("output/02.msk")
+ p = self.subprocessFabioConvert("input/*.edf", "--update", "-F=msk", "-o=output")
+ p.communicate()
+ assert(os.path.exists("output/01.msk"))
+ assert(date1 < os.path.getmtime("output/01.msk"))
+ assert(os.path.exists("output/02.msk"))
+ assert(date2 == os.path.getmtime("output/02.msk"))
+ assert(os.path.exists("output/03.msk"))
+
+ def testDefaultOption(self):
+ date1 = os.path.getmtime("output/01.msk")
+ date2 = os.path.getmtime("output/02.msk")
+ p = self.subprocessFabioConvert("input/*.edf", "-F=msk", "-o=output")
+ p.stdin.write(b'yes\n')
+ p.stdin.write(b'no\n')
+ p.communicate()
+ assert(os.path.exists("output/01.msk"))
+ assert(date1 < os.path.getmtime("output/01.msk"))
+ assert(os.path.exists("output/02.msk"))
+ assert(date2 == os.path.getmtime("output/02.msk"))
+ assert(os.path.exists("output/03.msk"))
+
+ def testInteractiveOption(self):
+ date1 = os.path.getmtime("output/01.msk")
+ date2 = os.path.getmtime("output/02.msk")
+ p = self.subprocessFabioConvert("input/*.edf", "-n", "-i", "-F=msk", "-o=output")
+ p.stdin.write(b'yes\n')
+ p.stdin.write(b'no\n')
+ p.communicate()
+ assert(os.path.exists("output/01.msk"))
+ assert(date1 < os.path.getmtime("output/01.msk"))
+ assert(os.path.exists("output/02.msk"))
+ assert(date2 == os.path.getmtime("output/02.msk"))
+ assert(os.path.exists("output/03.msk"))
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestFabioConvert))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testfabioimage.py b/fabio/test/testfabioimage.py
new file mode 100644
index 0000000..e335c9c
--- /dev/null
+++ b/fabio/test/testfabioimage.py
@@ -0,0 +1,233 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+Test cases for the fabioimage class
+
+testsuite by Jerome Kieffer (Jerome.Kieffer@esrf.eu)
+28/11/2014
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+import numpy
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from ..fabioimage import fabioimage
+from .. import fabioutils
+from ..utils import pilutils
+
+
+class Test50000(unittest.TestCase):
+ """ test with 50000 everywhere"""
+ def setUp(self):
+ """make the image"""
+ dat = numpy.ones((1024, 1024), numpy.uint16)
+ dat = (dat * 50000).astype(numpy.uint16)
+ assert dat.dtype.char == numpy.ones((1), numpy.uint16).dtype.char
+ hed = {"Title": "50000 everywhere"}
+ self.obj = fabioimage(dat, hed)
+
+ def testgetmax(self):
+ """check max"""
+ self.assertEqual(self.obj.getmax(), 50000)
+
+ def testgetmin(self):
+ """check min"""
+ self.assertEqual(self.obj.getmin(), 50000)
+
+ def testgetmean(self):
+ """check mean"""
+ self.assertEqual(self.obj.getmean(), 50000)
+
+ def getstddev(self):
+ """check stddev"""
+ self.assertEqual(self.obj.getstddev(), 0)
+
+
+class TestSlices(unittest.TestCase):
+ """check slicing"""
+ def setUp(self):
+ """make test data"""
+ dat2 = numpy.zeros((1024, 1024), numpy.uint16)
+ hed = {"Title": "zeros and 100"}
+ self.cord = [256, 256, 790, 768]
+ self.obj = fabioimage(dat2, hed)
+ self.slic = slic = self.obj.make_slice(self.cord)
+ # Note - d2 is modified *after* fabioimage is made
+ dat2[slic] = dat2[slic] + 100
+ assert self.obj.maxval is None
+ assert self.obj.minval is None
+ self.npix = (slic[0].stop - slic[0].start) * \
+ (slic[1].stop - slic[1].start)
+
+ def testgetmax(self):
+ """check max"""
+ self.assertEqual(self.obj.getmax(), 100)
+
+ def testgetmin(self):
+ """check min"""
+ self.assertEqual(self.obj.getmin(), 0)
+
+ def testintegratearea(self):
+ """ check integrations"""
+ self.obj.resetvals()
+ area1 = self.obj.integrate_area(self.cord)
+ self.obj.resetvals()
+ area2 = self.obj.integrate_area(self.slic)
+ self.assertEqual(area1, area2)
+ self.assertEqual(area1, self.npix * 100)
+
+ def testRebin(self):
+ """Test the rebin method"""
+ big = numpy.arange(64).reshape((8, 8))
+ res = numpy.array([[13, 17], [45, 49]])
+ fabimg = fabioimage(data=big, header={})
+ fabimg.rebin(4, 4)
+ self.assertEqual(abs(res - fabimg.data).max(), 0, "data are the same after rebin")
+
+
+class TestOpen(unittest.TestCase):
+ """check opening compressed files"""
+ testfile = os.path.join(UtilsTest.tempdir, "testfile")
+
+ def setUp(self):
+ """ create test files"""
+ if not os.path.isfile(self.testfile):
+ with open(self.testfile, "wb") as f:
+ f.write(b"{ hello }")
+ if not os.path.isfile(self.testfile + ".gz"):
+ with fabioutils.GzipFile(self.testfile + ".gz", "wb") as wf:
+ wf.write(b"{ hello }")
+ if not os.path.isfile(self.testfile + ".bz2"):
+ with fabioutils.BZ2File(self.testfile + ".bz2", "wb") as wf:
+ wf.write(b"{ hello }")
+ self.obj = fabioimage()
+
+ def testFlat(self):
+ """ no compression"""
+ res = self.obj._open(self.testfile).read()
+ self.assertEqual(res, b"{ hello }")
+
+ def testgz(self):
+ """ gzipped """
+ res = self.obj._open(self.testfile + ".gz").read()
+ self.assertEqual(res, b"{ hello }")
+
+ def testbz2(self):
+ """ bzipped"""
+ res = self.obj._open(self.testfile + ".bz2").read()
+ self.assertEqual(res, b"{ hello }")
+
+
+NAMES = {numpy.uint8: "numpy.uint8",
+ numpy.int8: "numpy.int8",
+ numpy.uint16: "numpy.uint16",
+ numpy.int16: "numpy.int16",
+ numpy.uint32: "numpy.uint32",
+ numpy.int32: "numpy.int32",
+ numpy.float32: "numpy.float32",
+ numpy.float64: "numpy.float64"}
+
+
+class TestPilImage(unittest.TestCase):
+ """ check PIL creation"""
+ def setUp(self):
+ if pilutils.Image is None:
+ self.skipTest("PIL is not available")
+
+ """ list of working numeric types"""
+ self.okformats = [numpy.uint8,
+ numpy.int8,
+ numpy.uint16,
+ numpy.int16,
+ numpy.uint32,
+ numpy.int32,
+ numpy.float32]
+
+ def mkdata(self, shape, typ):
+ """ generate [01] testdata """
+ return (numpy.random.random(shape)).astype(typ)
+
+ def testpil(self):
+
+ for typ in self.okformats:
+ name = NAMES[typ]
+ for shape in [(10, 20), (431, 1325)]:
+ testdata = self.mkdata(shape, typ)
+ img = fabioimage(testdata, {"title": "Random data"})
+ pim = img.toPIL16()
+ for i in [0, 5, 6, shape[1] - 1]:
+ for j in [0, 5, 7, shape[0] - 1]:
+ errstr = name + " %d %d %f %f t=%s" % (
+ i, j, testdata[j, i], pim.getpixel((i, j)), typ)
+
+ er1 = img.data[j, i] - pim.getpixel((i, j))
+ er2 = img.data[j, i] + pim.getpixel((i, j))
+
+ # difference as % error in case of rounding
+ if er2 != 0.:
+ err = er1 / er2
+ else:
+ err = er1
+
+ self.assertAlmostEqual(err, 0, 6, errstr)
+
+
+class TestPilImage2(TestPilImage):
+ """ check with different numbers"""
+ def mkdata(self, shape, typ):
+ """ positive and big"""
+ return (numpy.random.random(shape) * sys.maxsize / 10).astype(typ)
+
+
+class TestPilImage3(TestPilImage):
+ """ check with different numbers"""
+ def mkdata(self, shape, typ):
+ """ positive, negative and big"""
+ return ((numpy.random.random(shape) - 0.5) * sys.maxsize / 10).astype(typ)
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(Test50000))
+ testsuite.addTest(loadTests(TestSlices))
+ testsuite.addTest(loadTests(TestOpen))
+ testsuite.addTest(loadTests(TestPilImage))
+ testsuite.addTest(loadTests(TestPilImage2))
+ testsuite.addTest(loadTests(TestPilImage3))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testfilenames.py b/fabio/test/testfilenames.py
new file mode 100644
index 0000000..012d45a
--- /dev/null
+++ b/fabio/test/testfilenames.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+"""
+Test cases for filename deconstruction
+
+
+testsuite by Jerome Kieffer (Jerome.Kieffer@esrf.eu)
+28/11/2014
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+
+CASES = [
+ (1, 'edf', "data0001.edf"),
+ (10001, 'edf', "data10001.edf"),
+ (10001, 'edf', "data10001.edf.gz"),
+ (10001, 'edf', "data10001.edf.bz2"),
+ (2, 'marccd', "data0002.mccd"),
+ (12345, 'marccd', "data12345.mccd"),
+ (10001, 'marccd', "data10001.mccd.gz"),
+ (10001, 'marccd', "data10001.mccd.bz2"),
+ (123, 'marccd', "data123.mccd.gz"),
+ (3, 'tif_or_pilatus', "data0003.tif"),
+ (4, 'tif_or_pilatus', "data0004.tiff"),
+ (12, 'bruker', "sucrose101.012.gz"),
+ (99, 'bruker', "sucrose101.099"),
+ (99, 'bruker', "sucrose101.0099"),
+ (99, 'bruker', "sucrose101.0099.bz2"),
+ (99, 'bruker', "sucrose101.0099.gz"),
+ (2, 'fit2dmask', "fit2d.msk"),
+ (None, 'fit2dmask', "mymask.msk"),
+ (670005, 'edf', 'S82P670005.edf'),
+ (670005, 'edf', 'S82P670005.edf.gz'),
+ # based on only the name it can be either img or oxd
+ (1, 'adsc_or_oxd_or_hipic_or_raxis', 'mb_LP_1_001.img'),
+ (2, 'adsc_or_oxd_or_hipic_or_raxis', 'mb_LP_1_002.img.gz'),
+ (3, 'adsc_or_oxd_or_hipic_or_raxis', 'mb_LP_1_003.img.bz2'),
+ (3, 'adsc_or_oxd_or_hipic_or_raxis', os.path.join("data", 'mb_LP_1_003.img.bz2')),
+ ]
+
+
+MORE_CASES = [
+ ("data0010.edf", "data0012.edf", 10),
+ ("data1000.pnm", "data999.pnm", 1000),
+ ("data0999.pnm", "data1000.pnm", 999),
+ ("data123457.edf", "data123456.edf", 123457),
+ ("d0ata000100.mccd", "d0ata000012.mccd", 100),
+ (os.path.join("images/sampledir", "P33S670003.edf"),
+ os.path.join("images/sampledir", "P33S670002.edf"), 670003),
+ (os.path.join("images/P33S67", "P33S670003.edf"),
+ os.path.join("images/P33S67", "P33S670002.edf"), 670003),
+ ("image2301.mar2300", "image2300.mar2300", 2301),
+ ("image2300.mar2300", "image2301.mar2300", 2300),
+ ("image.0123", "image.1234", 123),
+ ("mymask.msk", "mymask.msk", None),
+ ("data_123.mccd.bz2", "data_001.mccd.bz2", 123)
+ ]
+
+
+class TestFilenames(unittest.TestCase):
+ """ check the name -> number, type conversions """
+
+ def test_many_cases(self):
+ """ loop over CASES """
+ for num, typ, name in CASES:
+ obj = fabio.FilenameObject(filename=name)
+ self.assertEqual(num, obj.num, name + " num=" + str(num) +
+ " != obj.num=" + str(obj.num))
+ self.assertEqual(typ, "_or_".join(obj.format),
+ name + " " + "_or_".join(obj.format))
+ self.assertEqual(name, obj.tostring(), name + " " + obj.tostring())
+
+ def test_more_cases(self):
+ for nname, oname, num in MORE_CASES:
+ name = fabio.construct_filename(oname, num)
+ self.assertEqual(name, nname)
+
+ def test_more_cases_jump(self):
+ for nname, oname, num in MORE_CASES:
+ name = fabio.jump_filename(oname, num)
+ self.assertEqual(name, nname)
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestFilenames))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testfit2dimage.py b/fabio/test/testfit2dimage.py
new file mode 100644
index 0000000..b3fd8a5
--- /dev/null
+++ b/fabio/test/testfit2dimage.py
@@ -0,0 +1,103 @@
+# coding: utf-8
+#
+# Project: FabIO X-ray image reader
+#
+# Copyright (C) 2010-2016 European Synchrotron Radiation Facility
+# Grenoble, France
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+"""Test for FabIO reader for Fit2D binary images
+"""
+# Get ready for python3:
+from __future__ import with_statement, print_function, division, absolute_import
+
+__authors__ = ["Jérôme Kieffer"]
+__contact__ = "jerome.kiefer@esrf.fr"
+__license__ = "MIT"
+__copyright__ = "2016-2016 European Synchrotron Radiation Facility"
+__date__ = "27/07/2017"
+
+import unittest
+import sys
+import os
+import numpy
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from fabio.fit2dimage import fit2dimage
+
+
+class TestFit2DImage(unittest.TestCase):
+ """ A few random clicks to make a test mask """
+
+ def setUp(self):
+ """
+ download images
+ """
+ self.filename = UtilsTest.getimage("fit2d.f2d.bz2")[:-4]
+ self.tiffilename = UtilsTest.getimage("fit2d.tif.bz2")[:-4]
+
+ def test_read(self):
+ """ Check it reads a mask OK """
+ i = fit2dimage()
+ i.read(self.filename)
+ self.assertEqual(i.dim1, 25)
+ self.assertEqual(i.dim2, 28)
+ self.assertEqual(i.bpp, 4)
+ self.assertEqual(i.bytecode, numpy.float32)
+ self.assertEqual(i.data.shape, (28, 25))
+
+ def test_match(self):
+ """ test edf and msk are the same """
+ i = fabio.open(self.filename)
+ j = fabio.open(self.tiffilename)
+ i.read(self.filename)
+ self.assertEqual(i.data.shape, j.data.shape)
+ diff = j.data - numpy.flipud(i.data)
+ sumd = abs(diff).sum(dtype=float)
+ self.assertEqual(sumd, 0)
+
+ def test_mask(self):
+ img = fabio.open(UtilsTest.getimage("Pilatus1M.f2d.bz2"))
+ cbf = fabio.open(UtilsTest.getimage("Pilatus1M.cbf.bz2"))
+ msk = fabio.open(UtilsTest.getimage("Pilatus1M.msk.bz2"))
+ diff = abs((img.data).astype("int32") - cbf.data)
+ self.assertEqual(diff.sum(), 0)
+ diff = abs((msk.data).astype("int32") - img.header["data_mask"].astype("int32"))
+ self.assertEqual(diff.sum(), 0)
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestFit2DImage))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testfit2dmaskimage.py b/fabio/test/testfit2dmaskimage.py
new file mode 100644
index 0000000..970bd76
--- /dev/null
+++ b/fabio/test/testfit2dmaskimage.py
@@ -0,0 +1,159 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+""" Test the fit2d mask reader
+
+Updated by Jerome Kieffer (jerome.kieffer@esrf.eu), 2011
+28/11/2014
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+import numpy
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from fabio.fit2dmaskimage import fit2dmaskimage
+
+
+class TestFaceMask(unittest.TestCase):
+ """ test the picture of a face """
+
+ def setUp(self):
+ """
+ download images
+ """
+ self.filename = UtilsTest.getimage("face.msk.bz2")[:-4]
+ self.edffilename = UtilsTest.getimage("face.edf.bz2")[:-4]
+
+ def test_getmatch(self):
+ """ test edf and msk are the same """
+ i = fit2dmaskimage()
+ i.read(self.filename)
+ j = fabio.open(self.edffilename)
+ # print "edf: dim1",oe.dim1,"dim2",oe.dim2
+ self.assertEqual(i.dim1, j.dim1)
+ self.assertEqual(i.dim2, j.dim2)
+ self.assertEqual(i.data.shape, j.data.shape)
+ diff = j.data - i.data
+ sumd = abs(diff).sum(dtype=float)
+ self.assertEqual(sumd, 0.0)
+
+
+class TestClickedMask(unittest.TestCase):
+ """ A few random clicks to make a test mask """
+
+ def setUp(self):
+ """
+ download images
+ """
+ self.filename = UtilsTest.getimage("fit2d_click.msk.bz2")[:-4]
+ self.edffilename = UtilsTest.getimage("fit2d_click.edf.bz2")[:-4]
+
+ def test_read(self):
+ """ Check it reads a mask OK """
+ i = fit2dmaskimage()
+ i.read(self.filename)
+ self.assertEqual(i.dim1, 1024)
+ self.assertEqual(i.dim2, 1024)
+ self.assertEqual(i.bpp, 1)
+ self.assertEqual(i.bytecode, numpy.uint8)
+ self.assertEqual(i.data.shape, (1024, 1024))
+
+ def test_getmatch(self):
+ """ test edf and msk are the same """
+ i = fit2dmaskimage()
+ j = fabio.open(self.edffilename)
+ i.read(self.filename)
+ self.assertEqual(i.data.shape, j.data.shape)
+ diff = j.data - i.data
+ self.assertEqual(i.getmax(), 1)
+ self.assertEqual(i.getmin(), 0)
+ sumd = abs(diff).sum(dtype=float)
+ self.assertEqual(sumd, 0)
+
+
+class TestMskWrite(unittest.TestCase):
+ """
+ Write dummy mask files with various compression schemes
+
+ """
+ def setUp(self):
+ shape = (199, 211) # those are prime numbers
+ self.data = (numpy.random.random(shape) > 0.6)
+ self.header = fit2dmaskimage.check_header()
+
+ def atest(self):
+ e = fit2dmaskimage(data=self.data, header=self.header)
+ e.write(self.filename)
+ r = fabio.open(self.filename)
+ self.assertEqual(e.dim1, r.dim1, "dim1 are the same")
+ self.assertEqual(e.dim2, r.dim2, "dim2 are the same")
+ if r.header != self.header:
+ print("Issue with header in TestMskWrite.testFlat")
+ for k, v in r.header.items():
+ print(k, v, self.header.get(k))
+ print(e.header)
+ print(r.header)
+ print(self.header)
+
+ else:
+ self.assertTrue(r.header == self.header, "header are OK")
+ self.assertTrue(abs(r.data - self.data).max() == 0, "data are OK")
+
+ def testFlat(self):
+ self.filename = os.path.join(UtilsTest.tempdir, "random.msk")
+ self.atest()
+
+ def testGzip(self):
+ self.filename = os.path.join(UtilsTest.tempdir, "random.msk.gz")
+ self.atest()
+
+ def testBzip2(self):
+ self.filename = os.path.join(UtilsTest.tempdir, "random.msk.gz")
+ self.atest()
+
+ def tearDown(self):
+ if os.path.isfile(self.filename):
+ os.unlink(self.filename)
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestFaceMask))
+ testsuite.addTest(loadTests(TestClickedMask))
+ testsuite.addTest(loadTests(TestMskWrite))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testhdf5image.py b/fabio/test/testhdf5image.py
new file mode 100644
index 0000000..ecae5d1
--- /dev/null
+++ b/fabio/test/testhdf5image.py
@@ -0,0 +1,106 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+
+"""Test Eiger images
+"""
+
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+
+from fabio.fabioutils import exists
+from fabio.openimage import openimage
+from fabio.hdf5image import Hdf5Image, h5py
+
+
+def make_hdf5(name, shape=(50, 99, 101)):
+ if h5py is None:
+ raise unittest.SkipTest("h5py is not available")
+
+ with h5py.File(name) as h:
+ e = h.require_group("entry")
+ if len(shape) == 2:
+ e.require_dataset("data", shape, compression="gzip", compression_opts=9, dtype="float32")
+ elif len(shape) == 3:
+ e.require_dataset("data", shape, chunks=(1,) + shape[1:], compression="gzip", compression_opts=9, dtype="float32")
+ return name + "::entry/data"
+
+
+class TestHdf5(unittest.TestCase):
+ """basic test"""
+
+ @classmethod
+ def setUpClass(cls):
+ super(TestHdf5, cls).setUpClass()
+ cls.fn2 = os.path.join(UtilsTest.tempdir, "eiger2d.h5")
+ cls.fn2 = make_hdf5(cls.fn2, (99, 101))
+ cls.fn3 = os.path.join(UtilsTest.tempdir, "eiger3d.h5")
+ cls.fn3 = make_hdf5(cls.fn3, (50, 99, 101))
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestHdf5, cls).tearDownClass()
+ if exists(cls.fn3):
+ os.unlink(cls.fn3.split("::")[0])
+ if exists(cls.fn2):
+ os.unlink(cls.fn2.split("::")[0])
+
+ def test_read(self):
+ """ check we can read images from Eiger"""
+ e = Hdf5Image()
+ e.read(self.fn2)
+ self.assertEqual(e.dim1, 101, "dim1 OK")
+ self.assertEqual(e.dim2, 99, "dim2 OK")
+ self.assertEqual(e.nframes, 1, "nframes OK")
+ self.assertEqual(e.bpp, 4, "nframes OK")
+
+ e = Hdf5Image()
+ e.read(self.fn3)
+ self.assertEqual(e.dim1, 101, "dim1 OK")
+ self.assertEqual(e.dim2, 99, "dim2 OK")
+ self.assertEqual(e.nframes, 50, "nframes OK")
+ self.assertEqual(e.bpp, 4, "nframes OK")
+
+ def test_open(self):
+ """ check we can read images from Eiger"""
+ e = openimage(self.fn2)
+ self.assertEqual(e.dim1, 101, "dim1 OK")
+ self.assertEqual(e.dim2, 99, "dim2 OK")
+ self.assertEqual(e.nframes, 1, "nframes OK")
+ self.assertEqual(e.bpp, 4, "nframes OK")
+
+ e = openimage(self.fn3)
+ self.assertEqual(e.dim1, 101, "dim1 OK")
+ self.assertEqual(e.dim2, 99, "dim2 OK")
+ self.assertEqual(e.nframes, 50, "nframes OK")
+ self.assertEqual(e.bpp, 4, "nframes OK")
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestHdf5))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testheadernotsingleton.py b/fabio/test/testheadernotsingleton.py
new file mode 100644
index 0000000..09c06d6
--- /dev/null
+++ b/fabio/test/testheadernotsingleton.py
@@ -0,0 +1,80 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+# Unit tests
+
+# builds on stuff from ImageD11.test.testpeaksearch
+28/11/2014
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+import shutil
+
+
+class TestHeaderNotSingleton(unittest.TestCase):
+
+ def setUp(self):
+ """
+ download images
+ """
+ self.file1 = UtilsTest.getimage("mb_LP_1_001.img.bz2")[:-4]
+
+ def testheader(self):
+ file2 = self.file1.replace("mb_LP_1_001.img", "mb_LP_1_002.img")
+ self.assertTrue(os.path.exists(self.file1))
+ if not os.path.exists(file2):
+ shutil.copy(self.file1, file2)
+ image1 = fabio.open(self.file1)
+ image2 = fabio.open(file2)
+ abs_norm = lambda fn: os.path.normcase(os.path.abspath(fn))
+ self.assertEqual(abs_norm(image1.filename), abs_norm(self.file1))
+ self.assertEqual(abs_norm(image2.filename), abs_norm(file2))
+ self.assertNotEqual(image1.filename, image2.filename)
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ self.file1 = None
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestHeaderNotSingleton))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testjpeg2kimage.py b/fabio/test/testjpeg2kimage.py
new file mode 100644
index 0000000..6e3f01c
--- /dev/null
+++ b/fabio/test/testjpeg2kimage.py
@@ -0,0 +1,173 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+Test JPEG 2000 format
+"""
+
+from __future__ import print_function, with_statement, division, absolute_import
+
+import sys
+import unittest
+import numpy
+try:
+ from PIL import Image
+except ImportError:
+ Image = None
+
+from .utilstest import UtilsTest
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from .. import jpeg2kimage
+
+
+def isPilUsable():
+ if jpeg2kimage.PIL is None:
+ return False
+ try:
+ jpeg2kimage.PIL.Image.frombytes("1", (2, 2), b"", decoder_name='jpeg2k')
+ except Exception as e:
+ if e.args[0] == "decoder jpeg2k not available":
+ return False
+ return True
+
+
+def isGlymurUsable():
+ if jpeg2kimage.glymur is None:
+ return False
+ import glymur
+ if glymur.version.openjpeg_version_tuple < [1, 5, 0]:
+ return False
+ return True
+
+
+class TestJpeg2KImage(unittest.TestCase):
+ """Test the class format"""
+
+ def setUp(self):
+ if not isPilUsable() and not isGlymurUsable():
+ self.skipTest("PIL nor glymur are available")
+
+ def loadImage(self, filename):
+ image_format = jpeg2kimage.Jpeg2KImage()
+ image = image_format.read(filename)
+ return image
+
+ def test_open_uint8(self):
+ filename = "binned_data_uint8.jp2"
+ filename = UtilsTest.getimage(filename + ".bz2")[:-4]
+ image = self.loadImage(filename)
+ self.assertEqual(image.data.shape, (120, 120))
+ self.assertEqual(image.data.dtype, numpy.uint8)
+
+ def test_open_uint16(self):
+ filename = "binned_data_uint16.jp2"
+ filename = UtilsTest.getimage(filename + ".bz2")[:-4]
+ image_format = jpeg2kimage.Jpeg2KImage()
+ image = image_format.read(filename)
+ self.assertEqual(image.data.shape, (120, 120))
+ self.assertEqual(image.data.dtype, numpy.uint16)
+
+ def test_open_wrong_format(self):
+ filename = "MultiFrame.edf"
+ filename = UtilsTest.getimage(filename + ".bz2")[:-4]
+ image_format = jpeg2kimage.Jpeg2KImage()
+ try:
+ _image = image_format.read(filename)
+ self.fail()
+ except IOError:
+ pass
+
+ def test_open_missing_file(self):
+ filename = "___missing_file___.___"
+ image_format = jpeg2kimage.Jpeg2KImage()
+ try:
+ _image = image_format.read(filename)
+ self.fail()
+ except IOError:
+ pass
+
+
+class TestJpeg2KImage_PIL(TestJpeg2KImage):
+ """Test the class format using a specific decoder"""
+
+ def setUp(self):
+ if not isPilUsable() and not isGlymurUsable():
+ self.skipTest("PIL is not available")
+
+ @classmethod
+ def setUpClass(cls):
+ # Remove other decoders
+ cls.old = jpeg2kimage.glymur
+ jpeg2kimage.glymur = None
+
+ @classmethod
+ def tearDownClass(cls):
+ # Remove other decoders
+ jpeg2kimage.glymur = cls.old
+ cls.old = None
+
+
+class TestJpeg2KImage_glymur(TestJpeg2KImage):
+ """Test the class format using a specific decoder"""
+
+ def setUp(self):
+ if not isGlymurUsable():
+ self.skipTest("glymur is not available")
+
+ @classmethod
+ def setUpClass(cls):
+ # Remove other decoders
+ cls.old = jpeg2kimage.PIL
+ jpeg2kimage.PIL = None
+
+ @classmethod
+ def tearDownClass(cls):
+ # Remove other decoders
+ jpeg2kimage.PIL = cls.old
+ cls.old = None
+
+
+class TestJpeg2KImage_fabio(TestJpeg2KImage):
+ """Test the format inside the fabio framework"""
+
+ def loadImage(self, filename):
+ """Use the fabio API instead of using the image format"""
+ image = fabio.open(filename)
+ return image
+
+
+def suite():
+ loader = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loader(TestJpeg2KImage))
+ testsuite.addTest(loader(TestJpeg2KImage_PIL))
+ testsuite.addTest(loader(TestJpeg2KImage_glymur))
+ testsuite.addTest(loader(TestJpeg2KImage_fabio))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testjpegimage.py b/fabio/test/testjpegimage.py
new file mode 100644
index 0000000..0ede279
--- /dev/null
+++ b/fabio/test/testjpegimage.py
@@ -0,0 +1,170 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+Test JPEG format
+"""
+
+from __future__ import print_function, with_statement, division, absolute_import
+
+import unittest
+import os
+import sys
+import tempfile
+import shutil
+
+from .utilstest import UtilsTest
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from .. import jpegimage
+
+TEST_DIRECTORY = None
+# Temporary directory where storing test data
+
+
+def setUpModule():
+ global TEST_DIRECTORY
+ TEST_DIRECTORY = tempfile.mkdtemp(prefix="%s_data_" % __name__)
+
+
+def tearDownModule():
+ shutil.rmtree(TEST_DIRECTORY)
+
+
+class TestJpegImage(unittest.TestCase):
+ """Test the class format"""
+
+ def setUp(self):
+ if jpegimage.Image is None:
+ self.skipTest("PIL is not available")
+
+ def test_read_uint8(self):
+ filename = UtilsTest.getimage("rand_uint8.jpg.bz2")[:-4]
+ image_format = jpegimage.JpegImage()
+ image = image_format.read(filename)
+ self.assertEqual(image.data.shape, (64, 64))
+ self.assertIn("jfif", image.header)
+
+ def test_read_failing_file(self):
+ filename = os.path.join(TEST_DIRECTORY, "2.jpg")
+ filename_source = UtilsTest.getimage("rand_uint8.jpg.bz2")[:-4]
+
+ with open(filename_source, "r+b") as fsource:
+ with open(filename, "w+b") as ftest:
+ ftest.write(fsource.read())
+ ftest.seek(1)
+ ftest.write(b".")
+
+ image_format = jpegimage.JpegImage()
+ try:
+ _image = image_format.read(filename)
+ self.fail()
+ except IOError:
+ pass
+
+ def test_read_empty_file(self):
+ filename = os.path.join(TEST_DIRECTORY, "3.jpg")
+ f = open(filename, "wb")
+ f.close()
+
+ image_format = jpegimage.JpegImage()
+ try:
+ _image = image_format.read(filename)
+ self.fail()
+ except IOError:
+ pass
+
+ def test_read_missing_file(self):
+ filename = os.path.join(TEST_DIRECTORY, "4.jpg")
+
+ image_format = jpegimage.JpegImage()
+ try:
+ _image = image_format.read(filename)
+ self.fail()
+ except IOError:
+ pass
+
+
+class TestPilNotAvailable(unittest.TestCase):
+
+ def setUp(self):
+ filename = UtilsTest.getimage("rand_uint8.jpg.bz2")[:-4]
+ self.filename = filename
+
+ self.old = jpegimage.Image
+
+ def tearDown(self):
+ jpegimage.Image = self.old
+ self.filename = None
+ self.data = None
+
+ def open_image(self):
+ return fabio.open(self.filename)
+
+ def test_with_pil(self):
+ if jpegimage.Image is None:
+ self.skipTest("PIL is not available")
+ image = self.open_image()
+ self.assertIsInstance(image, jpegimage.JpegImage)
+ self.assertEqual(image.data.shape, (64, 64))
+ self.assertIn("jfif", image.header)
+
+ def test_without_pil(self):
+ try:
+ old = jpegimage.Image
+ jpegimage.Image = None
+ try:
+ _image = self.open_image()
+ self.fail()
+ except IOError:
+ pass
+ finally:
+ jpegimage.Image = old
+
+
+class TestJpegImageInsideFabio(unittest.TestCase):
+ """Test the format inside the fabio framework"""
+
+ def test_read_uint8(self):
+ if jpegimage.Image is None:
+ self.skipTest("PIL is not available")
+ filename = UtilsTest.getimage("rand_uint8.jpg.bz2")[:-4]
+ image = fabio.open(filename)
+ self.assertIsInstance(image, jpegimage.JpegImage)
+ self.assertEqual(image.data.shape, (64, 64))
+ self.assertIn("jfif", image.header)
+
+
+def suite():
+ loader = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loader(TestJpegImage))
+ testsuite.addTest(loader(TestJpegImageInsideFabio))
+ testsuite.addTest(loader(TestPilNotAvailable))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testkcdimage.py b/fabio/test/testkcdimage.py
new file mode 100755
index 0000000..21b3594
--- /dev/null
+++ b/fabio/test/testkcdimage.py
@@ -0,0 +1,97 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+
+Test for Nonius Kappa CCD cameras.
+
+"""
+
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from ..kcdimage import kcdimage
+from ..openimage import openimage
+
+
+class TestKcd(unittest.TestCase):
+ """basic test"""
+ kcdfilename = 'i01f0001.kcd'
+ edffilename = 'i01f0001.edf'
+ results = """i01f0001.kcd 625 576 96 66814.0 195.3862972 243.58150990245315"""
+
+ def setUp(self):
+ """Download files"""
+ self.fn = {}
+ for i in ["i01f0001.kcd", "i01f0001.edf"]:
+ self.fn[i] = UtilsTest.getimage(i + ".bz2")[:-4]
+ for i in self.fn:
+ assert os.path.exists(self.fn[i])
+
+ def test_read(self):
+ """ check we can read kcd images"""
+ vals = self.results.split()
+ dim1, dim2 = [int(x) for x in vals[1:3]]
+ mini, maxi, mean, stddev = [float(x) for x in vals[3:]]
+ for ext in ["", ".gz", ".bz2"]:
+ try:
+ obj = openimage(self.fn[self.kcdfilename] + ext)
+ except Exception as err:
+ logger.error("unable to read: %s", self.fn[self.kcdfilename] + ext)
+ raise err
+ self.assertAlmostEqual(mini, obj.getmin(), 4, "getmin" + ext)
+ self.assertAlmostEqual(maxi, obj.getmax(), 4, "getmax" + ext)
+ self.assertAlmostEqual(mean, obj.getmean(), 4, "getmean" + ext)
+ self.assertAlmostEqual(stddev, obj.getstddev(), 4, "getstddev" + ext)
+ self.assertEqual(dim1, obj.dim1, "dim1" + ext)
+ self.assertEqual(dim2, obj.dim2, "dim2" + ext)
+
+ def test_same(self):
+ """ see if we can read kcd images and if they are the same as the EDF """
+ kcd = kcdimage()
+ kcd.read(self.fn[self.kcdfilename])
+ edf = fabio.open(self.fn[self.edffilename])
+ diff = (kcd.data.astype("int32") - edf.data.astype("int32"))
+ self.assertAlmostEqual(abs(diff).sum(dtype=int), 0, 4)
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestKcd))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testmar345image.py b/fabio/test/testmar345image.py
new file mode 100644
index 0000000..fdaab69
--- /dev/null
+++ b/fabio/test/testmar345image.py
@@ -0,0 +1,208 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+# Unit tests
+
+# builds on stuff from ImageD11.test.testpeaksearch
+28/11/2014
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+import numpy
+import logging
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from fabio.mar345image import mar345image
+
+# filename dim1 dim2 min max mean stddev
+TESTIMAGES = """example.mar2300 2300 2300 0 999999 180.15 4122.67
+ example.mar2300.bz2 2300 2300 0 999999 180.15 4122.67
+ example.mar2300.gz 2300 2300 0 999999 180.15 4122.67
+ Fe3O4_023_101.mar2560 2560 3072 0 258253 83.61749 198.29895739775
+ Fe3O4_023_101.mar2560.bz2 2560 3072 0 258253 83.61749 198.29895739775
+ Fe3O4_023_101.mar2560.gz 2560 3072 0 258253 83.61749 198.29895739775"""
+# Fe3O4_023_101.mar2560 is a pathological file from Mar555
+
+
+class TestMar345(unittest.TestCase):
+ def setUp(self):
+ """
+ download images
+ """
+ self.mar345 = UtilsTest.getimage("example.mar2300.bz2")[:-4]
+ self.mar555 = UtilsTest.getimage("Fe3O4_023_101.mar2560.bz2")[:-4]
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ self.mar345 = self.mar555 = None
+
+ def test_read(self):
+ """
+ Test the reading of Mar345 images
+ """
+ for line in TESTIMAGES.split('\n'):
+ vals = line.strip().split()
+ name = vals[0]
+ dim1, dim2 = [int(x) for x in vals[1:3]]
+ mini, maxi, mean, stddev = [float(x) for x in vals[3:]]
+ obj = mar345image()
+ obj.read(UtilsTest.getimage(name))
+
+ self.assertAlmostEqual(mini, obj.getmin(), 2, "getmin [%s,%s]" % (mini, obj.getmin()))
+ self.assertAlmostEqual(maxi, obj.getmax(), 2, "getmax [%s,%s]" % (maxi, obj.getmax()))
+ self.assertAlmostEqual(mean, obj.getmean(), 2, "getmean [%s,%s]" % (mean, obj.getmean()))
+ self.assertAlmostEqual(stddev, obj.getstddev(), 2, "getstddev [%s,%s]" % (stddev, obj.getstddev()))
+ self.assertEqual(dim1, obj.dim1, "dim1")
+ self.assertEqual(dim2, obj.dim2, "dim2")
+
+ def test_write(self):
+ "Test writing with self consistency at the fabio level"
+ for line in TESTIMAGES.split("\n"):
+ logger.debug("Processing file: %s" % line)
+ vals = line.split()
+ name = vals[0]
+ obj = mar345image()
+ obj.read(os.path.join(os.path.dirname(self.mar345), name))
+ obj.write(os.path.join(UtilsTest.tempdir, name))
+ other = mar345image()
+ other.read(os.path.join(UtilsTest.tempdir, name))
+ if abs(obj.data - other.data).max():
+ logger.error("data for %s are not the same %s", line, numpy.where(obj.data - other.data))
+ self.assertEqual(abs(obj.data - other.data).max(), 0, "data are the same")
+ for key in obj.header:
+ if key == "filename":
+ continue
+ self.assertTrue(key in other.header, "Key %s is in header" % key)
+ self.assertEqual(obj.header[key], other.header[key], "value are the same for key %s: [%s|%s]" % (key, obj.header[key], other.header[key]))
+
+ os.unlink(os.path.join(UtilsTest.tempdir, name))
+
+ def test_byteswap_write(self):
+ "Test writing with self consistency at the fabio level"
+ for line in TESTIMAGES.split("\n"):
+ logger.debug("Processing file: %s" % line)
+ vals = line.split()
+ name = vals[0]
+ obj = mar345image()
+ obj.read(os.path.join(os.path.dirname(self.mar345), name))
+ obj.swap_needed = not (obj.swap_needed)
+ obj.write(os.path.join(UtilsTest.tempdir, name))
+ other = mar345image()
+ other.read(os.path.join(UtilsTest.tempdir, name))
+ self.assertEqual(abs(obj.data - other.data).max(), 0, "data are the same")
+ for key in obj.header:
+ if key == "filename":
+ continue
+ self.assertTrue(key in other.header, "Key %s is in header" % key)
+ self.assertEqual(obj.header[key], other.header[key], "value are the same for key %s: [%s|%s]" % (key, obj.header[key], other.header[key]))
+
+ os.unlink(os.path.join(UtilsTest.tempdir, name))
+
+ @unittest.skip("very slow test")
+ def test_memoryleak(self):
+ """
+ This test takes a lot of time, so only in debug mode.
+ """
+ N = 1000
+ if logger.getEffectiveLevel() <= logging.INFO:
+ logger.debug("Testing for memory leak")
+ for i in range(N):
+ _img = fabio.open(self.mar345)
+ print("reading #%s/%s" % (i, N))
+
+ def test_aux(self):
+ """test auxillary functions
+ """
+ shape = 120, 130
+ size = shape[0] * shape[1]
+ import fabio.ext.mar345_IO
+ img = numpy.random.randint(0, 32000, size).astype("int16")
+ b = fabio.ext.mar345_IO.precomp(img, shape[-1])
+ c = fabio.ext.mar345_IO.postdec(b, shape[-1])
+ self.assertEqual(abs(c - img).max(), 0, "pre-compression and post-decompression works")
+
+ a = fabio.ext.mar345_IO.calc_nb_bits(numpy.arange(8).astype("int32"), 0, 8)
+ self.assertEqual(a, 32, "8*4")
+
+ a = fabio.ext.mar345_IO.calc_nb_bits(numpy.arange(10).astype("int32"), 0, 10)
+ self.assertEqual(a, 50, "10*5")
+
+ a = fabio.ext.mar345_IO.calc_nb_bits(numpy.arange(50).astype("int32"), 0, 50)
+ self.assertEqual(a, 350, 50 * 7)
+
+ img.shape = shape
+ cmp_ccp4 = fabio.ext.mar345_IO.compress_pck(img, use_CCP4=True)
+ cmp_fab = fabio.ext.mar345_IO.compress_pck(img, use_CCP4=False)
+ delta = abs(len(cmp_fab) - len(cmp_ccp4))
+ if len(cmp_fab) > len(cmp_ccp4):
+ logger.error("len(fabio): %s len(ccp4):%s", len(cmp_fab), len(cmp_ccp4))
+ self.assertLessEqual(delta, 10, "Compression by FabIO is similar to CCP4")
+ img_c_c = fabio.ext.mar345_IO.uncompress_pck(cmp_ccp4, overflowPix=False, use_CCP4=True)
+ delta = img_c_c - img
+ ok = abs(delta).ravel()
+ if ok.max() > 0:
+ logger.error("img_c_c: %s %s" % numpy.where(delta))
+ self.assertEqual(ok.max(), 0, "Compression CCP4 decompression CCP4")
+
+ img_c_f = fabio.ext.mar345_IO.uncompress_pck(cmp_ccp4, overflowPix=False, use_CCP4=False)
+ delta = img_c_f - img
+ ok = abs(delta).ravel()
+ if ok.max() > 0:
+ logger.error("img_c_f: %s %s" % numpy.where(delta))
+ self.assertEqual(ok.max(), 0, "Compression CCP4 decompression Cython")
+
+ img_f_c = fabio.ext.mar345_IO.uncompress_pck(cmp_fab, overflowPix=False, use_CCP4=True)
+ delta = img_f_c - img
+ ok = abs(delta).ravel()
+ if ok.max() > 0:
+ logger.error("img_f_c: %s %s" % numpy.where(delta))
+ self.assertEqual(ok.max(), 0, "Compression Cython decompression CCP4")
+
+ img_f_f = fabio.ext.mar345_IO.uncompress_pck(cmp_fab, overflowPix=False, use_CCP4=False)
+ delta = img_f_f - img
+ ok = abs(delta).ravel()
+ if ok.max() > 0:
+ logger.error("img_f_f: %s %s" % numpy.where(delta))
+ self.assertEqual(ok.max(), 0, "Compression Cython decompression Cython")
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestMar345))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite)
diff --git a/fabio/test/testmccdimage.py b/fabio/test/testmccdimage.py
new file mode 100644
index 0000000..baef900
--- /dev/null
+++ b/fabio/test/testmccdimage.py
@@ -0,0 +1,124 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+# Unit tests
+
+# builds on stuff from ImageD11.test.testpeaksearch
+28/11/2014
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+import numpy
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from ..tifimage import tifimage
+from ..marccdimage import marccdimage
+
+# statistics come from fit2d I think
+# filename dim1 dim2 min max mean stddev
+TESTIMAGES = """corkcont2_H_0089.mccd 2048 2048 0 354 7.2611 14.639
+ corkcont2_H_0089.mccd.bz2 2048 2048 0 354 7.2611 14.639
+ corkcont2_H_0089.mccd.gz 2048 2048 0 354 7.2611 14.639
+ somedata_0001.mccd 1024 1024 0 20721 128.37 136.23
+ somedata_0001.mccd.bz2 1024 1024 0 20721 128.37 136.23
+ somedata_0001.mccd.gz 1024 1024 0 20721 128.37 136.23"""
+
+
+class TestNormalTiffOK(unittest.TestCase):
+ """
+ check we can read normal tifs as well as mccd
+ """
+
+ def setUp(self):
+ """
+ create an image
+ """
+ self.image = os.path.join(UtilsTest.tempdir, "tifimagewrite_test0000.tif")
+ self.imdata = numpy.zeros((24, 24), numpy.uint16)
+ self.imdata[12:14, 15:17] = 42
+ obj = tifimage(self.imdata, {})
+ obj.write(self.image)
+
+ def test_read_openimage(self):
+ from fabio.openimage import openimage
+ obj = openimage(self.image)
+ if obj.data.astype(int).tostring() != self.imdata.astype(int).tostring():
+ logger.info("%s %s" % (type(self.imdata), self.imdata.dtype))
+ logger.info("%s %s" % (type(obj.data), obj.data.dtype))
+ logger.info("%s %s" % (obj.data - self.imdata))
+ self.assertEqual(obj.data.astype(int).tostring(),
+ self.imdata.astype(int).tostring())
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ os.unlink(self.image)
+
+
+class TestFlatMccds(unittest.TestCase):
+ def setUp(self):
+ self.fn = {}
+ for i in ["corkcont2_H_0089.mccd", "somedata_0001.mccd"]:
+ self.fn[i] = UtilsTest.getimage(i + ".bz2")[:-4]
+ self.fn[i + ".bz2"] = self.fn[i] + ".bz2"
+ self.fn[i + ".gz"] = self.fn[i] + ".gz"
+ for i in self.fn:
+ assert os.path.exists(self.fn[i])
+
+ def test_read(self):
+ """ check we can read MarCCD images"""
+ for line in TESTIMAGES.split("\n"):
+ vals = line.split()
+ name = vals[0]
+ dim1, dim2 = [int(x) for x in vals[1:3]]
+ mini, maxi, mean, stddev = [float(x) for x in vals[3:]]
+ obj = marccdimage()
+ obj.read(self.fn[name])
+ self.assertAlmostEqual(mini, obj.getmin(), 2, "getmin")
+ self.assertAlmostEqual(maxi, obj.getmax(), 2, "getmax")
+ self.assertAlmostEqual(mean, obj.getmean(), 2, "getmean")
+ self.assertAlmostEqual(stddev, obj.getstddev(), 2, "getstddev")
+ self.assertEqual(dim1, obj.dim1, "dim1")
+ self.assertEqual(dim2, obj.dim2, "dim2")
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestFlatMccds))
+ testsuite.addTest(loadTests(TestNormalTiffOK))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testmpaimage.py b/fabio/test/testmpaimage.py
new file mode 100644
index 0000000..e446eec
--- /dev/null
+++ b/fabio/test/testmpaimage.py
@@ -0,0 +1,76 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""Multiwire Unit tests"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+from .utilstest import UtilsTest
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+
+
+class TestMpa(unittest.TestCase):
+ """
+ Test classe for multiwire (mpa) images
+ """
+ TESTIMAGES = [
+ # filename dim1 dim2 min max mean stddev
+ ("mpa_test.mpa", 1024, 1024, 0, 1295, 0.8590, 18.9393),
+ ]
+
+ def test_read(self):
+ """
+ Test the reading of multiwire images
+ """
+ for imageData in self.TESTIMAGES:
+ name, dim1, dim2, mini, maxi, mean, stddev = imageData
+ logger.debug("Processing: %s" % name)
+ path = UtilsTest.getimage(name + ".bz2")[:-4]
+
+ obj = fabio.mpaimage.MpaImage()
+ obj.read(path)
+
+ self.assertAlmostEqual(mini, obj.getmin(), 2, "getmin [%s,%s]" % (mini, obj.getmin()))
+ self.assertAlmostEqual(maxi, obj.getmax(), 2, "getmax [%s,%s]" % (maxi, obj.getmax()))
+ self.assertAlmostEqual(mean, obj.getmean(), 2, "getmean [%s,%s]" % (mean, obj.getmean()))
+ self.assertAlmostEqual(stddev, obj.getstddev(), 2, "getstddev [%s,%s]" % (stddev, obj.getstddev()))
+ self.assertEqual(dim1, obj.dim1, "dim1")
+ self.assertEqual(dim2, obj.dim2, "dim2")
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestMpa))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testnumpyimage.py b/fabio/test/testnumpyimage.py
new file mode 100755
index 0000000..9a2dfe8
--- /dev/null
+++ b/fabio/test/testnumpyimage.py
@@ -0,0 +1,108 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+Test for numpy images.
+"""
+__author__ = "Jérôme Kieffer"
+__date__ = "27/07/2017"
+import os
+import sys
+import unittest
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+import numpy
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from fabio.numpyimage import NumpyImage
+from fabio.openimage import openimage
+
+
+class TestNumpy(unittest.TestCase):
+ """basic test"""
+
+ def setUp(self):
+ """Generate files"""
+
+ self.ary = numpy.random.randint(0, 6500, size=99).reshape(11, 9).astype("uint16")
+ self.fn = os.path.join(UtilsTest.tempdir, "numpy.npy")
+ self.fn2 = os.path.join(UtilsTest.tempdir, "numpy2.npy")
+ numpy.save(self.fn, self.ary)
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ for i in (self.fn, self.fn2):
+ if os.path.exists(i):
+ os.unlink(i)
+ self.ary = self.fn = self.fn2 = None
+
+ def test_read(self):
+ """ check we can read pnm images"""
+ obj = openimage(self.fn)
+
+ self.assertEqual(obj.bytecode, numpy.uint16, msg="bytecode is OK")
+ self.assertEqual(9, obj.dim1, "dim1")
+ self.assertEqual(11, obj.dim2, "dim2")
+ self.assertTrue(numpy.allclose(obj.data, self.ary), "data")
+
+ def test_write(self):
+ """ check we can write numpy images"""
+ ref = NumpyImage(data=self.ary)
+ ref.save(self.fn2)
+ with openimage(self.fn2) as obj:
+ self.assertEqual(obj.bytecode, numpy.uint16, msg="bytecode is OK")
+ self.assertEqual(9, obj.dim1, "dim1")
+ self.assertEqual(11, obj.dim2, "dim2")
+ self.assertTrue(numpy.allclose(obj.data, self.ary), "data")
+
+ def test_multidim(self):
+ for shape in (10,), (10, 15), (10, 15, 20), (10, 15, 20, 25):
+ ary = numpy.random.random(shape).astype("float32")
+ numpy.save(self.fn, ary)
+ with openimage(self.fn) as obj:
+ self.assertEqual(obj.bytecode, numpy.float32, msg="bytecode is OK")
+ self.assertEqual(shape[-1], obj.dim1, "dim1")
+ dim2 = 1 if len(shape) == 1 else shape[-2]
+ self.assertEqual(dim2, obj.dim2, "dim2")
+ nframes = 1
+ if len(shape) > 2:
+ for i in shape[:-2]:
+ nframes *= i
+ # print(shape,nframes, obj.nframes)
+ self.assertEqual(nframes, obj.nframes, "nframes")
+ if os.path.exists(self.fn):
+ os.unlink(self.fn)
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestNumpy))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testopenheader.py b/fabio/test/testopenheader.py
new file mode 100644
index 0000000..a933360
--- /dev/null
+++ b/fabio/test/testopenheader.py
@@ -0,0 +1,69 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+# Unit tests
+Jerome Kieffer, 04/12/2014
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from fabio.openimage import openheader
+
+
+class Test1(unittest.TestCase):
+ """openheader opening edf"""
+ def setUp(self):
+ self.name = UtilsTest.getimage("F2K_Seb_Lyso0675_header_only.edf.bz2")[:-4]
+
+ def testcase(self):
+ """ check openheader can read edf headers"""
+ for ext in ["", ".bz2", ".gz"]:
+ name = self.name + ext
+ obj = openheader(name)
+ logger.debug(" %s obj = %s" % (name, obj.header))
+ self.assertEqual(obj.header["title"],
+ "ESPIA FRELON Image",
+ "Error on file %s" % name)
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(Test1))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite)
diff --git a/fabio/test/testopenimage.py b/fabio/test/testopenimage.py
new file mode 100644
index 0000000..8de701a
--- /dev/null
+++ b/fabio/test/testopenimage.py
@@ -0,0 +1,242 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+# Unit tests
+
+builds on stuff from ImageD11.test.testpeaksearch
+Jerome Kieffer 04/12/2014
+"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+
+from fabio.openimage import openimage
+from fabio.edfimage import edfimage
+from fabio.marccdimage import marccdimage
+from fabio.fit2dmaskimage import fit2dmaskimage
+from fabio.OXDimage import OXDimage
+from fabio.brukerimage import brukerimage
+from fabio.adscimage import adscimage
+
+
+class TestOpenEdf(unittest.TestCase):
+ """openimage opening edf"""
+
+ def checkFile(self, filename):
+ """ check we can read EDF image with openimage"""
+ obj = openimage(filename)
+ obj2 = edfimage()
+ obj2.read(filename)
+ self.assertEqual(obj.data[10, 10], obj2.data[10, 10])
+ self.assertEqual(type(obj), type(obj2))
+ self.assertEqual(abs(obj.data.astype(int) - obj2.data.astype(int)).sum(), 0)
+
+ def testEdf(self):
+ fname = "F2K_Seb_Lyso0675.edf.bz2"
+ filename = UtilsTest.getimage(fname)[:-4]
+ self.checkFile(filename)
+
+ def testEdfGz(self):
+ fname = "F2K_Seb_Lyso0675.edf.gz"
+ filename = UtilsTest.getimage(fname)
+ self.checkFile(filename)
+
+ def testEdfBz2(self):
+ fname = "F2K_Seb_Lyso0675.edf.bz2"
+ filename = UtilsTest.getimage(fname)
+ self.checkFile(filename)
+
+
+class TestOpenMccd(unittest.TestCase):
+ """openimage opening mccd"""
+
+ def checkFile(self, filename):
+ """ check we can read it"""
+ obj = openimage(filename)
+ obj2 = marccdimage()
+ obj2.read(filename)
+ self.assertEqual(obj.data[10, 10], obj2.data[10, 10])
+ self.assertEqual(type(obj), type(obj2))
+ self.assertEqual(abs(obj.data.astype(int) - obj2.data.astype(int)).sum(), 0)
+
+ def testMccd(self):
+ fname = "somedata_0001.mccd.bz2"
+ filename = UtilsTest.getimage(fname)[:-4]
+ self.checkFile(filename)
+
+ def testMccdGz(self):
+ fname = "somedata_0001.mccd.gz"
+ filename = UtilsTest.getimage(fname)
+ self.checkFile(filename)
+
+ def testMccdBz2(self):
+ fname = "somedata_0001.mccd.bz2"
+ filename = UtilsTest.getimage(fname)
+ self.checkFile(filename)
+
+
+class TestOpenMask(unittest.TestCase):
+ """openimage opening fit2d msk"""
+
+ def checkFile(self, filename):
+ """ check we can read Fit2D mask with openimage"""
+ obj = openimage(filename)
+ obj2 = fit2dmaskimage()
+ obj2.read(filename)
+ self.assertEqual(obj.data[10, 10], obj2.data[10, 10])
+ self.assertEqual(type(obj), type(obj2))
+ self.assertEqual(abs(obj.data.astype(int) - obj2.data.astype(int)).sum(), 0)
+ self.assertEqual(abs(obj.data.astype(int) - obj2.data.astype(int)).sum(), 0)
+
+ def testMask(self):
+ """openimage opening fit2d msk"""
+ fname = "face.msk.bz2"
+ filename = UtilsTest.getimage(fname)[:-4]
+ self.checkFile(filename)
+
+ def testMaskGz(self):
+ """openimage opening fit2d msk gzip"""
+ fname = "face.msk.gz"
+ filename = UtilsTest.getimage(fname)
+ self.checkFile(filename)
+
+ def testMaskBz2(self):
+ """openimage opening fit2d msk bzip"""
+ fname = "face.msk.bz2"
+ filename = UtilsTest.getimage(fname)
+ self.checkFile(filename)
+
+
+class TestOpenBruker(unittest.TestCase):
+ """openimage opening bruker"""
+
+ def checkFile(self, filename):
+ """ check we can read it"""
+ obj = openimage(filename)
+ obj2 = brukerimage()
+ obj2.read(filename)
+ self.assertEqual(obj.data[10, 10], obj2.data[10, 10])
+ self.assertEqual(type(obj), type(obj2))
+ self.assertEqual(abs(obj.data.astype(int) - obj2.data.astype(int)).sum(), 0)
+
+ def testBruker(self):
+ """openimage opening bruker"""
+ fname = "Cr8F8140k103.0026.bz2"
+ filename = UtilsTest.getimage(fname)[:-4]
+ self.checkFile(filename)
+
+ def testBrukerGz(self):
+ """openimage opening bruker gzip"""
+ fname = "Cr8F8140k103.0026.gz"
+ filename = UtilsTest.getimage(fname)
+ self.checkFile(filename)
+
+ def testBrukerBz2(self):
+ """openimage opening bruker bzip"""
+ fname = "Cr8F8140k103.0026.bz2"
+ filename = UtilsTest.getimage(fname)
+ self.checkFile(filename)
+
+
+class TestOpenAdsc(unittest.TestCase):
+ """openimage opening adsc"""
+
+ def checkFile(self, filename):
+ """ check we can read it"""
+ obj = openimage(filename)
+ obj2 = adscimage()
+ obj2.read(filename)
+ self.assertEqual(obj.data[10, 10], obj2.data[10, 10])
+ self.assertEqual(type(obj), type(obj2))
+ self.assertEqual(abs(obj.data.astype(int) - obj2.data.astype(int)).sum(), 0)
+
+ def testAdsc(self):
+ """openimage opening adsc"""
+ fname = "mb_LP_1_001.img.bz2"
+ filename = UtilsTest.getimage(fname)[:-4]
+ self.checkFile(filename)
+
+ def testAdscGz(self):
+ """openimage opening adsc gzip"""
+ fname = "mb_LP_1_001.img.gz"
+ filename = UtilsTest.getimage(fname)
+ self.checkFile(filename)
+
+ def testAdscBz2(self):
+ """openimage opening adsc bzip"""
+ fname = "mb_LP_1_001.img.bz2"
+ filename = UtilsTest.getimage(fname)
+ self.checkFile(filename)
+
+
+class TestOpenOxd(unittest.TestCase):
+ """openimage opening adsc"""
+
+ def checkFile(self, filename):
+ """ check we can read OXD images with openimage"""
+ obj = openimage(filename)
+ obj2 = OXDimage()
+ obj2.read(filename)
+ self.assertEqual(obj.data[10, 10], obj2.data[10, 10])
+ self.assertEqual(type(obj), type(obj2))
+ self.assertEqual(abs(obj.data.astype(int) - obj2.data.astype(int)).sum(), 0)
+
+ def testOxd(self):
+ """openimage opening adsc"""
+ fname = "b191_1_9_1.img.bz2"
+ filename = UtilsTest.getimage(fname)[:-4]
+ self.checkFile(filename)
+
+ def testOxdUnc(self):
+ """openimage opening adsc"""
+ fname = "b191_1_9_1_uncompressed.img.bz2"
+ filename = UtilsTest.getimage(fname)[:-4]
+ self.checkFile(filename)
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestOpenAdsc))
+ testsuite.addTest(loadTests(TestOpenBruker))
+ testsuite.addTest(loadTests(TestOpenEdf))
+ testsuite.addTest(loadTests(TestOpenMask))
+ testsuite.addTest(loadTests(TestOpenMccd))
+ testsuite.addTest(loadTests(TestOpenOxd))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testpilatusimage.py b/fabio/test/testpilatusimage.py
new file mode 100644
index 0000000..f1ea592
--- /dev/null
+++ b/fabio/test/testpilatusimage.py
@@ -0,0 +1,78 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""Pilatus Tiff Unit tests"""
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+
+
+class TestPilatus(unittest.TestCase):
+ # filename dim1 dim2 min max mean stddev
+ TESTIMAGES = """
+ lysb_5mg-1.90s_SAXS.bz2 487 619 0 1300 29.4260 17.7367
+ lysb_5mg-1.90s_SAXS.gz 487 619 0 1300 29.4260 17.7367
+ lysb_5mg-1.90s_SAXS 487 619 0 1300 29.4260 17.7367
+ """
+
+ def test_read(self):
+ """
+ Test the reading of Mar345 images
+ """
+ for line in self.TESTIMAGES.split('\n'):
+ vals = line.strip().split()
+ if not vals:
+ continue
+ name = vals[0]
+ logger.debug("Processing: %s" % name)
+ dim1, dim2 = [int(x) for x in vals[1:3]]
+ mini, maxi, mean, stddev = [float(x) for x in vals[3:]]
+ obj = fabio.pilatusimage.PilatusImage()
+ obj.read(UtilsTest.getimage(name))
+
+ self.assertAlmostEqual(mini, obj.getmin(), 2, "getmin [%s,%s]" % (mini, obj.getmin()))
+ self.assertAlmostEqual(maxi, obj.getmax(), 2, "getmax [%s,%s]" % (maxi, obj.getmax()))
+ self.assertAlmostEqual(mean, obj.getmean(), 2, "getmean [%s,%s]" % (mean, obj.getmean()))
+ self.assertAlmostEqual(stddev, obj.getstddev(), 2, "getstddev [%s,%s]" % (stddev, obj.getstddev()))
+ self.assertEqual(dim1, obj.dim1, "dim1")
+ self.assertEqual(dim2, obj.dim2, "dim2")
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestPilatus))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testpnmimage.py b/fabio/test/testpnmimage.py
new file mode 100755
index 0000000..aa5684b
--- /dev/null
+++ b/fabio/test/testpnmimage.py
@@ -0,0 +1,95 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+
+Test for PNM images.
+
+Jerome Kieffer, 04/12/2014
+"""
+__author__ = "Jerome Kieffer"
+__date__ = "27/07/2017"
+import os
+import sys
+import unittest
+import numpy
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from fabio.pnmimage import pnmimage
+from fabio.openimage import openimage
+
+
+class TestPNM(unittest.TestCase):
+ """basic test"""
+ results = """image0001.pgm 1024 1024 0 28416 353.795654296875 2218.0290682517543"""
+
+ def setUp(self):
+ """Download files"""
+ self.fn = {}
+ for j in self.results.split("\n"):
+ i = j.split()[0]
+ self.fn[i] = UtilsTest.getimage(i + ".bz2")[:-4]
+ for i in self.fn:
+ assert os.path.exists(self.fn[i])
+
+ def test_read(self):
+ """ check we can read pnm images"""
+ vals = self.results.split()
+ name = vals[0]
+ dim1, dim2 = [int(x) for x in vals[1:3]]
+ mini, maxi, mean, stddev = [float(x) for x in vals[3:]]
+ obj = openimage(self.fn[name])
+ self.assertAlmostEqual(mini, obj.getmin(), 4, "getmin")
+ self.assertAlmostEqual(maxi, obj.getmax(), 4, "getmax")
+ self.assertAlmostEqual(mean, obj.getmean(), 4, "getmean")
+ self.assertAlmostEqual(stddev, obj.getstddev(), 4, "getstddev")
+ self.assertEqual(dim1, obj.dim1, "dim1")
+ self.assertEqual(dim2, obj.dim2, "dim2")
+
+ def test_write(self):
+ pnmfile = os.path.join(UtilsTest.tempdir, "pnmfile.pnm")
+ shape = (9, 11)
+ size = shape[0] * shape[1]
+ data = numpy.random.randint(0, 65000, size=size).reshape(shape)
+ pnmimage(data=data).save(pnmfile)
+ with openimage(pnmfile) as pnm:
+ self.assertTrue(numpy.allclose(data, pnm.data), "data are the same")
+ if os.path.exists(pnmfile):
+ os.unlink(pnmfile)
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestPNM))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testraxisimage.py b/fabio/test/testraxisimage.py
new file mode 100644
index 0000000..8a4c2e2
--- /dev/null
+++ b/fabio/test/testraxisimage.py
@@ -0,0 +1,121 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""
+# Unit tests for raxis images
+28/11/2014
+"""
+from __future__ import print_function, with_statement, division
+import unittest
+import sys
+import os
+import logging
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from fabio.raxisimage import raxisimage
+
+
+# filename dim1 dim2 min max mean stddev
+TESTIMAGES = """mgzn-20hpt.img 2300 1280 16 15040 287.82 570.72
+ mgzn-20hpt.img.bz2 2300 1280 16 15040 287.82 570.72
+ mgzn-20hpt.img.gz 2300 1280 16 15040 287.82 570.72"""
+# Seek from end is not supported with gzip
+
+
+class TestRaxisImage(unittest.TestCase):
+
+ def setUp(self):
+ """
+ download images
+ """
+ self.mar = UtilsTest.getimage("mgzn-20hpt.img.bz2")[:-4]
+
+ def test_read(self):
+ """
+ Test the reading of Mar345 images
+ """
+ for line in TESTIMAGES.split('\n'):
+ vals = line.strip().split()
+ name = vals[0]
+ logger.debug("Testing file %s" % name)
+ dim1, dim2 = [int(x) for x in vals[1:3]]
+ mini, maxi, mean, stddev = [float(x) for x in vals[3:]]
+ obj = raxisimage()
+ obj.read(os.path.join(os.path.dirname(self.mar), name))
+
+ self.assertAlmostEqual(mini, obj.getmin(), 2, "getmin [%s,%s]" % (mini, obj.getmin()))
+ self.assertAlmostEqual(maxi, obj.getmax(), 2, "getmax [%s,%s]" % (maxi, obj.getmax()))
+ self.assertAlmostEqual(mean, obj.getmean(), 2, "getmean [%s,%s]" % (mean, obj.getmean()))
+ self.assertAlmostEqual(stddev, obj.getstddev(), 2, "getstddev [%s,%s]" % (stddev, obj.getstddev()))
+ self.assertEqual(dim1, obj.dim1, "dim1")
+ self.assertEqual(dim2, obj.dim2, "dim2")
+ self.assertNotEqual(obj.dim1, obj.dim2, "dim2!=dim1")
+
+ def _test_write(self):
+ self.skipTest("Write is not implemented")
+ "Test writing with self consistency at the fabio level"
+ for line in TESTIMAGES.split("\n"):
+ logger.debug("Processing file: %s" % line)
+ vals = line.split()
+ name = vals[0]
+ obj = raxisimage()
+ obj.read(os.path.join(os.path.dirname(self.mar), name))
+ obj.write(os.path.join(UtilsTest.tempdir, name))
+ other = raxisimage()
+ other.read(os.path.join(UtilsTest.tempdir, name))
+ self.assertEqual(abs(obj.data - other.data).max(), 0, "data are the same")
+ for key in obj.header:
+ if key == "filename":
+ continue
+ self.assertTrue(key in other.header, "Key %s is in header" % key)
+ self.assertEqual(obj.header[key], other.header[key], "value are the same for key %s: [%s|%s]" % (key, obj.header[key], other.header[key]))
+ os.unlink(os.path.join(UtilsTest.tempdir, name))
+
+ def test_memoryleak(self):
+ """
+ This test takes a lot of time, so only in debug mode.
+ """
+ N = 1000
+ if logger.getEffectiveLevel() <= logging.INFO:
+ logger.debug("Testing for memory leak")
+ for i in range(N):
+ _img = fabio.open(self.mar)
+ print("Reading #%s/%s" % (i, N))
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestRaxisImage))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testspeimage.py b/fabio/test/testspeimage.py
new file mode 100644
index 0000000..ddd534a
--- /dev/null
+++ b/fabio/test/testspeimage.py
@@ -0,0 +1,163 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) 2016 Univeristy Köln, Germany
+#
+# Principal author: Clemens Prescher (c.prescher@uni-koeln.de)
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+#
+# Get ready for python3:
+from __future__ import with_statement, print_function, division
+
+__authors__ = ["Clemens Prescher"]
+__contact__ = "c.prescher@uni-koeln.de"
+__license__ = "MIT"
+__copyright__ = "Clemens Prescher/Univeristy Köln, Germany"
+__date__ = "27/07/2017"
+
+import unittest
+import sys
+import numpy
+
+from .utilstest import UtilsTest
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+from fabio.speimage import SpeImage
+
+
+class TestSpeImage(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ super(TestSpeImage, cls).setUpClass()
+ cls.v2_spe_filename = UtilsTest.getimage('v2.SPE.bz2')[:-4]
+ cls.v2_converted_spe_filename = UtilsTest.getimage('v2_converted.SPE.bz2')[:-4]
+ cls.v3_spe_filename = UtilsTest.getimage('v3.spe.bz2')[:-4]
+ cls.v3_custom_roi_filename = UtilsTest.getimage('v3_custom_roi.spe.bz2')[:-4]
+ cls.v3_2frames_filename = UtilsTest.getimage('v3_2frames.spe.bz2')[:-4]
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestSpeImage, cls).tearDownClass()
+
+ def setUp(self):
+ self.v2_spe_file = SpeImage()
+ self.v2_spe_file.read(self.v2_spe_filename)
+
+ self.v3_spe_file = SpeImage()
+ self.v3_spe_file.read(self.v3_spe_filename)
+
+ self.v2_converted_spe_file = SpeImage()
+ self.v2_converted_spe_file.read(self.v2_converted_spe_filename)
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ # free the associated memory
+ self.v2_spe_file = self.v3_spe_file = self.v2_converted_spe_file = None
+
+ def test_reading_version2_spe(self):
+ self.assertEqual(self.v2_spe_file.header['version'], 2)
+ self.assertEqual(self.v3_spe_file.header['version'], 3)
+ self.assertEqual(self.v2_converted_spe_file.header['version'], 3)
+
+ def test_calibration(self):
+ self.assertGreater(len(self.v2_spe_file.header['x_calibration']), 0)
+ self.assertGreater(len(self.v3_spe_file.header['x_calibration']), 0)
+ self.assertGreater(len(self.v2_converted_spe_file.header['x_calibration']), 0)
+
+ #
+ def test_time(self):
+ self.assertEqual(self.v2_spe_file.header['time'], "07/13/2013 19:42:23")
+ self.assertEqual(self.v3_spe_file.header['time'], "09/06/2013 16:50:39.445678")
+ self.assertEqual(self.v2_converted_spe_file.header['time'], "05/10/2013 10:34:27")
+
+ def test_exposure_time(self):
+ self.assertEqual(self.v2_spe_file.header['exposure_time'], 0.5)
+ self.assertEqual(self.v3_spe_file.header['exposure_time'], 0.1)
+ self.assertEqual(self.v2_converted_spe_file.header['exposure_time'], 0.18)
+
+ def test_detector(self):
+ self.assertEqual(self.v2_spe_file.header['detector'], 'unspecified')
+ self.assertEqual(self.v3_spe_file.header['detector'], "PIXIS: 100BR")
+ self.assertEqual(self.v2_converted_spe_file.header['detector'], 'unspecified')
+
+ def test_grating(self):
+ self.assertEqual(self.v2_spe_file.header['grating'], '300.0')
+ self.assertEqual(self.v3_spe_file.header['grating'], '860nm 300')
+ self.assertEqual(self.v2_converted_spe_file.header['grating'], '300.0')
+
+ def test_center_wavelength(self):
+ self.assertEqual(self.v2_spe_file.header['center_wavelength'], 750)
+ self.assertEqual(self.v3_spe_file.header['center_wavelength'], 500)
+ self.assertEqual(self.v2_converted_spe_file.header['center_wavelength'], 750)
+
+ def test_roi(self):
+ self.assertEqual(self.v3_spe_file.header['roi'], (0, 1024, 0, 100))
+ self.v3_custom_region = SpeImage()
+ self.v3_custom_region.read(self.v3_custom_roi_filename)
+ self.assertEqual(self.v3_custom_region.header['roi'], (100, 600, 10, 60))
+ self.assertEqual(len(self.v3_custom_region.header['x_calibration']),
+ self.v3_custom_region.header['x_dim'])
+
+ def test_read_data(self):
+ self.assertEqual(self.v2_spe_file.data.shape, (100, 1340))
+ self.assertEqual(self.v3_spe_file.data.shape, (100, 1024))
+ self.assertEqual(self.v2_converted_spe_file.data.shape, (100, 1340))
+
+ def test_multiple_frames(self):
+ self.v3_2frames_file = SpeImage()
+ self.v3_2frames_file.read(self.v3_2frames_filename)
+ self.assertEqual(self.v3_2frames_file.data.shape, (255, 1024))
+ frame1 = self.v3_2frames_file.data
+
+ self.v3_2frames_file.read(self.v3_2frames_filename, 1)
+ frame2 = self.v3_2frames_file.data
+
+ self.assertFalse(numpy.array_equal(frame1, frame2))
+ self.assertEqual(frame1.shape, frame2.shape)
+
+ def test_fabio_integration(self):
+ v2_file = fabio.open(self.v2_spe_filename)
+ v3_file = fabio.open(self.v3_spe_filename)
+ v2_file_gz = fabio.open(self.v2_spe_filename + ".gz")
+ v3_file_gz = fabio.open(self.v3_spe_filename + ".gz")
+ v2_file_bz = fabio.open(self.v2_spe_filename + ".bz2")
+ v3_file_bz = fabio.open(self.v3_spe_filename + ".bz2")
+ self.assertEqual(abs(v2_file.data - v2_file_gz.data).max(), 0, "v2/gz")
+ self.assertEqual(abs(v3_file.data - v3_file_gz.data).max(), 0, "v3/gz")
+ self.assertEqual(abs(v2_file.data - v2_file_bz.data).max(), 0, "v2/bz")
+ self.assertEqual(abs(v3_file.data - v3_file_bz.data).max(), 0, "v3/bz")
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestSpeImage))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/testtifimage.py b/fabio/test/testtifimage.py
new file mode 100755
index 0000000..009ab8e
--- /dev/null
+++ b/fabio/test/testtifimage.py
@@ -0,0 +1,185 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Project: Fable Input Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+"""Tiff Unit tests"""
+
+from __future__ import print_function, with_statement, division, absolute_import
+import unittest
+import sys
+import os
+
+if __name__ == '__main__':
+ import pkgutil
+ __path__ = pkgutil.extend_path([os.path.dirname(__file__)], "fabio.test")
+from .utilstest import UtilsTest
+
+logger = UtilsTest.get_logger(__file__)
+fabio = sys.modules["fabio"]
+
+
+class TestTif(unittest.TestCase):
+ # filename dim1 dim2 min max mean stddev
+ TESTIMAGES = """
+ Feb09-bright-00.300s_WAXS.bz2 1042 1042 0 65535 8546.6414 1500.4198
+ Feb09-bright-00.300s_WAXS.gz 1042 1042 0 65535 8546.6414 1500.4198
+ Feb09-bright-00.300s_WAXS 1042 1042 0 65535 8546.6414 1500.4198
+ """
+
+ def test_read(self):
+ """
+ Test the reading of Mar345 images
+ """
+ for line in self.TESTIMAGES.split('\n'):
+ vals = line.strip().split()
+ if not vals:
+ continue
+ name = vals[0]
+ logger.debug("Processing: %s" % name)
+ dim1, dim2 = [int(x) for x in vals[1:3]]
+ mini, maxi, mean, stddev = [float(x) for x in vals[3:]]
+ obj = fabio.tifimage.TifImage()
+ obj.read(UtilsTest.getimage(name))
+
+ self.assertAlmostEqual(mini, obj.getmin(), 2, "getmin [%s,%s]" % (mini, obj.getmin()))
+ self.assertAlmostEqual(maxi, obj.getmax(), 2, "getmax [%s,%s]" % (maxi, obj.getmax()))
+ self.assertAlmostEqual(mean, obj.getmean(), 2, "getmean [%s,%s]" % (mean, obj.getmean()))
+ self.assertAlmostEqual(stddev, obj.getstddev(), 2, "getstddev [%s,%s]" % (stddev, obj.getstddev()))
+ self.assertEqual(dim1, obj.dim1, "dim1")
+ self.assertEqual(dim2, obj.dim2, "dim2")
+
+
+class TestTifImage_Pilatus(unittest.TestCase):
+ def setUp(self):
+ self.fn = {}
+ for i in ["pilatus2M.tif", "pilatus2M.edf"]:
+ self.fn[i] = UtilsTest.getimage(i + ".bz2")
+ for i in self.fn:
+ assert os.path.exists(self.fn[i])
+
+ def test1(self):
+ """
+ Testing pilatus tif bug
+ """
+ o1 = fabio.open(self.fn["pilatus2M.tif"]).data
+ o2 = fabio.open(self.fn["pilatus2M.edf"]).data
+ self.assertEqual(abs(o1 - o2).max(), 0.0)
+
+
+class TestTifImage_Packbits(unittest.TestCase):
+ def setUp(self):
+ self.fn = {}
+ for i in ["oPPA_5grains_0001.tif", "oPPA_5grains_0001.edf"]:
+ self.fn[i] = UtilsTest.getimage(i + ".bz2")
+ for i in self.fn:
+ assert os.path.exists(self.fn[i])
+
+ def test1(self):
+ """
+ Testing packbit comressed data tif bug
+ """
+ o1 = fabio.open(self.fn["oPPA_5grains_0001.tif"]).data
+ o2 = fabio.open(self.fn["oPPA_5grains_0001.edf"]).data
+ self.assertEqual(abs(o1 - o2).max(), 0.0)
+
+
+class TestTifImage_fit2d(unittest.TestCase):
+ def setUp(self):
+ self.fn = {}
+ for i in ["fit2d.tif", "fit2d.edf"]:
+ self.fn[i] = UtilsTest.getimage(i + ".bz2")
+ for i in self.fn:
+ assert os.path.exists(self.fn[i])
+
+ def test1(self):
+ """
+ Testing packbit comressed data tif bug
+ """
+ o1 = fabio.open(self.fn["fit2d.tif"]).data
+ o2 = fabio.open(self.fn["fit2d.edf"]).data
+ self.assertEqual(abs(o1 - o2).max(), 0.0)
+
+
+class TestTifImage_A0009(unittest.TestCase):
+ """
+ test image from ??? with this error
+a0009.tif TIFF 1024x1024 1024x1024+0+0 16-bit Grayscale DirectClass 2MiB 0.000u 0:00.010
+identify: a0009.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/703.
+identify: a0009.tif: TIFF directory is missing required "StripByteCounts" field, calculating from imagelength. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/703.
+
+ """
+ def setUp(self):
+ self.fn = {}
+ for i in ["a0009.tif", "a0009.edf"]:
+ self.fn[i] = UtilsTest.getimage(i + ".bz2")[:-4]
+ for i in self.fn:
+ assert os.path.exists(self.fn[i])
+
+ def test1(self):
+ """
+ Testing packbit comressed data tif bug
+ """
+ o1 = fabio.open(self.fn["a0009.tif"]).data
+ o2 = fabio.open(self.fn["a0009.edf"]).data
+ self.assertEqual(abs(o1 - o2).max(), 0.0)
+
+
+class TestGzipTif(unittest.TestCase):
+ def setUp(self):
+ self.unzipped = UtilsTest.getimage("oPPA_5grains_0001.tif.bz2")[:-4]
+ self.zipped = self.unzipped + ".gz"
+ assert os.path.exists(self.zipped)
+ assert os.path.exists(self.unzipped)
+
+ def test1(self):
+ o1 = fabio.open(self.zipped)
+ o2 = fabio.open(self.unzipped)
+ self.assertEqual(o1.data[0, 0], 10)
+ self.assertEqual(o2.data[0, 0], 10)
+
+
+class TestTif_Rect(unittest.TestCase):
+ def setUp(self):
+ self.fn = UtilsTest.getimage("testmap1_0002.tif.bz2")[:-4]
+
+ def test1(self):
+ for ext in ["", ".gz", ".bz2"]:
+ o1 = fabio.open(self.fn + ext)
+ self.assertEqual(o1.data.shape, (100, 120))
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ testsuite = unittest.TestSuite()
+ testsuite.addTest(loadTests(TestTif))
+ testsuite.addTest(loadTests(TestGzipTif))
+ testsuite.addTest(loadTests(TestTif_Rect))
+ testsuite.addTest(loadTests(TestTifImage_A0009))
+ testsuite.addTest(loadTests(TestTifImage_fit2d))
+ testsuite.addTest(loadTests(TestTifImage_Packbits))
+ testsuite.addTest(loadTests(TestTifImage_Pilatus))
+ return testsuite
+
+
+if __name__ == '__main__':
+ runner = unittest.TextTestRunner()
+ runner.run(suite())
diff --git a/fabio/test/utilstest.py b/fabio/test/utilstest.py
new file mode 100644
index 0000000..273a356
--- /dev/null
+++ b/fabio/test/utilstest.py
@@ -0,0 +1,288 @@
+#!/usr/bin/env python
+# coding: utf-8
+#
+# Project: FabIO tests class utilities
+#
+# Copyright (C) 2010-2016 European Synchrotron Radiation Facility
+# Grenoble, France
+#
+# Principal authors: Jérôme KIEFFER (jerome.kieffer@esrf.fr)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+from __future__ import print_function, division, absolute_import, with_statement
+
+__author__ = "Jérôme Kieffer"
+__contact__ = "jerome.kieffer@esrf.eu"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "11/08/2017"
+
+PACKAGE = "fabio"
+DATA_KEY = "FABIO_DATA"
+
+import os
+import sys
+import getpass
+import threading
+import logging
+import bz2
+from ..third_party import gzip
+import json
+import tempfile
+
+
+try: # Python3
+ from urllib.request import urlopen, ProxyHandler, build_opener
+except ImportError: # Python2
+ from urllib2 import urlopen, ProxyHandler, build_opener
+logging.basicConfig(level=logging.WARNING)
+logger = logging.getLogger("%s.utilstest" % PACKAGE)
+
+TEST_HOME = os.path.dirname(os.path.abspath(__file__))
+
+
+class UtilsTest(object):
+ """
+ Static class providing useful stuff for preparing tests.
+ """
+ options = None
+ timeout = 60 # timeout in seconds for downloading images
+ # url_base = "http://downloads.sourceforge.net/fable"
+ url_base = "http://www.edna-site.org/pub/fabio/testimages"
+ sem = threading.Semaphore()
+ recompiled = False
+ reloaded = False
+ name = PACKAGE
+ script_dir = None
+
+ try:
+ fabio = __import__("%s.directories" % name)
+ image_home = fabio.directories.testimages
+ except Exception as err:
+ logger.warning("in loading directories %s", err)
+ image_home = None
+ else:
+ image_home = fabio.directories.testimages
+ if image_home is None:
+ image_home = os.path.join(tempfile.gettempdir(), "%s_testimages_%s" % (name, getpass.getuser()))
+ if not os.path.exists(image_home):
+ os.makedirs(image_home)
+ testimages = os.path.join(image_home, "all_testimages.json")
+ if os.path.exists(testimages):
+ with open(testimages) as f:
+ ALL_DOWNLOADED_FILES = set(json.load(f))
+ else:
+ ALL_DOWNLOADED_FILES = set()
+ tempdir = tempfile.mkdtemp("_" + getpass.getuser(), name + "_")
+
+ @classmethod
+ def deep_reload(cls):
+ cls.fabio = __import__(cls.name)
+ return cls.fabio
+
+ @classmethod
+ def forceBuild(cls, remove_first=True):
+ """
+ Force the recompilation of FabIO
+
+ Nonesense, kept for legacy reasons
+ """
+ return
+
+ @classmethod
+ def timeoutDuringDownload(cls, imagename=None):
+ """
+ Function called after a timeout in the download part ...
+ just raise an Exception.
+ """
+ if imagename is None:
+ imagename = "2252/testimages.tar.bz2 unzip it "
+ raise RuntimeError("Could not automatically \
+ download test images!\n \ If you are behind a firewall, \
+ please set both environment variable http_proxy and https_proxy.\
+ This even works under windows ! \n \
+ Otherwise please try to download the images manually from \n %s/%s and put it in in test/testimages." % (cls.url_base, imagename))
+
+ @classmethod
+ def getimage(cls, imagename):
+ """
+ Downloads the requested image from Forge.EPN-campus.eu
+
+ :param str imagename: name of the image.
+ For the RedMine forge, the filename contains a directory name that
+ is removed
+ :return: full path of the locally saved file
+ """
+ if imagename not in cls.ALL_DOWNLOADED_FILES:
+ cls.ALL_DOWNLOADED_FILES.add(imagename)
+ image_list = list(cls.ALL_DOWNLOADED_FILES)
+ image_list.sort()
+ try:
+ with open(cls.testimages, "w") as fp:
+ json.dump(image_list, fp, indent=4)
+ except IOError:
+ logger.debug("Unable to save JSON list")
+ baseimage = os.path.basename(imagename)
+ logger.info("UtilsTest.getimage('%s')" % baseimage)
+ if not os.path.exists(cls.image_home):
+ os.makedirs(cls.image_home)
+ fullimagename = os.path.abspath(os.path.join(cls.image_home, baseimage))
+ if os.path.exists(fullimagename):
+ return fullimagename
+
+ if baseimage.endswith(".bz2"):
+ bzip2name = baseimage
+ basename = baseimage[:-4]
+ gzipname = basename + ".gz"
+ elif baseimage.endswith(".gz"):
+ gzipname = baseimage
+ basename = baseimage[:-3]
+ bzip2name = basename + ".bz2"
+ else:
+ basename = baseimage
+ gzipname = baseimage + "gz2"
+ bzip2name = basename + ".bz2"
+
+ fullimagename_gz = os.path.abspath(os.path.join(cls.image_home, gzipname))
+ fullimagename_raw = os.path.abspath(os.path.join(cls.image_home, basename))
+ fullimagename_bz2 = os.path.abspath(os.path.join(cls.image_home, bzip2name))
+
+ data = None
+
+ if not os.path.isfile(fullimagename_bz2):
+ logger.info("Trying to download image %s, timeout set to %ss",
+ bzip2name, cls.timeout)
+ dictProxies = {}
+ if "http_proxy" in os.environ:
+ dictProxies['http'] = os.environ["http_proxy"]
+ dictProxies['https'] = os.environ["http_proxy"]
+ if "https_proxy" in os.environ:
+ dictProxies['https'] = os.environ["https_proxy"]
+ if dictProxies:
+ proxy_handler = ProxyHandler(dictProxies)
+ opener = build_opener(proxy_handler).open
+ else:
+ opener = urlopen
+
+ logger.info("wget %s/%s" % (cls.url_base, imagename))
+ data = opener("%s/%s" % (cls.url_base, imagename),
+ data=None, timeout=cls.timeout).read()
+ logger.info("Image %s successfully downloaded." % baseimage)
+
+ try:
+ with open(fullimagename_bz2, "wb") as outfile:
+ outfile.write(data)
+ except IOError:
+ raise IOError("unable to write downloaded \
+ data to disk at %s" % cls.image_home)
+
+ if not os.path.isfile(fullimagename_bz2):
+ raise RuntimeError("Could not automatically \
+ download test images %s!\n \ If you are behind a firewall, \
+ please set the environment variable http_proxy.\n \
+ Otherwise please try to download the images manually from \n \
+ %s" % (cls.url_base, imagename))
+ if not os.path.isfile(fullimagename_raw) or\
+ not os.path.isfile(fullimagename_gz):
+
+ if data is None:
+ data = open(fullimagename_bz2, "rb").read()
+ decompressed = bz2.decompress(data)
+
+ if not os.path.exists(fullimagename_raw):
+ try:
+ open(fullimagename_raw, "wb").write(decompressed)
+ except IOError:
+ raise IOError("unable to write decompressed \
+ data to disk at %s" % cls.image_home)
+ if not os.path.exists(fullimagename_gz):
+ try:
+ gzip.open(fullimagename_gz, "wb").write(decompressed)
+ except IOError:
+ raise IOError("unable to write gzipped \
+ data to disk at %s" % cls.image_home)
+ return fullimagename
+
+ @classmethod
+ def download_images(cls, imgs=None):
+ """
+ Download all images needed for the test/benchmarks
+
+ :param imgs: list of files to download
+ """
+ if not imgs:
+ imgs = cls.ALL_DOWNLOADED_FILES
+ for fn in imgs:
+ print("Downloading from internet: %s" % fn)
+ if fn[-4:] != ".bz2":
+ if fn[-3:] == ".gz":
+ fn = fn[:-2] + "bz2"
+ else:
+ fn = fn + ".bz2"
+ print(" actually " + fn)
+ cls.getimage(fn)
+
+ @classmethod
+ def get_logger(cls, filename=__file__):
+ """
+ small helper function that initialized the logger and returns it
+ """
+ basename = os.path.basename(os.path.abspath(filename))
+ basename = os.path.splitext(basename)[0]
+ level = logging.root.level
+ mylogger = logging.getLogger(basename)
+ logger.setLevel(level)
+ mylogger.setLevel(level)
+ mylogger.debug("tests loaded from file: %s" % basename)
+ return mylogger
+
+ @classmethod
+ def script_path(cls, script):
+ """
+ Returns the path of the executable and the associated environment
+
+ In Windows, it checks availability of script using .py .bat, and .exe
+ file extensions.
+ """
+ if (sys.platform == "win32"):
+ available_extensions = [".py", ".bat", ".exe"]
+ else:
+ available_extensions = [""]
+
+ env = dict((str(k), str(v)) for k, v in os.environ.items())
+ env["PYTHONPATH"] = os.pathsep.join(sys.path)
+ paths = os.environ.get("PATH", "").split(os.pathsep)
+ if cls.script_dir is not None:
+ paths.insert(0, cls.script_dir)
+
+ for base in paths:
+ # clean up extra quotes from paths
+ if base.startswith('"') and base.endswith('"'):
+ base = base[1:-1]
+ for file_extension in available_extensions:
+ script_path = os.path.join(base, script + file_extension)
+ if os.path.exists(script_path):
+ # script found
+ return script_path, env
+ # script not found
+ logger.warning("Script '%s' not found in paths: %s", script, ":".join(paths))
+ script_path = script
+ return script_path, env
+
diff --git a/fabio/third_party/__init__.py b/fabio/third_party/__init__.py
new file mode 100644
index 0000000..68ef990
--- /dev/null
+++ b/fabio/third_party/__init__.py
@@ -0,0 +1 @@
+# Place holder \ No newline at end of file
diff --git a/fabio/third_party/argparse.py b/fabio/third_party/argparse.py
new file mode 100644
index 0000000..c63cbb8
--- /dev/null
+++ b/fabio/third_party/argparse.py
@@ -0,0 +1,50 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2015-2016 European Synchrotron Radiation Facility
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+# ###########################################################################*/
+"""Wrapper module for the `argparse` library.
+
+Feed this module using a local copy of `argparse` if it exists.
+Else it expect to have an available `argparse` library installed
+in the Python path.
+
+It should be used like that:
+
+.. code-block::
+
+ from fabio.third_party import argparse
+
+"""
+
+from __future__ import absolute_import
+
+__authors__ = ["Valentin Valls"]
+__license__ = "MIT"
+__date__ = "28/07/2017"
+
+try:
+ # try to import our local version of six
+ from ._local.argparse import * # noqa
+except ImportError:
+ # else try to import it from the python path
+ from argparse import * # noqa
diff --git a/fabio/third_party/gzip.py b/fabio/third_party/gzip.py
new file mode 100644
index 0000000..3846157
--- /dev/null
+++ b/fabio/third_party/gzip.py
@@ -0,0 +1,60 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2015-2016 European Synchrotron Radiation Facility
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+# ###########################################################################*/
+"""Wrapper module for the `gzip` library.
+
+Feed this module using a local copy of `gzip` if it exists.
+Else it expect to have an available `gzip` library installed in
+the Python path.
+
+It should be used like that:
+
+.. code-block::
+
+ from fabio.third_party import gzip
+
+"""
+
+from __future__ import absolute_import
+
+__authors__ = ["Valentin Valls"]
+__license__ = "MIT"
+__date__ = "28/07/2017"
+
+import sys as __sys
+
+if __sys.version_info < (2, 7):
+ # Try to import our local version of six
+ from ._local.gzip import * # noqa
+else:
+ # Else try to import it from the python path
+
+ # Importing star here is not working
+ # from gzip import * # noqa
+
+ import gzip as __gzip
+ for k, v in __gzip.__dict__.items():
+ if k.startswith("_"):
+ continue
+ vars()[k] = v
diff --git a/fabio/third_party/ordereddict.py b/fabio/third_party/ordereddict.py
new file mode 100644
index 0000000..f21ba7e
--- /dev/null
+++ b/fabio/third_party/ordereddict.py
@@ -0,0 +1,50 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2015-2016 European Synchrotron Radiation Facility
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+# ###########################################################################*/
+"""Wrapper module for the `ordereddict` library.
+
+Feed this module using a local copy of `ordereddict` if it exists.
+Else it expect to have an available `ordereddict` library installed in
+the Python path.
+
+It should be used like that:
+
+.. code-block::
+
+ from fabio.third_party.ordereddict import OrderedDict
+
+"""
+
+from __future__ import absolute_import
+
+__authors__ = ["Valentin Valls"]
+__license__ = "MIT"
+__date__ = "28/07/2017"
+
+try:
+ # try to import our local version of six
+ from ._local.ordereddict import * # noqa
+except ImportError:
+ # else try to import it from the python path
+ from collections import OrderedDict
diff --git a/fabio/third_party/setup.py b/fabio/third_party/setup.py
new file mode 100644
index 0000000..952d205
--- /dev/null
+++ b/fabio/third_party/setup.py
@@ -0,0 +1,48 @@
+# coding: ascii
+#
+# JK: Numpy.distutils which imports this does not handle utf-8 in version<1.12
+#
+# /*##########################################################################
+#
+# Copyright (c) 2016 European Synchrotron Radiation Facility
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+# ###########################################################################*/
+
+__authors__ = ["Valentin Valls"]
+__license__ = "MIT"
+__date__ = "31/07/2017"
+
+import os
+from numpy.distutils.misc_util import Configuration
+
+
+def configuration(parent_package='', top_path=None):
+ config = Configuration('third_party', parent_package, top_path)
+ # includes _local only if it is available
+ local_path = os.path.join(top_path, parent_package, "third_party", "_local")
+ if os.path.exists(local_path):
+ config.add_subpackage('_local')
+ return config
+
+
+if __name__ == "__main__":
+ from numpy.distutils.core import setup
+ setup(configuration=configuration)
diff --git a/fabio/third_party/six.py b/fabio/third_party/six.py
new file mode 100644
index 0000000..4e226ee
--- /dev/null
+++ b/fabio/third_party/six.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2015-2016 European Synchrotron Radiation Facility
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+# ###########################################################################*/
+"""Wrapper module for the `six` library.
+
+Feed this module using a local silx copy of `six` if it exists.
+Else it expect to have an available `six` library installed in the Python path.
+
+It should be used like that:
+
+.. code-block::
+
+ from fabio.third_party import six
+
+"""
+
+from __future__ import absolute_import
+
+__authors__ = ["Valentin Valls"]
+__license__ = "MIT"
+__date__ = "28/07/2017"
+
+try:
+ # try to import our local version of six
+ from ._local.six import * # noqa
+except ImportError:
+ # else try to import it from the python path
+ import six
+ if tuple(int(i) for i in six.__version__.split(".")[:2]) < (1, 8):
+ raise ImportError("Six version is too old")
+ from six import * # noqa
diff --git a/fabio/tifimage.py b/fabio/tifimage.py
new file mode 100644
index 0000000..48453ab
--- /dev/null
+++ b/fabio/tifimage.py
@@ -0,0 +1,341 @@
+# coding: utf-8
+#
+# Project: FabIO X-ray image reader
+#
+# Copyright (C) 2010-2016 European Synchrotron Radiation Facility
+# Grenoble, France
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+"""
+FabIO class for dealing with TIFF images.
+In facts wraps TiffIO from V. Armando Solé (available in PyMca) or falls back to PIL
+
+Authors:
+........
+* Henning O. Sorensen & Erik Knudsen:
+ Center for Fundamental Research: Metal Structures in Four Dimensions;
+ Risoe National Laboratory;
+ Frederiksborgvej 399;
+ DK-4000 Roskilde;
+ email:erik.knudsen@risoe.dk
+* Jérôme Kieffer:
+ European Synchrotron Radiation Facility;
+ Grenoble (France)
+
+License: MIT
+"""
+# Get ready for python3:
+from __future__ import with_statement, print_function, division
+
+__authors__ = ["Jérôme Kieffer", "Henning O. Sorensen", "Erik Knudsen"]
+__date__ = "11/08/2017"
+__license__ = "MIT"
+__copyright__ = "ESRF, Grenoble & Risoe National Laboratory"
+__status__ = "stable"
+
+import time
+import logging
+import struct
+logger = logging.getLogger(__name__)
+
+try:
+ from PIL import Image
+except ImportError:
+ Image = None
+import numpy
+from .utils import pilutils
+from .fabioimage import FabioImage
+from .TiffIO import TiffIO
+
+LITTLE_ENDIAN = 1234
+BIG_ENDIAN = 3412
+
+TYPES = {
+ 0: 'invalid',
+ 1: 'byte',
+ 2: 'ascii',
+ 3: 'short',
+ 4: 'long',
+ 5: 'rational',
+ 6: 'sbyte',
+ 7: 'undefined',
+ 8: 'sshort',
+ 9: 'slong',
+ 10: 'srational',
+ 11: 'float',
+ 12: 'double'
+}
+
+TYPESIZES = {
+ 0: 0,
+ 1: 1,
+ 2: 1,
+ 3: 2,
+ 4: 4,
+ 5: 8,
+ 6: 1,
+ 7: 1,
+ 8: 2,
+ 9: 4,
+ 10: 8,
+ 11: 4,
+ 12: 8
+}
+
+baseline_tiff_tags = {
+ 256: 'ImageWidth',
+ 257: 'ImageLength',
+ 306: 'DateTime',
+ 315: 'Artist',
+ 258: 'BitsPerSample',
+ 265: 'CellLength',
+ 264: 'CellWidth',
+ 259: 'Compression',
+
+ 262: 'PhotometricInterpretation',
+ 296: 'ResolutionUnit',
+ 282: 'XResolution',
+ 283: 'YResolution',
+
+ 278: 'RowsPerStrip',
+ 273: 'StripOffset',
+ 279: 'StripByteCounts',
+
+ 270: 'ImageDescription',
+ 271: 'Make',
+ 272: 'Model',
+ 320: 'ColorMap',
+ 305: 'Software',
+ 339: 'SampleFormat',
+ 33432: 'Copyright'
+}
+
+
+class TifImage(FabioImage):
+ """
+ Images in TIF format
+ Wraps TiffIO
+ """
+ DESCRIPTION = "Tagged image file format"
+
+ DEFAULT_EXTENTIONS = ["tif", "tiff"]
+
+ _need_a_seek_to_read = True
+
+ def __init__(self, *args, **kwds):
+ """ Tifimage constructor adds an nbits member attribute """
+ self.nbits = None
+ FabioImage.__init__(self, *args, **kwds)
+ self.lib = None
+
+ def _readheader(self, infile):
+ """
+ Try to read Tiff images header...
+ """
+ # try:
+ # self.header = { "filename" : infile.name }
+ # except AttributeError:
+ # self.header = {}
+ # t = Tiff_header(infile.read())
+ # self.header = t.header
+ # try:
+ # self.dim1 = int(self.header['ImageWidth'])
+ # self.dim2 = int(self.header['ImageLength'])
+ # except (KeyError):
+ # logger.warning("image dimensions could not be determined from header tags, trying to go on anyway")
+ # read the first 32 bytes to determine size
+ header = numpy.fromstring(infile.read(64), numpy.uint16)
+ self.dim1 = int(header[9])
+ self.dim2 = int(header[15])
+ # nbits is not a FabioImage attribute...
+ self.nbits = int(header[21]) # number of bits
+
+ def read(self, fname, frame=None):
+ """
+ Wrapper for TiffIO.
+ """
+ infile = self._open(fname, "rb")
+ self._readheader(infile)
+ infile.seek(0)
+ self.lib = None
+ try:
+ tiffIO = TiffIO(infile)
+ if tiffIO.getNumberOfImages() > 0:
+ # No support for now of multi-frame tiff images
+ self.data = tiffIO.getImage(0)
+ self.header = tiffIO.getInfo(0)
+ except Exception as error:
+ logger.warning("Unable to read %s with TiffIO due to %s, trying PIL" % (fname, error))
+ else:
+ if self.data.ndim == 2:
+ self.dim2, self.dim1 = self.data.shape
+ elif self.data.ndim == 3:
+ self.dim2, self.dim1, _ = self.data.shape
+ logger.warning("Third dimension is the color")
+ else:
+ logger.warning("dataset has %s dimensions (%s), check for errors !!!!", self.data.ndim, self.data.shape)
+ self.lib = "TiffIO"
+
+ if (self.lib is None):
+ if Image:
+ try:
+ infile.seek(0)
+ self.pilimage = Image.open(infile)
+ except Exception:
+ logger.error("Error in opening %s with PIL" % fname)
+ self.lib = None
+ infile.seek(0)
+ else:
+ self.lib = "PIL"
+ self.data = pilutils.get_numpy_array(self.pilimage)
+ else:
+ logger.error("Error in opening %s: no tiff reader managed to read the file.", fname)
+ self.lib = None
+ infile.seek(0)
+
+ self.resetvals()
+ return self
+
+ def write(self, fname):
+ """
+ Overrides the FabioImage.write method and provides a simple TIFF image writer.
+
+ :param str fname: name of the file to save the image to
+ """
+ with TiffIO(fname, mode="w") as tIO:
+ tIO.writeImage(self.data, info=self.header, software="fabio.tifimage", date=time.ctime())
+
+
+# define a couple of helper classes here:
+class Tiff_header(object):
+ def __init__(self, string):
+ if string[:4] == "II\x2a\x00":
+ self.byteorder = LITTLE_ENDIAN
+ elif string[:4] == 'MM\x00\x2a':
+ self.byteorder = BIG_ENDIAN
+ else:
+ logger.warning("Warning: This does not appear to be a tiff file")
+ # the next two bytes contains the offset of the oth IFD
+ offset_first_ifd = struct.unpack_from("h", string[4:])[0]
+ self.ifd = [Image_File_Directory()]
+ offset_next = self.ifd[0].unpack(string, offset_first_ifd)
+ while (offset_next != 0):
+ self.ifd.append(Image_File_Directory())
+ offset_next = self.ifd[-1].unpack(string, offset_next)
+
+ self.header = {}
+ # read the values of the header items into a dictionary
+ for entry in self.ifd[0].entries:
+ if entry.tag in baseline_tiff_tags.keys():
+ self.header[baseline_tiff_tags[entry.tag]] = entry.val
+ else:
+ self.header[entry.tag] = entry.val
+
+
+class Image_File_Directory(object):
+ def __init__(self, instring=None, offset=-1):
+ self.entries = []
+ self.offset = offset
+ self.count = None
+
+ def unpack(self, instring, offset=-1):
+ if (offset == -1):
+ offset = self.offset
+
+ strInput = instring[offset:]
+ self.count = struct.unpack_from("H", strInput[:2])[0]
+ # 0th IFD contains count-1 entries (count includes the adress of the next IFD)
+ for i in range(self.count - 1):
+ e = Image_File_Directory_entry().unpack(strInput[2 + 12 * (i + 1):])
+ if (e is not None):
+ self.entries.append(e)
+ # extract data associated with tags
+ for e in self.entries:
+ if (e.val is None):
+ e.extract_data(instring)
+ # do we have some more ifds in this file
+ offset_next = struct.unpack_from("L", instring[offset + 2 + self.count * 12:])[0]
+ return offset_next
+
+
+class Image_File_Directory_entry(object):
+ def __init__(self, tag=0, tag_type=0, count=0, offset=0):
+ self.tag = tag
+ self.tag_type = tag_type
+ self.count = count
+ self.val_offset = offset
+ self.val = None
+
+ def unpack(self, strInput):
+ idfentry = strInput[:12]
+################################################################################
+# # TOFIX: How is it possible that HHL (2+2+4 bytes has a size of )
+################################################################################
+ (tag, tag_type, count) = struct.unpack_from("HHL", idfentry)
+ self.tag = tag
+ self.count = count
+ self.tag_type = tag_type
+ self.val = None
+ if (count <= 0):
+ logger.warning("Tag # %s has an invalid count: %s. Tag is ignored" % (tag, count))
+ return
+ if(count * TYPESIZES[tag_type] <= 4):
+ self.val_offset = 8
+ self.extract_data(idfentry)
+ self.val_offset = None
+ else:
+ self.val_offset = struct.unpack_from("L", idfentry[8:])[0]
+ return self
+
+ def extract_data(self, full_string):
+ tag_type = self.tag_type
+ if (TYPES[tag_type] == 'byte'):
+ self.val = struct.unpack_from("B", full_string[self.val_offset:])[0]
+ elif (TYPES[tag_type] == 'short'):
+ self.val = struct.unpack_from("H", full_string[self.val_offset:])[0]
+ elif (TYPES[tag_type] == 'long'):
+ self.val = struct.unpack_from("L", full_string[self.val_offset:])[0]
+ elif (TYPES[tag_type] == 'sbyte'):
+ self.val = struct.unpack_from("b", full_string[self.val_offset:])[0]
+ elif (TYPES[tag_type] == 'sshort'):
+ self.val = struct.unpack_from("h", full_string[self.val_offset:])[0]
+ elif (TYPES[tag_type] == 'slong'):
+ self.val = struct.unpack_from("l", full_string[self.val_offset:])[0]
+ elif (TYPES[tag_type] == 'ascii'):
+ self.val = full_string[self.val_offset:self.val_offset + max(self.count, 4)]
+ elif (TYPES[tag_type] == 'rational'):
+ if self.val_offset is not None:
+ (num, den) = struct.unpack_from("LL", full_string[self.val_offset:])
+ self.val = float(num) / den
+ elif (TYPES[tag_type] == 'srational'):
+ if self.val_offset is not None:
+ (num, den) = struct.unpack_from("ll", full_string[self.val_offset:])
+ self.val = float(num) / den,
+ elif (TYPES[tag_type] == 'float'):
+ self.val = struct.unpack_from("f", full_string[self.val_offset:])[0]
+ elif (TYPES[tag_type] == 'double'):
+ if self.val_offset is not None:
+ self.val = struct.unpack_from("d", full_string[self.val_offset:])[0]
+ else:
+ logger.warning("unrecognized type of strInputentry self: %s tag: %s type: %s TYPE: %s" % (self, baseline_tiff_tags[self.tag], self.tag_type, TYPES[tag_type]))
+
+
+tifimage = TifImage
diff --git a/fabio/utils/__init__.py b/fabio/utils/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/fabio/utils/__init__.py
diff --git a/fabio/utils/mathutils.py b/fabio/utils/mathutils.py
new file mode 100644
index 0000000..3947bed
--- /dev/null
+++ b/fabio/utils/mathutils.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE
+
+"""Math function which can be useful on the full project
+"""
+
+import numpy
+
+
+def naive_rad2deg(x):
+ """
+ Naive implementation of radiuan to degree.
+
+ Useful for very old numpy (v1.0.1 on MacOSX from Risoe)
+ """
+ return 180.0 * x / numpy.pi
+
+
+def naive_deg2rad(x):
+ """
+ Naive implementation of degree to radiuan.
+
+ Useful for very old numpy (v1.0.1 on MacOSX from Risoe)
+ """
+ return x * numpy.pi / 180.
+
+
+try:
+ from numpy import rad2deg, deg2rad
+except ImportError:
+ # naive implementation for very old numpy (v1.0.1 on MacOSX from Risoe)
+ rad2deg = naive_deg2rad
+ deg2rad = naive_deg2rad
diff --git a/fabio/utils/pilutils.py b/fabio/utils/pilutils.py
new file mode 100644
index 0000000..954e495
--- /dev/null
+++ b/fabio/utils/pilutils.py
@@ -0,0 +1,129 @@
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE
+
+"""Helper functions using Python Imaging Library (PIL)
+"""
+
+__authors__ = ["Jérôme Kieffer", "Jon Wright"]
+__date__ = "27/07/2017"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__status__ = "stable"
+
+import logging
+import numpy
+
+logger = logging.getLogger(__name__)
+
+try:
+ from PIL import Image
+except ImportError:
+ Image = None
+
+
+PIL_TO_NUMPY = {
+ "I;8": numpy.uint8,
+ "I;16": numpy.uint16,
+ "I;16B": numpy.uint16, # big endian
+ "I;16L": numpy.uint16, # little endian
+ "I;32": numpy.uint32,
+ "I;32L": numpy.uint32, # little endian
+ "I;32B": numpy.uint32, # big endian
+ "F;32F": numpy.float32,
+ "F;32BF": numpy.float32, # big endian
+ "F;64F": numpy.float64,
+ "F;64BF": numpy.float64, # big endian
+ "F": numpy.float32,
+ "1": numpy.bool,
+ "I": numpy.int32,
+ "L": numpy.uint8,
+}
+
+
+NUMPY_TO_PIL = {
+ 'float32': "F",
+ 'int32': "F;32NS",
+ 'uint32': "F;32N",
+ 'int16': "F;16NS",
+ 'uint16': "F;16N",
+ 'int8': "F;8S",
+ 'uint8': "F;8"
+}
+
+
+def get_numpy_array(pil_image):
+ """
+ Returns a numpy array from a PIL image
+
+ :param PIL.Image pil_image: A PIL Image object
+ """
+ dim1, dim2 = pil_image.size
+ if pil_image.mode in PIL_TO_NUMPY:
+ dtype = PIL_TO_NUMPY[pil_image.mode]
+ else:
+ dtype = numpy.float32
+ pil_image = pil_image.convert("F")
+ try:
+ data = numpy.asarray(pil_image, dtype)
+ except:
+ # PIL does not support buffer interface (yet)
+ if hasattr(pil_image, "tobytes"):
+ data = numpy.fromstring(pil_image.tobytes(), dtype=dtype)
+ else:
+ data = numpy.fromstring(pil_image.tostring(), dtype=dtype)
+ # byteswap ?
+ if numpy.dtype(dtype).itemsize > 1:
+ need_swap = False
+ need_swap |= numpy.little_endian and "B" in pil_image.mode
+ need_swap |= not numpy.little_endian and pil_image.mode.endswith("L")
+ if need_swap:
+ data.byteswap(True)
+
+ data = data.reshape((dim2, dim1))
+ return data
+
+
+def create_pil_16(numpy_array):
+ """
+ Convert a numpy array to a Python Imaging Library 16 bit greyscale image.
+
+ :param numpy.ndarray numpy_array: A numpy array
+ """
+ if Image is None:
+ raise ImportError("PIL is not installed")
+
+ size = numpy_array.shape[:2][::-1]
+ if numpy_array.dtype.name in NUMPY_TO_PIL:
+ mode2 = NUMPY_TO_PIL[numpy_array.dtype.name]
+ mode1 = mode2[0]
+ else:
+ raise RuntimeError("Unknown numpy type: %s" % (numpy_array.dtype.type))
+ dats = numpy_array.tostring()
+ pil_image = Image.frombuffer(mode1, size, dats, "raw", mode2, 0, 1)
+
+ return pil_image
diff --git a/fabio/utils/setup.py b/fabio/utils/setup.py
new file mode 100644
index 0000000..0319fad
--- /dev/null
+++ b/fabio/utils/setup.py
@@ -0,0 +1,39 @@
+# coding: utf-8
+# /*##########################################################################
+# Copyright (C) 2016 European Synchrotron Radiation Facility
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+# ############################################################################*/
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "31/07/2017"
+
+from numpy.distutils.misc_util import Configuration
+
+
+def configuration(parent_package='', top_path=None):
+ config = Configuration('utils', parent_package, top_path)
+ return config
+
+
+if __name__ == "__main__":
+ from numpy.distutils.core import setup
+ setup(configuration=configuration)
diff --git a/fabio/xsdimage.py b/fabio/xsdimage.py
new file mode 100644
index 0000000..8edb80e
--- /dev/null
+++ b/fabio/xsdimage.py
@@ -0,0 +1,168 @@
+# coding: utf-8
+#
+# Project: FabIO X-ray image reader
+#
+# Copyright (C) 2010-2016 European Synchrotron Radiation Facility
+# Grenoble, France
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+"""
+Authors: Jérôme Kieffer, ESRF
+ email:jerome.kieffer@esrf.fr
+
+XSDimge are XML files containing numpy arrays
+"""
+# Get ready for python3:
+from __future__ import absolute_import, print_function, with_statement, division
+__author__ = "Jérôme Kieffer"
+__contact__ = "jerome.kieffer@esrf.eu"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+
+import logging
+import numpy
+import base64
+import hashlib
+
+from .fabioimage import FabioImage
+from .fabioutils import six
+
+logger = logging.getLogger(__name__)
+
+try:
+ import lxml.etree as etree
+except ImportError:
+ try:
+ # Try using the standard library
+ import xml.etree.ElementTree as etree
+ except ImportError:
+ logger.warning("xml/lxml library is probably not part of your python installation: disabling xsdimage format")
+ etree = None
+
+
+class XsdImage(FabioImage):
+ """
+ Read the XSDataImage XML File data format
+ """
+
+ DESCRIPTION = "XSDataImage XML file format"
+
+ DEFAULT_EXTENTIONS = ["xml", "xsd"]
+
+ def __init__(self, data=None, header=None, fname=None):
+ """
+ Constructor of the class XSDataImage.
+
+ :param str fname: the name of the file to open
+ """
+ FabioImage.__init__(self, data=data, header=header)
+ self.dims = []
+ self.size = None
+ self.coding = None
+ self.dtype = None
+ self.rawData = None
+ self.md5 = None
+ if fname is not None:
+ self.filename = fname
+ self.read(fname)
+
+ def read(self, fname, frame=None):
+ """
+ """
+ self.header = {}
+ self.resetvals()
+ self.filename = fname
+
+ with self._open(fname, "rb") as infile:
+ self._readheader(infile)
+
+ try:
+ self.dim1, self.dim2 = self.dims[:2]
+ except ValueError:
+ raise IOError("XSD file %s is corrupt, no dimensions in it" % fname)
+
+ exp_size = 1
+ for i in self.dims:
+ exp_size *= i
+ assert exp_size == self.size
+
+ decData = None
+ if self.coding == "base64":
+ decData = base64.b64decode(self.rawData)
+ elif self.coding == "base32":
+ decData = base64.b32decode(self.rawData)
+ elif self.coding == "base16":
+ decData = base64.b16decode(self.rawData)
+ else:
+ logger.warning("Unable to recognize the encoding of the data !!! got %s, expected base64, base32 or base16, I assume it is base64 " % self.coding)
+ decData = base64.b64decode(self.rawData)
+ if self.md5:
+ assert hashlib.md5(decData).hexdigest() == self.md5
+
+ self.data = numpy.fromstring(decData, dtype=self.dtype).reshape(tuple(self.dims))
+ if not numpy.little_endian: # by default little endian
+ self.data.byteswap(True)
+ self.resetvals()
+# # ensure the PIL image is reset
+ self.pilimage = None
+ return self
+
+ def _readheader(self, infile):
+ """
+ Read all headers in a file and populate self.header
+ data is not yet populated
+ :type infile: file object open in read mode
+ """
+ xml = etree.parse(infile)
+ self.dims = []
+ for i in xml.findall(".//shape"):
+ try:
+ self.dims.append(int(i.text))
+ except ValueError as error:
+ logger.warning("%s Shape: Unable to convert %s to integer in %s" % (error, i.text, i))
+ for i in xml.findall(".//size"):
+ try:
+ self.size = int(i.text)
+ except Exception as error:
+ logger.warning("%s Size: Unable to convert %s to integer in %s" % (error, i.text, i))
+ self.dtype = None
+ for i in xml.findall(".//dtype"):
+ self.dtype = i.text
+ self.coding = None
+ for i in xml.findall(".//coding"):
+ j = i.find("value")
+ if j is not None:
+ self.coding = j.text
+ self.rawData = None
+ for i in xml.findall(".//data"):
+ self.rawData = six.b(i.text)
+ self.md5 = None
+ for i in xml.findall(".//md5sum"):
+ j = i.find("value")
+ if j is not None:
+ self.md5 = j.text
+
+
+if etree is None:
+ # Hide the class if it can't work
+ XsdImage = None
+
+xsdimage = XsdImage
diff --git a/run_tests.py b/run_tests.py
new file mode 100755
index 0000000..43ae04b
--- /dev/null
+++ b/run_tests.py
@@ -0,0 +1,337 @@
+#!/usr/bin/env python
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2015-2016 European Synchrotron Radiation Facility
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+# ###########################################################################*/
+"""Run the tests of the project.
+
+This script expects a suite function in <project_package>.test,
+which returns a unittest.TestSuite.
+
+Test coverage dependencies: coverage, lxml.
+"""
+
+__authors__ = ["Jérôme Kieffer", "Thomas Vincent"]
+__date__ = "28/07/2017"
+__license__ = "MIT"
+
+import distutils.util
+import logging
+import os
+import subprocess
+import sys
+import time
+import unittest
+
+try:
+ import importlib
+except:
+ importer = __import__
+ old_importer = True
+else:
+ importer = importlib.import_module
+ old_importer = False
+
+
+logging.basicConfig(level=logging.WARNING)
+logger = logging.getLogger("run_tests")
+logger.setLevel(logging.WARNING)
+
+
+logger.info("Python %s %s" % (sys.version, tuple.__itemsize__ * 8))
+
+try:
+ import resource
+except ImportError:
+ resource = None
+ logger.warning("resource module missing")
+
+try:
+ import numpy
+except Exception as error:
+ logger.warning("Numpy missing: %s" % error)
+else:
+ logger.info("Numpy %s" % numpy.version.version)
+
+
+try:
+ import h5py
+except Exception as error:
+ logger.warning("h5py missing: %s" % error)
+else:
+ logger.info("h5py %s" % h5py.version.version)
+
+
+class TestResult(unittest.TestResult):
+ logger = logging.getLogger("memProf")
+ logger.setLevel(logging.DEBUG)
+ logger.handlers.append(logging.FileHandler("profile.log"))
+
+ def startTest(self, test):
+ self.__mem_start = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
+ self.__time_start = time.time()
+ unittest.TestResult.startTest(self, test)
+
+ def stopTest(self, test):
+ unittest.TestResult.stopTest(self, test)
+ self.logger.info("Time: %.3fs \t RAM: %.3f Mb\t%s" % (
+ time.time() - self.__time_start,
+ (resource.getrusage(resource.RUSAGE_SELF).ru_maxrss -
+ self.__mem_start) / 1e3,
+ test.id()))
+
+
+class ProfileTestRunner(unittest.TextTestRunner):
+ def _makeResult(self):
+ return TestResult(stream=sys.stderr, descriptions=True, verbosity=1)
+
+
+def report_rst(cov, package, version="0.0.0"):
+ """
+ Generate a report of test coverage in RST (for Sphinx inclusion)
+
+ :param cov: test coverage instance
+ :param str package: Name of the package
+ :return: RST string
+ """
+ import tempfile
+ fd, fn = tempfile.mkstemp(suffix=".xml")
+ os.close(fd)
+ cov.xml_report(outfile=fn)
+
+ from lxml import etree
+ xml = etree.parse(fn)
+ classes = xml.xpath("//class")
+
+ line0 = "Test coverage report for %s" % package
+ res = [line0, "=" * len(line0), ""]
+ res.append("Measured on *%s* version %s, %s" %
+ (package, version, time.strftime("%d/%m/%Y")))
+ res += ["",
+ ".. csv-table:: Test suite coverage",
+ ' :header: "Name", "Stmts", "Exec", "Cover"',
+ ' :widths: 35, 8, 8, 8',
+ '']
+ tot_sum_lines = 0
+ tot_sum_hits = 0
+
+ for cl in classes:
+ name = cl.get("name")
+ # fname = cl.get("filename")
+ lines = cl.find("lines").getchildren()
+ hits = [int(i.get("hits")) for i in lines]
+
+ sum_hits = sum(hits)
+ sum_lines = len(lines)
+
+ cover = 100.0 * sum_hits / sum_lines if sum_lines else 0
+
+ res.append(' "%s", "%s", "%s", "%.1f %%"' %
+ (name, sum_lines, sum_hits, cover))
+ tot_sum_lines += sum_lines
+ tot_sum_hits += sum_hits
+ res.append("")
+ res.append(' "%s total", "%s", "%s", "%.1f %%"' %
+ (package, tot_sum_lines, tot_sum_hits,
+ 100.0 * tot_sum_hits / tot_sum_lines if tot_sum_lines else 0))
+ res.append("")
+ return os.linesep.join(res)
+
+
+def get_project_name(root_dir):
+ """Retrieve project name by running python setup.py --name in root_dir.
+
+ :param str root_dir: Directory where to run the command.
+ :return: The name of the project stored in root_dir
+ """
+ logger.debug("Getting project name in %s" % root_dir)
+ p = subprocess.Popen([sys.executable, "setup.py", "--name"],
+ shell=False, cwd=root_dir, stdout=subprocess.PIPE)
+ name, stderr_data = p.communicate()
+ logger.debug("subprocess ended with rc= %s" % p.returncode)
+ return name.split()[-1].decode('ascii')
+
+
+def build_project(name, root_dir):
+ """Run python setup.py build for the project.
+
+ Build directory can be modified by environment variables.
+
+ :param str name: Name of the project.
+ :param str root_dir: Root directory of the project
+ :return: The path to the directory were build was performed
+ """
+ platform = distutils.util.get_platform()
+ architecture = "lib.%s-%i.%i" % (platform,
+ sys.version_info[0], sys.version_info[1])
+
+ if os.environ.get("PYBUILD_NAME") == name:
+ # we are in the debian packaging way
+ home = os.environ.get("PYTHONPATH", "").split(os.pathsep)[-1]
+ elif os.environ.get("BUILDPYTHONPATH"):
+ home = os.path.abspath(os.environ.get("BUILDPYTHONPATH", ""))
+ else:
+ home = os.path.join(root_dir, "build", architecture)
+
+ logger.warning("Building %s to %s" % (name, home))
+ p = subprocess.Popen([sys.executable, "setup.py", "build"],
+ shell=False, cwd=root_dir)
+ logger.debug("subprocess ended with rc= %s" % p.wait())
+ return home
+
+
+PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
+PROJECT_NAME = get_project_name(PROJECT_DIR)
+logger.info('Project name: %s' % PROJECT_NAME)
+
+from argparse import ArgumentParser
+
+parser = ArgumentParser(description='Run the tests.')
+
+parser.add_argument("-i", "--insource",
+ action="store_true", dest="insource", default=False,
+ help="Use the build source and not the installed version")
+parser.add_argument("-c", "--coverage", dest="coverage",
+ action="store_true", default=False,
+ help=("Report code coverage" +
+ "(requires 'coverage' and 'lxml' module)"))
+parser.add_argument("-m", "--memprofile", dest="memprofile",
+ action="store_true", default=False,
+ help="Report memory profiling")
+parser.add_argument("-v", "--verbose", default=0,
+ action="count", dest="verbose",
+ help="Increase verbosity. Option -v prints additional " +
+ "INFO messages. Use -vv for full verbosity, " +
+ "including debug messages and test help strings.")
+parser.add_argument(
+ "test_name", nargs='*', default=(),
+ help="Test names to run (Default: %s.test.suite)" % PROJECT_NAME)
+options = parser.parse_args()
+sys.argv = [sys.argv[0]]
+
+
+test_verbosity = 1
+if options.verbose == 1:
+ logging.root.setLevel(logging.INFO)
+ logger.info("Set log level: INFO")
+elif options.verbose > 1:
+ logging.root.setLevel(logging.DEBUG)
+ logger.info("Set log level: DEBUG")
+ test_verbosity = 2
+
+
+if options.coverage:
+ logger.info("Running test-coverage")
+ import coverage
+ try:
+ cov = coverage.Coverage(omit=["*test*", "*third_party*", "*/setup.py"])
+ except AttributeError:
+ cov = coverage.coverage(omit=["*test*", "*third_party*", "*/setup.py"])
+ cov.start()
+
+
+# Prevent importing from source directory
+if (os.path.dirname(os.path.abspath(__file__)) ==
+ os.path.abspath(sys.path[0])):
+ removed_from_sys_path = sys.path.pop(0)
+ logger.info("Patched sys.path, removed: '%s'" % removed_from_sys_path)
+
+
+# import module
+if not options.insource:
+ try:
+ module = importer(PROJECT_NAME)
+ except:
+ logger.warning(
+ "%s missing, using built (i.e. not installed) version",
+ PROJECT_NAME)
+ options.insource = True
+
+if options.insource:
+ build_dir = build_project(PROJECT_NAME, PROJECT_DIR)
+
+ sys.path.insert(0, build_dir)
+ logger.warning("Patched sys.path, added: '%s'" % build_dir)
+ module = importer(PROJECT_NAME)
+
+
+PROJECT_VERSION = getattr(module, 'version', '')
+PROJECT_PATH = module.__path__[0]
+
+
+# Run the tests
+if options.memprofile:
+ runner = ProfileTestRunner()
+else:
+ runner = unittest.TextTestRunner(
+ buffer=test_verbosity <= 1,
+ verbosity=test_verbosity)
+
+logger.warning("Test %s %s from %s",
+ PROJECT_NAME, PROJECT_VERSION, PROJECT_PATH)
+
+test_module_name = PROJECT_NAME + '.test'
+logger.info('Import %s', test_module_name)
+test_module = importer(test_module_name)
+utilstest = importer(test_module_name + ".utilstest")
+if old_importer:
+ test_module = getattr(test_module, "test")
+ print(dir(test_module))
+ utilstest = getattr(test_module, "utilstest")
+UtilsTest = getattr(utilstest, "UtilsTest")
+UtilsTest.image_home = os.path.join(PROJECT_DIR, 'testimages')
+UtilsTest.testimages = os.path.join(PROJECT_DIR, "all_testimages.json")
+UtilsTest.script_dir = os.path.join(PROJECT_DIR, "scripts")
+
+test_suite = unittest.TestSuite()
+
+if not options.test_name:
+ # Do not use test loader to avoid cryptic exception
+ # when an error occur during import
+ project_test_suite = getattr(test_module, 'suite')
+ test_suite.addTest(project_test_suite())
+else:
+ test_suite.addTest(
+ unittest.defaultTestLoader.loadTestsFromNames(options.test_name))
+
+result = runner.run(test_suite)
+for test, reason in result.skipped:
+ logger.warning('Skipped %s (%s): %s',
+ test.id(), test.shortDescription() or '', reason)
+
+if result.wasSuccessful():
+ logger.info("Test suite succeeded")
+ exit_status = 0
+else:
+ logger.warning("Test suite failed")
+ exit_status = 1
+
+
+if options.coverage:
+ cov.stop()
+ cov.save()
+ with open("coverage.rst", "w") as fn:
+ fn.write(report_rst(cov, PROJECT_NAME, PROJECT_VERSION))
+ print(cov.report())
+
+sys.exit(exit_status)
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..861a9f5
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,5 @@
+[egg_info]
+tag_build =
+tag_date = 0
+tag_svn_revision = 0
+
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..34fc837
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,705 @@
+#!/usr/bin/env python
+# coding: utf-8
+#
+# Project: Fable Input/Output
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# .
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# .
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+""" Setup script for python distutils package and fabio """
+
+from __future__ import print_function, division, with_statement, absolute_import
+
+
+__author__ = "Jerome Kieffer"
+__contact__ = "Jerome.Kieffer@ESRF.eu"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "31/07/2017"
+__status__ = "stable"
+
+import os
+import sys
+import glob
+import shutil
+import platform
+import logging
+
+logging.basicConfig(level=logging.INFO)
+logger = logging.getLogger("fabio.setup")
+
+
+from distutils.command.build import build as _build
+try:
+ from setuptools import Command
+ from setuptools.command.build_py import build_py as _build_py
+ from setuptools.command.build_ext import build_ext
+ from setuptools.command.sdist import sdist
+ from setuptools.command.install import install
+ logger.info("Use setuptools")
+except ImportError:
+ try:
+ from numpy.distutils.core import Command
+ except ImportError:
+ from distutils.core import Command
+ from distutils.command.build_py import build_py as _build_py
+ from distutils.command.build_ext import build_ext
+ from distutils.command.sdist import sdist
+ from distutils.command.install import install
+ logger.info("Use distutils")
+
+
+PROJECT = "fabio"
+
+################################################################################
+# Remove MANIFEST file ... it needs to be re-generated on the fly
+################################################################################
+
+manifest = os.path.join(os.path.dirname(os.path.abspath(__file__)), "MANIFEST")
+if os.path.isfile(manifest):
+ os.unlink(manifest)
+
+
+##############
+# version.py #
+##############
+
+class build_py(_build_py):
+ """
+ Enhanced build_py which copies version.py to <PROJECT>._version.py
+ """
+ def find_package_modules(self, package, package_dir):
+ modules = _build_py.find_package_modules(self, package, package_dir)
+ if package == PROJECT:
+ modules.append((PROJECT, '_version', 'version.py'))
+ return modules
+
+
+def get_version():
+ import version
+ return version.strictversion
+
+
+def get_readme():
+ """Provide the long description as an Unicode string"""
+ dirname = os.path.dirname(os.path.abspath(__file__))
+
+ with open(os.path.join(dirname, "README.rst"), "rb") as fp:
+ long_description = fp.read()
+ return long_description.decode("utf-8")
+
+
+#######################
+# build_doc commandes #
+#######################
+try:
+ import sphinx
+ import sphinx.util.console
+ sphinx.util.console.color_terminal = lambda: False
+ from sphinx.setup_command import BuildDoc as BuildDoc_
+except ImportError:
+ sphinx = None
+ BuildDoc = None
+
+else:
+ # i.e. if sphinx:
+ class BuildDoc(BuildDoc_):
+
+ def run(self):
+ # make sure the python path is pointing to the newly built
+ # code so that the documentation is built on this and not a
+ # previously installed version
+
+ build = self.get_finalized_command('build')
+ sys.path.insert(0, os.path.abspath(build.build_lib))
+ script_dir = os.path.abspath("scripts")
+ os.environ["PATH"] = "%s%s%s" % (script_dir, os.pathsep, os.environ.get("PATH", ""))
+ # Build the Users Guide in HTML and TeX format
+ for builder in ('html', 'latex'):
+ self.builder = builder
+ self.builder_target_dir = os.path.join(self.build_dir, builder)
+ self.mkpath(self.builder_target_dir)
+ BuildDoc_.run(self)
+ sys.path.pop(0)
+ os.environ["PATH"] = os.pathsep.join(os.environ.get("PATH").split(os.pathsep)[1:])
+
+
+class BuildMan(Command):
+ """Command to build man pages"""
+ user_options = []
+
+ def initialize_options(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+ def entry_points_iterator(self):
+ """Iterate other entry points available on the project."""
+ entry_points = self.distribution.entry_points
+ console_scripts = entry_points.get('console_scripts', [])
+ gui_scripts = entry_points.get('gui_scripts', [])
+ scripts = []
+ scripts.extend(console_scripts)
+ scripts.extend(gui_scripts)
+ for script in scripts:
+ elements = script.split("=")
+ target_name = elements[0].strip()
+ elements = elements[1].split(":")
+ module_name = elements[0].strip()
+ function_name = elements[1].strip()
+ yield target_name, module_name, function_name
+
+ def run(self):
+ build = self.get_finalized_command('build')
+ path = sys.path
+ path.insert(0, os.path.abspath(build.build_lib))
+
+ env = dict((str(k), str(v)) for k, v in os.environ.items())
+ env["PYTHONPATH"] = os.pathsep.join(path)
+
+ import subprocess
+
+ status = subprocess.call(["mkdir", "-p", "build/man"])
+ if status != 0:
+ raise RuntimeError("Fail to create build/man directory")
+
+ import tempfile
+ import stat
+ script_name = None
+
+ entry_points = self.entry_points_iterator()
+ for target_name, module_name, function_name in entry_points:
+ logger.info("Build man for entry-point target '%s'" % target_name)
+ # help2man expect a single executable file to extract the help
+ # we create it, execute it, and delete it at the end
+
+ py3 = sys.version_info >= (3, 0)
+ try:
+ # create a launcher using the right python interpreter
+ script_fid, script_name = tempfile.mkstemp(prefix="%s_" % target_name, text=True)
+ script = os.fdopen(script_fid, 'wt')
+ script.write("#!%s\n" % sys.executable)
+ script.write("import %s as app\n" % module_name)
+ script.write("app.%s()\n" % function_name)
+ script.close()
+ # make it executable
+ mode = os.stat(script_name).st_mode
+ os.chmod(script_name, mode + stat.S_IEXEC)
+
+ # execute help2man
+ man_file = "build/man/%s.1" % target_name
+ command_line = ["help2man", script_name, "-o", man_file]
+ if not py3:
+ # Before Python 3.4, ArgParser --version was using
+ # stderr to print the version
+ command_line.append("--no-discard-stderr")
+
+ p = subprocess.Popen(command_line, env=env)
+ status = p.wait()
+ if status != 0:
+ raise RuntimeError("Fail to generate '%s' man documentation" % target_name)
+ finally:
+ # clean up the script
+ if script_name is not None:
+ os.remove(script_name)
+
+
+# ############################# #
+# numpy.distutils Configuration #
+# ############################# #
+
+def configuration(parent_package='', top_path=None):
+ """Recursive construction of package info to be used in setup().
+
+ See http://docs.scipy.org/doc/numpy/reference/distutils.html#numpy.distutils.misc_util.Configuration
+ """
+ try:
+ from numpy.distutils.misc_util import Configuration
+ except ImportError:
+ raise ImportError(
+ "To install this package, you must install numpy first\n"
+ "(See https://pypi.python.org/pypi/numpy)")
+ config = Configuration(None, parent_package, top_path)
+ config.set_options(
+ ignore_setup_xxx_py=True,
+ assume_default_configuration=True,
+ delegate_options_to_subpackages=True,
+ quiet=True)
+ config.add_subpackage(PROJECT)
+ return config
+
+
+# ############## #
+# Compiler flags #
+# ############## #
+
+class Build(_build):
+ """Command to support more user options for the build."""
+
+ user_options = [
+ ('no-openmp', None,
+ "do not use OpenMP for compiled extension modules"),
+ ('openmp', None,
+ "use OpenMP for the compiled extension modules"),
+ ('no-cython', None,
+ "do not compile Cython extension modules (use default compiled c-files)"),
+ ('force-cython', None,
+ "recompile all Cython extension modules"),
+ ]
+ user_options.extend(_build.user_options)
+
+ boolean_options = ['no-openmp', 'openmp', 'no-cython', 'force-cython']
+ boolean_options.extend(_build.boolean_options)
+
+ def initialize_options(self):
+ _build.initialize_options(self)
+ self.no_openmp = None
+ self.openmp = None
+ self.no_cython = None
+ self.force_cython = None
+
+ def finalize_options(self):
+ _build.finalize_options(self)
+ self.finalize_cython_options(min_version='0.21.1')
+ self.finalize_openmp_options()
+
+ def _parse_env_as_bool(self, key):
+ content = os.environ.get(key, "")
+ value = content.lower()
+ if value in ["1", "true", "yes", "y"]:
+ return True
+ if value in ["0", "false", "no", "n"]:
+ return False
+ if value in ["none", ""]:
+ return None
+ msg = "Env variable '%s' contains '%s'. But a boolean or an empty \
+ string was expected. Variable ignored."
+ logger.warning(msg, key, content)
+ return None
+
+ def finalize_openmp_options(self):
+ """Check if extensions must be compiled with OpenMP.
+
+ The result is stored into the object.
+ """
+ if self.openmp:
+ use_openmp = True
+ elif self.no_openmp:
+ use_openmp = False
+ else:
+ env_force_cython = self._parse_env_as_bool("WITH_OPENMP")
+ if env_force_cython is not None:
+ use_openmp = env_force_cython
+ else:
+ # Use it by default
+ use_openmp = True
+
+ if use_openmp:
+ if platform.system() == "Darwin":
+ # By default Xcode5 & XCode6 do not support OpenMP, Xcode4 is OK.
+ osx = tuple([int(i) for i in platform.mac_ver()[0].split(".")])
+ if osx >= (10, 8):
+ logger.warning("OpenMP support ignored. Your platform do not support it")
+ use_openmp = False
+
+ # Remove attributes used by distutils parsing
+ # use 'use_openmp' instead
+ del self.no_openmp
+ del self.openmp
+ self.use_openmp = use_openmp
+
+ def finalize_cython_options(self, min_version=None):
+ """
+ Check if cythonization must be used for the extensions.
+
+ The result is stored into the object.
+ """
+
+ if self.force_cython:
+ use_cython = "force"
+ elif self.no_cython:
+ use_cython = "no"
+ else:
+ env_force_cython = self._parse_env_as_bool("FORCE_CYTHON")
+ env_with_cython = self._parse_env_as_bool("WITH_CYTHON")
+ if env_force_cython is True:
+ use_cython = "force"
+ elif env_with_cython is True:
+ use_cython = "yes"
+ elif env_with_cython is False:
+ use_cython = "no"
+ else:
+ # Use it by default
+ use_cython = "yes"
+
+ if use_cython in ["force", "yes"]:
+ try:
+ import Cython.Compiler.Version
+ if min_version and Cython.Compiler.Version.version < min_version:
+ msg = "Cython version is too old. At least version is %s \
+ expected. Cythonization is skipped."
+ logger.warning(msg, str(min_version))
+ use_cython = "no"
+ except ImportError:
+ msg = "Cython is not available. Cythonization is skipped."
+ logger.warning(msg)
+ use_cython = "no"
+
+ # Remove attribute used by distutils parsing
+ # use 'use_cython' and 'force_cython' instead
+ del self.no_cython
+ self.force_cython = use_cython == "force"
+ self.use_cython = use_cython in ["force", "yes"]
+
+
+class BuildExt(build_ext):
+ """Handle extension compilation.
+
+ Command-line argument and environment can custom:
+
+ - The use of cython to cythonize files, else a default version is used
+ - Build extension with support of OpenMP (by default it is enabled)
+ - If building with MSVC, compiler flags are converted from gcc flags.
+ """
+
+ COMPILE_ARGS_CONVERTER = {'-fopenmp': '/openmp'}
+
+ LINK_ARGS_CONVERTER = {'-fopenmp': ''}
+
+ description = 'Build pyFAI extensions'
+
+ def finalize_options(self):
+ build_ext.finalize_options(self)
+ build_obj = self.distribution.get_command_obj("build")
+ self.use_openmp = build_obj.use_openmp
+ self.use_cython = build_obj.use_cython
+ self.force_cython = build_obj.force_cython
+
+ def patch_with_default_cythonized_files(self, ext):
+ """Replace cython files by .c or .cpp files in extension's sources.
+
+ It replaces the *.pyx and *.py source files of the extensions
+ to either *.cpp or *.c source files.
+ No compilation is performed.
+
+ :param Extension ext: An extension to patch.
+ """
+ new_sources = []
+ for source in ext.sources:
+ base, file_ext = os.path.splitext(source)
+ if file_ext in ('.pyx', '.py'):
+ if ext.language == 'c++':
+ cythonized = base + '.cpp'
+ else:
+ cythonized = base + '.c'
+ if not os.path.isfile(cythonized):
+ raise RuntimeError("Source file not found: %s. Cython is needed" % cythonized)
+ print("Use default cythonized file for %s" % source)
+ new_sources.append(cythonized)
+ else:
+ new_sources.append(source)
+ ext.sources = new_sources
+
+ def patch_extension(self, ext):
+ """
+ Patch an extension according to requested Cython and OpenMP usage.
+
+ :param Extension ext: An extension
+ """
+ # Cytonize
+ if not self.use_cython:
+ self.patch_with_default_cythonized_files(ext)
+ else:
+ from Cython.Build import cythonize
+ patched_exts = cythonize(
+ [ext],
+ compiler_directives={'embedsignature': True},
+ force=self.force_cython,
+ compile_time_env={"HAVE_OPENMP": self.use_openmp}
+ )
+ ext.sources = patched_exts[0].sources
+
+ # Remove OpenMP flags if OpenMP is disabled
+ if not self.use_openmp:
+ ext.extra_compile_args = [
+ f for f in ext.extra_compile_args if f != '-fopenmp']
+ ext.extra_link_args = [
+ f for f in ext.extra_link_args if f != '-fopenmp']
+
+ # Convert flags from gcc to MSVC if required
+ if self.compiler.compiler_type == 'msvc':
+ ext.extra_compile_args = [self.COMPILE_ARGS_CONVERTER.get(f, f)
+ for f in ext.extra_compile_args]
+ ext.extra_link_args = [self.LINK_ARGS_CONVERTER.get(f, f)
+ for f in ext.extra_link_args]
+
+ def build_extensions(self):
+ for ext in self.extensions:
+ self.patch_extension(ext)
+ build_ext.build_extensions(self)
+
+
+################################################################################
+# Debian source tree
+################################################################################
+def download_images():
+ """
+ Download all test images and
+ """
+ root_dir = os.path.dirname(os.path.abspath(__file__))
+ test_dir = os.path.join(root_dir, PROJECT, "test")
+ sys.path.insert(0, test_dir)
+ from utilstest import UtilsTest
+ image_home = os.path.join(root_dir, "testimages")
+ testimages = os.path.join(root_dir, "all_testimages.json")
+ UtilsTest.image_home = image_home
+ UtilsTest.testimages = testimages
+ if os.path.exists(testimages):
+ import json
+ with open(testimages) as f:
+ all_files = set(json.load(f))
+ else:
+ raise(RuntimeError("Please run 'python setup.py build test' to download all images"))
+ for afile in all_files.copy():
+ if afile.endswith(".bz2"):
+ all_files.add(afile[:-4] + ".gz")
+ all_files.add(afile[:-4])
+ elif afile.endswith(".gz"):
+ all_files.add(afile[:-3] + ".bz2")
+ all_files.add(afile[:-3])
+ else:
+ all_files.add(afile + ".gz")
+ all_files.add(afile + ".bz2")
+ UtilsTest.download_images(all_files)
+ return list(all_files)
+
+
+class sdist_debian(sdist):
+ """
+ Tailor made sdist for debian
+ * remove auto-generated doc
+ * remove cython generated .c files
+ """
+ @staticmethod
+ def get_debian_name():
+ import version
+ name = "%s_%s" % (PROJECT, version.debianversion)
+ return name
+
+ def prune_file_list(self):
+ sdist.prune_file_list(self)
+ to_remove = ["doc/build", "doc/pdf", "doc/html", "pylint", "epydoc"]
+ print("Removing files for debian")
+ for rm in to_remove:
+ self.filelist.exclude_pattern(pattern="*", anchor=False, prefix=rm)
+ # this is for Cython files specifically
+ self.filelist.exclude_pattern(pattern="*.html", anchor=True, prefix=PROJECT + "ext")
+ for pyxf in glob.glob(PROJECT + "ext/*.pyx"):
+ cf = os.path.splitext(pyxf)[0] + ".c"
+ if os.path.isfile(cf):
+ self.filelist.exclude_pattern(pattern=cf)
+ # do not include third_party/_local files
+ self.filelist.exclude_pattern(pattern="*", prefix="fabio/third_party/_local")
+
+ def make_distribution(self):
+ self.prune_file_list()
+ sdist.make_distribution(self)
+ dest = self.archive_files[0]
+ dirname, basename = os.path.split(dest)
+ base, ext = os.path.splitext(basename)
+ while ext in [".zip", ".tar", ".bz2", ".gz", ".Z", ".lz", ".orig"]:
+ base, ext = os.path.splitext(base)
+ if ext:
+ dest = "".join((base, ext))
+ else:
+ dest = base
+ # sp = dest.split("-")
+ # base = sp[:-1]
+ # nr = sp[-1]
+ debian_arch = os.path.join(dirname, self.get_debian_name() + ".orig.tar.gz")
+ os.rename(self.archive_files[0], debian_arch)
+ self.archive_files = [debian_arch]
+ print("Building debian .orig.tar.gz in %s" % self.archive_files[0])
+
+
+class TestData(Command):
+ """
+ Tailor made tarball with test data
+ """
+ user_options = []
+
+ def initialize_options(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ datafiles = download_images()
+ dist = "dist"
+ arch = os.path.join(dist, PROJECT + "-testimages.tar.gz")
+ print("Building testdata tarball in %s" % arch)
+ if not os.path.isdir(dist):
+ os.mkdir(dist)
+ if os.path.exists(arch):
+ os.unlink(arch)
+ import tarfile
+ with tarfile.open(name=arch, mode='w:gz') as tarball:
+ for afile in datafiles:
+ tarball.add(os.path.join("testimages", afile), afile)
+
+
+class PyTest(Command):
+ user_options = []
+
+ def initialize_options(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ import subprocess
+ errno = subprocess.call([sys.executable, 'run_tests.py', '-i'])
+ if errno != 0:
+ raise SystemExit(errno)
+
+
+# double check classifiers on https://pypi.python.org/pypi?%3Aaction=list_classifiers
+classifiers = [
+ 'Development Status :: 5 - Production/Stable',
+ 'Environment :: Console',
+ 'Intended Audience :: End Users/Desktop',
+ 'Intended Audience :: Developers',
+ 'Intended Audience :: Science/Research',
+ "License :: OSI Approved :: MIT License",
+ 'Operating System :: MacOS :: MacOS X',
+ 'Operating System :: Microsoft :: Windows',
+ 'Operating System :: POSIX',
+ 'Programming Language :: Python',
+ 'Programming Language :: Cython',
+ 'Programming Language :: C',
+ 'Topic :: Scientific/Engineering :: Chemistry',
+ 'Topic :: Scientific/Engineering :: Bio-Informatics',
+ 'Topic :: Scientific/Engineering :: Physics',
+ 'Topic :: Scientific/Engineering :: Visualization',
+ 'Topic :: Software Development :: Libraries :: Python Modules',
+]
+
+
+def get_project_configuration(dry_run):
+ """Returns project arguments for setup"""
+ install_requires = ["numpy"]
+ setup_requires = ["numpy", "cython"]
+
+ console_scripts = [
+ 'fabio-convert = fabio.app.convert:main',
+ ]
+
+ gui_scripts = [
+ 'fabio_viewer = fabio.app.viewer:main',
+ ]
+
+ entry_points = {
+ 'console_scripts': console_scripts,
+ 'gui_scripts': gui_scripts,
+ }
+
+ cmdclass = dict(
+ build_py=build_py,
+ build=Build,
+ build_ext=BuildExt,
+ build_man=BuildMan,
+ debian_src=sdist_debian,
+ testimages=TestData,
+ test=PyTest)
+
+ if BuildDoc is not None:
+ cmdclass['build_doc'] = BuildDoc
+
+ if dry_run:
+ # DRY_RUN implies actions which do not require NumPy
+ #
+ # And they are required to succeed without Numpy for example when
+ # pip is used to install silx when Numpy is not yet present in
+ # the system.
+ setup_kwargs = {}
+ else:
+ config = configuration()
+ setup_kwargs = config.todict()
+
+ setup_kwargs.update(name=PROJECT,
+ version=get_version(),
+ url="http://github.com/silx-kit/fabio",
+ download_url="https://github.com/silx-kit/fabio/releases",
+ author="Henning Sorensen, Erik Knudsen, Jon Wright, Regis Perdreau, Jérôme Kieffer, Gael Goret, Brian Pauw",
+ author_email="fable-talk@lists.sourceforge.net",
+ classifiers=classifiers,
+ description='Image IO for fable',
+ long_description=get_readme(),
+ install_requires=install_requires,
+ setup_requires=setup_requires,
+ cmdclass=cmdclass,
+ zip_safe=False,
+ entry_points=entry_points,
+ test_suite="test",
+ license="MIT",
+ )
+ return setup_kwargs
+
+
+def setup_package():
+ """Run setup(**kwargs)
+
+ Depending on the command, it either runs the complete setup which depends on numpy,
+ or a *dry run* setup with no dependency on numpy.
+ """
+
+ # Check if action requires build/install
+ dry_run = len(sys.argv) == 1 or (len(sys.argv) >= 2 and (
+ '--help' in sys.argv[1:] or
+ sys.argv[1] in ('--help-commands', 'egg_info', '--version',
+ 'clean', '--name')))
+
+ if dry_run:
+ # DRY_RUN implies actions which do not require dependancies, like NumPy
+ try:
+ from setuptools import setup
+ logger.info("Use setuptools.setup")
+ except ImportError:
+ from distutils.core import setup
+ logger.info("Use distutils.core.setup")
+ else:
+ try:
+ from setuptools import setup
+ except ImportError:
+ from numpy.distutils.core import setup
+ logger.info("Use numpydistutils.setup")
+
+ setup_kwargs = get_project_configuration(dry_run)
+ setup(**setup_kwargs)
+
+
+if __name__ == "__main__":
+ setup_package()
diff --git a/stdeb.cfg b/stdeb.cfg
new file mode 100644
index 0000000..0c7f153
--- /dev/null
+++ b/stdeb.cfg
@@ -0,0 +1,8 @@
+[DEFAULT]
+Package: python-fabio
+Depends: python-numpy
+XS-Python-Version: >= 2.6
+Maintainer: Jerome Kieffer <jerome.kieffer@esrf.fr>
+Build-Depends: python-dev
+Recommends: python-imaging, python-numpy-ext, python-lxml,
+ python-qt4,python-matplotlib, pymca \ No newline at end of file
diff --git a/version.py b/version.py
new file mode 100644
index 0000000..16fdab5
--- /dev/null
+++ b/version.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python
+# coding: utf-8
+#
+# Project: X-ray image reader
+# https://github.com/silx-kit/fabio
+#
+# Copyright (C) 2015 European Synchrotron Radiation Facility, Grenoble, France
+#
+# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+"""
+
+Module for version handling:
+
+provides:
+* version = "1.2.3" or "1.2.3-beta4"
+* version_info = named tuple (1,2,3,"beta",4)
+* hexversion: 0x010203B4
+* strictversion = "1.2.3b4
+* debianversion = "1.2.3~beta4"
+
+This is called hexversion since it only really looks meaningful when viewed as the
+result of passing it to the built-in hex() function.
+The version_info value may be used for a more human-friendly encoding of the same information.
+
+The hexversion is a 32-bit number with the following layout:
+Bits (big endian order) Meaning
+1-8 PY_MAJOR_VERSION (the 2 in 2.1.0a3)
+9-16 PY_MINOR_VERSION (the 1 in 2.1.0a3)
+17-24 PY_MICRO_VERSION (the 0 in 2.1.0a3)
+25-28 PY_RELEASE_LEVEL (0xA for alpha, 0xB for beta, 0xC for release candidate and 0xF for final)
+29-32 PY_RELEASE_SERIAL (the 3 in 2.1.0a3, zero for final releases)
+
+Thus 2.1.0a3 is hexversion 0x020100a3.
+
+"""
+
+
+from __future__ import absolute_import, print_function, division
+
+__author__ = "Jerome Kieffer"
+__contact__ = "Jerome.Kieffer@ESRF.eu"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "29/08/2017"
+__status__ = "production"
+__docformat__ = 'restructuredtext'
+__all__ = ["date", "version_info", "strictversion", "hexversion", "debianversion"]
+
+RELEASE_LEVEL_VALUE = {"dev": 0,
+ "alpha": 10,
+ "beta": 11,
+ "gamma": 12,
+ "rc": 13,
+ "final": 15}
+
+MAJOR = 0
+MINOR = 5
+MICRO = 0
+RELEV = "final" # <16
+SERIAL = 0 # <16
+
+
+from collections import namedtuple
+_version_info = namedtuple("version_info", ["major", "minor", "micro", "releaselevel", "serial"])
+
+version_info = _version_info(MAJOR, MINOR, MICRO, RELEV, SERIAL)
+
+strictversion = version = debianversion = "%d.%d.%d" % version_info[:3]
+if version_info.releaselevel != "final":
+ version += "-%s%s" % version_info[-2:]
+ debianversion += "~adev%i" % version_info[-1] if RELEV == "dev" else "~%s%i" % version_info[-2:]
+ prerel = "a" if RELEASE_LEVEL_VALUE.get(version_info[3], 0) < 10 else "b"
+ if prerel not in "ab":
+ prerel = "a"
+ strictversion += prerel + str(version_info[-1])
+
+hexversion = version_info[4]
+hexversion |= RELEASE_LEVEL_VALUE.get(version_info[3], 0) * 1 << 4
+hexversion |= version_info[2] * 1 << 8
+hexversion |= version_info[1] * 1 << 16
+hexversion |= version_info[0] * 1 << 24
+
+if __name__ == "__main__":
+ print(version)